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

ensure pluginDone is called under all circumstances #563

Closed
wants to merge 2 commits into from
Closed

ensure pluginDone is called under all circumstances #563

wants to merge 2 commits into from

Conversation

cmoore1776
Copy link

Fixes #552, Fixes #557

The implementation of async.mapValuesLimit in engine.collector fails to resolve all of the asynchronous functions. This prevents the callback function from executing, which means outputHandler.close() never gets called. That means output is never written to the console, nor saved to JSON.

If we move the call to pluginDone out of the if statement, it is called under all circumstances, ensuring we get proper output.

@CLAassistant
Copy link

CLAassistant commented Mar 1, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cmoore1776
Copy link
Author

I think the test case for accessKeysRotated is prone to false negative. The test spec is initialized with:

warnDate.setMonth(warnDate.getMonth() - 3);

and the plugin makes its determination based on > (not >=):

if (helpers.daysAgo(userCreationTime) > config.access_keys_rotated_warn

which means the warnDate in the test case won't actually generate a warning since it's exactly 90 days old. If you change the test spec to, e.g.

warnDate.setMonth(warnDate.getMonth() - 4);

the test passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--json=file.json creates empty json file Nothing Collect AWS, only compliance
3 participants