Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin aws sdk version #2081

Closed
wants to merge 10 commits into from
10 changes: 8 additions & 2 deletions collectors/aws/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@

var AWS = require('aws-sdk');
var async = require('async');
var https = require('https');
var helpers = require(__dirname + '/../../helpers/aws');
var collectors = require(__dirname + '/../../collectors/aws');
var collectData = require(__dirname + '/../../helpers/shared.js');
var proxy = require('proxy-agent');

// Configure proxy from environment variables if exists
// Envs: http_proxy, https_proxy, no_proxy
var agent = new proxy.ProxyAgent();

// Override max sockets
var agent = new https.Agent({maxSockets: 100});
agent.maxFreeSockets = 100

AWS.config.update({httpOptions: {agent: agent}});

var rateError = {message: 'rate', statusCode: 429};
Expand Down
9 changes: 7 additions & 2 deletions collectors/aws/collector_multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@

var AWS = require('aws-sdk');
var async = require('async');
var https = require('https');
var helpers = require(__dirname + '/../../helpers/aws');
var collectors = require(__dirname + '/../../collectors/aws');
var collectData = require(__dirname + '/../../helpers/shared.js');
var proxy = require('proxy-agent');

// Configure proxy from environment variables if exists
// Envs: http_proxy, https_proxy, no_proxy
var agent = new proxy.ProxyAgent();

// Override max sockets
var agent = new https.Agent({maxSockets: 100});
agent.maxFreeSockets = 100

AWS.config.update({httpOptions: {agent: agent}});

var CALLS_CONFIG = {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@
"@octokit/auth-app": "^6.0.3",
"@octokit/request": "^8.1.6",
"@octokit/rest": "^20.0.2",
"@octokit/app": "^3.0.0",
"ali-oss": "^6.15.2",
"argparse": "^2.0.0",
"async": "^2.6.1",
"aws-sdk": "^2.1506.0",
"aws-sdk": "2.1680.0",
"azure-storage": "^2.10.3",
"csv-write-stream": "^2.0.0",
"fast-safe-stringify": "^2.0.6",
"google-auth-library": "^8.1.1",
"minimatch": "^3.0.4",
"ms-rest-azure": "^3.0.2",
"proxy-agent": "^6.4.0",
"tty-table": "^4.1.3"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion plugins/aws/iam/rolePolicyUnusedServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ module.exports = {
statement.Action[0].split(':')[1].toLowerCase();
if (statement.Action.length > 1 || statement.Action[0] !== '*') {
for (let action of statement.Action) {
if (config.whitelist_unused_actions_for_resources.includes(action)) continue;
if (config.whitelist_unused_actions_for_resources.includes(action) ||
(action && action.length && action === '*')) continue;
let resourceAction = action.split(':')[1].toLowerCase();

if (allServices[service] && !config.whitelist_unused_services.includes(service)) {
Expand Down