-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtail_am
More file actions
executable file
·238 lines (215 loc) · 10.1 KB
/
tail_am
File metadata and controls
executable file
·238 lines (215 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/usr/bin/env node
require('dotenv').config()
// Specify the full base URL of the FIDC service.
const origin = process.env.ORIGIN;
// Specify the log API key and secret,
// as described in https://backstage.forgerock.com/docs/idcloud/latest/paas/tenant/audit-logs.html#api-key
const api_key_id = process.env.API_KEY_ID;
const api_key_secret = process.env.API_KEY_SECRET;
/* Specify the logs' source, as described in https://backstage.forgerock.com/docs/idcloud/latest/paas/tenant/audit-logs.html#getting_sources
Currently available sources are listed below.
Uncomment the source you want to use.
For development and debugging use "am-core" and "idm-core" respectively.
*/
// const source = 'am-access'
// const source = 'am-activity'
// const source = 'am-authentication'
// const source = 'am-config'
const source = 'am-core'
// const source = 'am-everything'
// const source = 'ctsstore'
// const source = 'ctsstore-access'
// const source = 'ctsstore-config-audit'
// const source = 'ctsstore-upgrade'
// const source = 'idm-access'
// const source = 'idm-activity'
// const source = 'idm-authentication'
// const source = 'idm-config'
// const source = 'idm-core'
// const source = 'idm-everything'
// const source = 'idm-sync'
// const source = 'userstore'
// const source = 'userstore-access'
// const source = 'userstore-config-audit'
// const source = 'userstore-ldif-importer'
// const source = 'userstore-upgrade'
// import categories from('./categories.json');
const misc_noise = [
'text/plain',
'com.iplanet.dpro.session.operations.ServerSessionOperationStrategy',
'com.iplanet.dpro.session.SessionIDFactory',
'com.iplanet.dpro.session.share.SessionEncodeURL',
'com.iplanet.services.naming.WebtopNaming',
'com.iplanet.sso.providers.dpro.SSOProviderImpl',
'com.sun.identity.authentication.AuthContext',
'com.sun.identity.authentication.client.AuthClientUtils',
'com.sun.identity.authentication.config.AMAuthConfigType',
'com.sun.identity.authentication.config.AMAuthenticationManager',
'com.sun.identity.authentication.config.AMAuthLevelManager',
'com.sun.identity.authentication.config.AMConfiguration',
'com.sun.identity.authentication.jaas.LoginContext',
'com.sun.identity.authentication.modules.application.Application',
'com.sun.identity.authentication.server.AuthContextLocal',
'com.sun.identity.authentication.service.AMLoginContext',
'com.sun.identity.authentication.service.AuthContextLookup',
'com.sun.identity.authentication.service.AuthD',
'com.sun.identity.authentication.service.AuthUtils',
'com.sun.identity.authentication.service.DSAMECallbackHandler',
'com.sun.identity.authentication.service.LoginState',
'com.sun.identity.authentication.spi.AMLoginModule',
'com.sun.identity.delegation.DelegationEvaluatorImpl',
'com.sun.identity.idm.plugins.internal.AgentsRepo',
'com.sun.identity.idm.server.IdCachedServicesImpl',
'com.sun.identity.idm.server.IdRepoPluginsCache',
'com.sun.identity.idm.server.IdServicesImpl',
'com.sun.identity.log.spi.ISDebug',
'com.sun.identity.shared.encode.CookieUtils',
'com.sun.identity.sm.ldap.SMSLdapObject',
'com.sun.identity.sm.CachedSMSEntry',
'com.sun.identity.sm.CachedSubEntries',
'com.sun.identity.sm.DNMapper',
'com.sun.identity.sm.ServiceConfigImpl',
'com.sun.identity.sm.ServiceConfigManagerImpl',
'com.sun.identity.sm.SMSEntry',
'com.sun.identity.sm.SMSUtils',
'com.sun.identity.sm.SmsWrapperObject',
'org.apache.http.client.protocol.RequestAuthCache',
'org.apache.http.impl.conn.PoolingHttpClientConnectionManager',
'org.apache.http.impl.nio.client.InternalHttpAsyncClient',
'org.apache.http.impl.nio.client.InternalIODispatch',
'org.apache.http.impl.nio.client.MainClientExec',
'org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl',
'org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager',
'org.forgerock.audit.AuditServiceImpl',
'org.forgerock.bloomfilter.ConcurrentRollingBloomFilter',
'org.forgerock.bloomfilter.ExpiringBloomFilter',
'org.forgerock.oauth2.core.RealmOAuth2ProviderSettings',
'org.forgerock.openam.authentication.service.JAASModuleDetector',
'org.forgerock.openam.authentication.service.LoginContextFactory',
'org.forgerock.openam.blacklist.BloomFilterBlacklist',
'org.forgerock.openam.blacklist.CTSBlacklist',
'org.forgerock.openam.core.realms.impl.CachingRealmLookup',
'org.forgerock.openam.core.rest.authn.RestAuthCallbackHandlerManager',
'org.forgerock.openam.core.rest.authn.trees.AuthTrees',
'org.forgerock.openam.cors.CorsFilter',
'org.forgerock.openam.cts.CTSPersistentStoreImpl',
'org.forgerock.openam.cts.impl.CoreTokenAdapter',
'org.forgerock.openam.cts.impl.queue.AsyncResultHandler',
'org.forgerock.openam.cts.reaper.ReaperDeleteOnQueryResultHandler',
'org.forgerock.openam.headers.DisableSameSiteCookiesFilter',
'org.forgerock.openam.idrepo.ldap.DJLDAPv3Repo',
'org.forgerock.openam.rest.CsrfFilter',
'org.forgerock.openam.rest.restAuthenticationFilter',
'org.forgerock.openam.rest.fluent.CrestLoggingFilter',
'org.forgerock.openam.session.cts.CtsOperations',
'org.forgerock.openam.session.stateless.StatelessSessionManager',
'org.forgerock.openam.sm.datalayer.impl.ldap.ExternalLdapConfig',
'org.forgerock.openam.sm.datalayer.impl.ldap.LdapQueryBuilder',
'org.forgerock.openam.sm.datalayer.impl.SeriesTaskExecutor',
'org.forgerock.openam.sm.datalayer.impl.SeriesTaskExecutorThread',
'org.forgerock.openam.sm.datalayer.providers.LdapConnectionFactoryProvider',
'org.forgerock.openam.sm.file.ConfigFileSystemHandler',
'org.forgerock.openam.social.idp.SocialIdentityProviders',
'org.forgerock.openam.utils.ClientUtils',
'org.forgerock.opendj.ldap.CachedConnectionPool',
'org.forgerock.opendj.ldap.LoadBalancer',
'org.forgerock.secrets.keystore.KeyStoreSecretStore',
'org.forgerock.secrets.propertyresolver.PropertyResolverSecretStore',
'org.forgerock.secrets.SecretsProvider',
'org.forgerock.openam.core.rest.server.ServerInfoResource',
'org.forgerock.openam.oauth2.token.grantset.AbstractGrantSetTokenStore',
'org.forgerock.openam.secrets.SecretsProviderFacade',
'com.iplanet.services.ldap.event.LDAPv3PersistentSearch',
'com.sun.identity.policy.PolicyContinuousListener',
'org.forgerock.openam.cts.reaper.TokenDeleter',
'com.iplanet.dpro.session.service.AgentSessionNotificationPublisher',
'com.iplanet.dpro.session.service.SessionNotificationSender',
'org.forgerock.openam.oauth2.secrets.MappedPurposeDelegatingSecretStore',
'com.sun.identity.idm.AMIdentity',
'com.sun.identity.idm.IdUtils',
'org.forgerock.openam.rest.SSOTokenFactory',
'org.forgerock.openam.core.rest.IdentityResourceV2',
'com.iplanet.dpro.session.service.SessionServiceConfig$HotSwappableSessionServiceConfig',
'com.sun.identity.common.ISAccountLockout'
]
const auth_noise = [
'com.sun.identity.authentication.util.AMAuthUtils',
'org.forgerock.oauth2.core.AuthorizationService',
'com.sun.identity.authentication.service.AMAccountLockout'
];
const oidc_noise = [
'org.forgerock.openam.oauth2.token.OpenIdConnectTokenStore',
]
const journeys_noise = [
'org.forgerock.openam.auth.trees.engine.AuthTreeExecutor',
'org.forgerock.openam.auth.nodes.helpers.AuthNodeUserIdentityHelper',
'org.forgerock.openam.auth.nodes.AttributeCollectorNode'
]
const journeys = [
'org.forgerock.openam.auth.nodes.SelectIdPNode',
'org.forgerock.openam.auth.nodes.ValidatedPasswordNode',
'org.forgerock.openam.auth.nodes.ValidatedUsernameNode',
'org.forgerock.openam.auth.trees.engine.AuthTreeExecutor'
]
const saml_noise = [
'com.sun.identity.cot.COTCache',
'com.sun.identity.plugin.configuration.impl.ConfigurationInstanceImpl',
'com.sun.identity.saml2.meta.SAML2MetaCache',
'com.sun.identity.saml2.profile.CacheCleanUpRunnable',
'org.apache.xml.security.keys.KeyInfo',
'org.apache.xml.security.signature.XMLSignature',
'org.apache.xml.security.utils.SignerOutputStream',
'org.apache.xml.security.utils.resolver.ResourceResolver',
'org.apache.xml.security.utils.resolver.implementations.ResolverFragment',
'org.apache.xml.security.algorithms.JCEMapper',
'org.apache.xml.security.algorithms.implementations.SignatureBaseRSA',
'org.apache.xml.security.algorithms.SignatureAlgorithm',
'org.apache.xml.security.utils.ElementProxy',
'org.apache.xml.security.transforms.Transforms',
'org.apache.xml.security.utils.DigesterOutputStream',
'org.apache.xml.security.signature.Reference',
'org.apache.xml.security.signature.Manifest',
'org.forgerock.util.i18n.PreferredLocales',
'com.sun.identity.saml2.meta.SAML2MetaManager'
]
const script_noise = [
'org.forgerock.openam.scripting.sandbox.RhinoSandboxClassShutter',
'org.forgerock.openam.cors.CorsService',
'com.sun.identity.sm.OrganizationConfigManagerImpl',
'org.forgerock.openam.scripting.StandardScriptEvaluator',
];
const scripted_node = [
'scripts.AUTHENTICATION_TREE_DECISION_NODE',
'org.forgerock.openam.auth.nodes.ScriptedDecisionNode'
]
const saml = [
'jsp.saml2.spAssertionConsumer',
'com.sun.identity.saml.common.SAMLUtils',
'com.sun.identity.saml2.common.SAML2Utils',
'com.sun.identity.saml2.meta.SAML2MetaManager',
'com.sun.identity.saml2.xmlsig.FMSigProvider'
]
const noise = misc_noise.concat(saml_noise).concat(journeys_noise).concat(script_noise).concat(oidc_noise).concat(auth_noise);
const nofilter = [];
/**
* Function declaration.
* Processes the logs' content: filters, formats, etc.
* If undefined, a default one is applied that is defined in `tail.js`:
* @param {object} logsObject The object containing logs.
* @param {object[]} [logsObject.result] An array of logs.
* @param {string|object} [logsObject.result.payload] A log payload.
*/
const showLogs = undefined
// End of user input.
const tail = require('./tail.js')
tail({
origin: origin,
api_key_id: api_key_id,
api_key_secret: api_key_secret,
source: source,
frequency: 10,
exclude: true,
filter: misc_noise,
showLogs: showLogs,
scriptonly: false
})