From a5eedb8126db5630d3f390d0e63bd9c725b16ef7 Mon Sep 17 00:00:00 2001 From: kkuzmin Date: Fri, 27 Mar 2020 09:50:45 +0000 Subject: [PATCH] Update Auth0 and Okta (#94) * Update Auth0 and Okta * Minor refactor --- collectors/auth0/.npmrc | 1 + collectors/auth0/auth0_collector.js | 6 +++++- collectors/auth0/package.json | 4 ++-- collectors/okta/.npmrc | 1 + collectors/okta/okta_collector.js | 8 +++++--- collectors/okta/package.json | 4 ++-- collectors/template/.npmrc | 1 + collectors/template/collector.js.template | 1 + 8 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 collectors/auth0/.npmrc create mode 100644 collectors/okta/.npmrc create mode 100644 collectors/template/.npmrc diff --git a/collectors/auth0/.npmrc b/collectors/auth0/.npmrc new file mode 100644 index 00000000..43c97e71 --- /dev/null +++ b/collectors/auth0/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/collectors/auth0/auth0_collector.js b/collectors/auth0/auth0_collector.js index 05aafa8b..53fc5238 100644 --- a/collectors/auth0/auth0_collector.js +++ b/collectors/auth0/auth0_collector.js @@ -14,7 +14,7 @@ const request = require('request'); const parse = require('@alertlogic/al-collector-js').Parse; const ManagementClient = require('auth0').ManagementClient; const PawsCollector = require('@alertlogic/paws-collector').PawsCollector; - +const packageJson = require('./package.json'); const typeIdPaths = [ { path: ['type'] } @@ -29,6 +29,10 @@ const HOSTNAME_REGEXP = /^[htps]*:\/\/|\/$/gi; class Auth0Collector extends PawsCollector { + constructor(context, creds){ + super(context, creds, packageJson.version); + } + pawsInitCollectionState(event, callback) { const initialState = { since: process.env.paws_collection_start_ts ? process.env.paws_collection_start_ts : moment().subtract(5, 'minutes').toISOString(), diff --git a/collectors/auth0/package.json b/collectors/auth0/package.json index 576b74c9..b1613c8a 100644 --- a/collectors/auth0/package.json +++ b/collectors/auth0/package.json @@ -1,6 +1,6 @@ { "name": "auth0-collector", - "version": "1.1.2", + "version": "1.1.3", "description": "Alert Logic AWS based Auth0 Log Collector extension", "repository": {}, "private": true, @@ -21,7 +21,7 @@ "dependencies": { "auth0": "2.20.0", "@alertlogic/al-collector-js": "^1.4.5", - "@alertlogic/paws-collector": "^1.1.6", + "@alertlogic/paws-collector": "^1.1.7", "async": "3.1.0", "debug": "4.1.1", "moment": "2.24.0" diff --git a/collectors/okta/.npmrc b/collectors/okta/.npmrc new file mode 100644 index 00000000..43c97e71 --- /dev/null +++ b/collectors/okta/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/collectors/okta/okta_collector.js b/collectors/okta/okta_collector.js index f141b92b..57de5233 100644 --- a/collectors/okta/okta_collector.js +++ b/collectors/okta/okta_collector.js @@ -11,11 +11,13 @@ const moment = require('moment'); const okta = require('@okta/okta-sdk-nodejs'); -const healthChecks = require('./health_checks'); const parse = require('@alertlogic/al-collector-js').Parse; const PawsCollector = require('@alertlogic/paws-collector').PawsCollector; const calcNextCollectionInterval = require('@alertlogic/paws-collector').calcNextCollectionInterval; +const packageJson = require('./package.json'); +const healthChecks = require('./health_checks'); + const THROTTLING_ERROR_REGEXP = /rateLimit/g; const typeIdPaths = [ @@ -35,9 +37,9 @@ const sensitiveFields = [ class OktaCollector extends PawsCollector { - constructor(context, {aimsCreds, pawsCreds}){ + constructor(context, creds){ super(context, - {aimsCreds, pawsCreds}, + creds, packageJson.version, [healthChecks.oktaTokenHealthCheck], []); } diff --git a/collectors/okta/package.json b/collectors/okta/package.json index c0b57b22..c0ca38c2 100644 --- a/collectors/okta/package.json +++ b/collectors/okta/package.json @@ -1,6 +1,6 @@ { "name": "okta-collector", - "version": "1.1.3", + "version": "1.1.4", "description": "Alert Logic AWS based Okta Log Collector", "repository": {}, "private": true, @@ -22,7 +22,7 @@ "dependencies": { "@okta/okta-sdk-nodejs": "3.1.0", "@alertlogic/al-collector-js": "^1.4.5", - "@alertlogic/paws-collector": "^1.1.6", + "@alertlogic/paws-collector": "^1.1.7", "async": "3.1.0", "debug": "4.1.1", "moment": "2.24.0" diff --git a/collectors/template/.npmrc b/collectors/template/.npmrc new file mode 100644 index 00000000..43c97e71 --- /dev/null +++ b/collectors/template/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/collectors/template/collector.js.template b/collectors/template/collector.js.template index 4420e9ea..c4fb01c8 100644 --- a/collectors/template/collector.js.template +++ b/collectors/template/collector.js.template @@ -12,6 +12,7 @@ const moment = require('moment'); const PawsCollector = require('@alertlogic/paws-collector').PawsCollector; const parse = require('@alertlogic/al-collector-js').Parse; +const packageJson = require('./package.json'); const typeIdPaths = [