Skip to content

Commit

Permalink
Updated the dependancy and fix the code as per latest document
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Aug 22, 2024
1 parent 0b67931 commit e3d03af
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 143 deletions.
9 changes: 5 additions & 4 deletions collectors/googlestackdriver/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ timestamp < "${state.until}"`;
return callback(null, logs, newState, newState.poll_interval_sec);
})
.catch(err => {
AlLogger.error(`GSTA000003 err in collection ${JSON.stringify(err)}`);
AlLogger.debug(`GSTA000003 err in collection ${JSON.stringify(err)}`);
// Stackdriver Logging api has some rate limits that we might run into.
// If we run inot a rate limit error, instead of returning the error,
// we return the state back to the queue with an additional second added, up to 15 min
Expand Down Expand Up @@ -172,11 +172,12 @@ timestamp < "${state.until}"`;
return callback(null, [], backOffState, nextPollInterval);
});
} else {
let error = err.response && err.response.data ? err.response.data : err;
// set errorCode if not available in error object to showcase client error on DDMetrics
if (err.code) {
err.errorCode = err.code;
if (err.errors && err.errors.length > 0 && err.errors[0].reason) {
error.errorCode = err.errors[0].reason;
}
return callback(err);
return callback(error);
}
});
}
Expand Down
30 changes: 15 additions & 15 deletions collectors/googlestackdriver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "googlestackdriver-collector",
"version": "1.2.13",
"version": "1.2.14",
"description": "Alert Logic AWS based Googlestackdriver Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,28 +9,28 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.632.0",
"@aws-sdk/client-cloudwatch": "^3.632.0",
"@aws-sdk/client-dynamodb": "^3.632.0",
"@aws-sdk/client-kms": "^3.632.0",
"@aws-sdk/client-lambda": "^3.632.0",
"@aws-sdk/client-s3": "^3.633.0",
"@aws-sdk/client-sqs": "^3.632.0",
"@aws-sdk/client-ssm": "^3.632.0",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"async": "^3.2.5",
"debug": "^4.3.5",
"google-auth-library": "^9.11.0",
"googleapis": "^126.0.0",
"debug": "^4.3.6",
"google-auth-library": "^9.13.0",
"googleapis": "^140.0.1",
"moment": "2.30.1"
},
"author": "Alert Logic Inc."
Expand Down
30 changes: 15 additions & 15 deletions collectors/gsuite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gsuite-collector",
"version": "1.2.54",
"version": "1.2.55",
"description": "Alert Logic AWS based Gsuite Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,28 +9,28 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.632.0",
"@aws-sdk/client-cloudwatch": "^3.632.0",
"@aws-sdk/client-dynamodb": "^3.632.0",
"@aws-sdk/client-kms": "^3.632.0",
"@aws-sdk/client-lambda": "^3.634.0",
"@aws-sdk/client-s3": "^3.633.0",
"@aws-sdk/client-sqs": "^3.632.0",
"@aws-sdk/client-ssm": "^3.632.0",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"moment": "2.30.1",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"async": "^3.2.5",
"debug": "^4.3.5",
"googleapis": "^126.0.0",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"async": "^3.2.6",
"debug": "^4.3.6",
"googleapis": "^142.0.0",
"moment": "2.30.1"
},
"author": "Alert Logic Inc."
Expand Down
32 changes: 16 additions & 16 deletions collectors/mimecast/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mimecast-collector",
"version": "1.0.46",
"version": "1.0.47",
"description": "Alert Logic AWS based Mimecast Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,30 +9,30 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.635.0",
"@aws-sdk/client-cloudwatch": "^3.635.0",
"@aws-sdk/client-dynamodb": "^3.635.0",
"@aws-sdk/client-kms": "^3.635.0",
"@aws-sdk/client-lambda": "^3.635.0",
"@aws-sdk/client-s3": "^3.635.0",
"@aws-sdk/client-sqs": "^3.635.0",
"@aws-sdk/client-ssm": "^3.635.0",
"@types/adm-zip": "0.5.5",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"adm-zip": "^0.5.14",
"async": "^3.2.5",
"debug": "^4.3.5",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"adm-zip": "^0.5.15",
"async": "^3.2.6",
"debug": "^4.3.6",
"moment": "2.30.1",
"uuid": "^9.0.0"
"uuid": "^10.0.0"
},
"author": "Alert Logic Inc."
}
15 changes: 14 additions & 1 deletion collectors/o365/o365_collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class O365Collector extends PawsCollector {
const contentUriFun = ({contentUri}) => collector.o365_mgmnt_client.getPreFormedUrl(contentUri);
const poolLimit = 20;

return asyncPool(poolLimit, parsedBody, contentUriFun).then(content => {
return this.asyncPoolAll(poolLimit, parsedBody, contentUriFun).then(content => {
return {
logs: content.reduce((agg, {parsedBody}) => [...parsedBody, ...agg], []),
nextPage: nextPageUri
Expand Down Expand Up @@ -201,6 +201,19 @@ class O365Collector extends PawsCollector {
});
}

/**
* Upgraded asyncPool to 2.x which use the async iterator (ES9)
* @param {...any} args
* @returns
*/
async asyncPoolAll(...args) {
const results = [];
for await (const result of asyncPool(...args)) {
results.push(result);
}
return results;
}

_getNextCollectionState(curState) {
const untilMoment = moment(curState.until);

Expand Down
31 changes: 16 additions & 15 deletions collectors/o365/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "o365-collector",
"version": "1.2.66",
"version": "1.2.67",
"description": "Alert Logic AWS based O365 Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,32 +9,33 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.632.0",
"@aws-sdk/client-cloudwatch": "^3.632.0",
"@aws-sdk/client-dynamodb": "^3.632.0",
"@aws-sdk/client-kms": "^3.632.0",
"@aws-sdk/client-lambda": "^3.634.0",
"@aws-sdk/client-s3": "^3.633.0",
"@aws-sdk/client-sqs": "^3.632.0",
"@aws-sdk/client-ssm": "^3.632.0",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-aws-collector-js": "4.1.26",
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"@azure/ms-rest-azure-js": "2.1.0",
"@azure/ms-rest-js": "2.7.0",
"@azure/ms-rest-nodeauth": "3.1.1",
"async": "^3.2.5",
"debug": "^4.3.5",
"@smithy/node-http-handler": "^3.1.4",
"async": "^3.2.6",
"debug": "^4.3.6",
"moment": "2.30.1",
"tiny-async-pool": "^1.3.0"
"tiny-async-pool": "^2.1.0"
},
"author": "Alert Logic Inc."
}
32 changes: 16 additions & 16 deletions collectors/okta/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "okta-collector",
"version": "1.2.26",
"version": "1.2.27",
"description": "Alert Logic AWS based Okta Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,28 +9,28 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.635.0",
"@aws-sdk/client-cloudwatch": "^3.635.0",
"@aws-sdk/client-dynamodb": "^3.635.0",
"@aws-sdk/client-kms": "^3.635.0",
"@aws-sdk/client-lambda": "^3.635.0",
"@aws-sdk/client-s3": "^3.635.0",
"@aws-sdk/client-sqs": "^3.635.0",
"@aws-sdk/client-ssm": "^3.635.0",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"nock": "^13.5.4",
"nock": "^13.5.5",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"@okta/okta-sdk-nodejs": "^6.6.0",
"async": "^3.2.5",
"debug": "^4.3.5",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"@okta/okta-sdk-nodejs": "^7.1.1",
"async": "^3.2.6",
"debug": "^4.3.6",
"moment": "2.30.1"
},
"author": "Alert Logic Inc."
Expand Down
30 changes: 15 additions & 15 deletions collectors/salesforce/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "salesforce-collector",
"version": "1.1.55",
"version": "1.1.56",
"description": "Alert Logic AWS based Salesforce Log Collector",
"repository": {},
"private": true,
Expand All @@ -9,27 +9,27 @@
"test": "JUNIT_REPORT_PATH=./test/report.xml nyc --reporter=text mocha --colors"
},
"devDependencies": {
"@aws-sdk/client-cloudformation": "^3.600.0",
"@aws-sdk/client-cloudwatch": "^3.600.0",
"@aws-sdk/client-dynamodb": "^3.602.0",
"@aws-sdk/client-kms": "^3.600.0",
"@aws-sdk/client-lambda": "^3.600.0",
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/client-sqs": "^3.600.0",
"@aws-sdk/client-ssm": "^3.600.0",
"@aws-sdk/client-cloudformation": "^3.635.0",
"@aws-sdk/client-cloudwatch": "^3.635.0",
"@aws-sdk/client-dynamodb": "^3.635.0",
"@aws-sdk/client-kms": "^3.635.0",
"@aws-sdk/client-lambda": "^3.636.0",
"@aws-sdk/client-s3": "^3.635.0",
"@aws-sdk/client-sqs": "^3.635.0",
"@aws-sdk/client-ssm": "^3.635.0",
"jshint": "^2.13.6",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-jenkins-reporter": "^0.4.8",
"nyc": "^17.0.0",
"rewire": "^7.0.0",
"sinon": "^18.0.0"
},
"dependencies": {
"@alertlogic/al-collector-js": "3.0.11",
"@alertlogic/paws-collector": "2.2.3",
"async": "^3.2.5",
"debug": "^4.3.5",
"jsforce": "^1.11.1",
"@alertlogic/al-collector-js": "3.0.12",
"@alertlogic/paws-collector": "2.2.5",
"async": "^3.2.6",
"debug": "^4.3.6",
"jsforce": "^3.4.1",
"jsonwebtoken": "^9.0.2",
"moment": "2.30.1"
},
Expand Down
Loading

0 comments on commit e3d03af

Please sign in to comment.