From 64986c66e71237c2bd327c1a573ebfe7671bf6c2 Mon Sep 17 00:00:00 2001 From: AkhtarAmir <31914988+AkhtarAmir@users.noreply.github.com> Date: Mon, 29 Mar 2021 21:03:56 +0500 Subject: [PATCH] Modification: Modified to generate PASS if no secrets (#621) * Added AWS 'Secrets Manager Secret Rotation Enabled' plugin and test cases * Modified to generate PASS if no secrets Co-authored-by: Gio Rodriguez --- plugins/aws/secretsmanager/secretRotationEnabled.js | 2 +- plugins/aws/secretsmanager/secretRotationEnabled.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/aws/secretsmanager/secretRotationEnabled.js b/plugins/aws/secretsmanager/secretRotationEnabled.js index ab05c4e51f..3446f3857f 100644 --- a/plugins/aws/secretsmanager/secretRotationEnabled.js +++ b/plugins/aws/secretsmanager/secretRotationEnabled.js @@ -38,7 +38,7 @@ module.exports = { } if (!listSecrets.data.length) { - helpers.addResult(results, 2, 'Secrets Manager is not in use', region); + helpers.addResult(results, 0, 'No secrets found', region); return rcb(); } diff --git a/plugins/aws/secretsmanager/secretRotationEnabled.spec.js b/plugins/aws/secretsmanager/secretRotationEnabled.spec.js index 3e692ffd06..3b4e419854 100644 --- a/plugins/aws/secretsmanager/secretRotationEnabled.spec.js +++ b/plugins/aws/secretsmanager/secretRotationEnabled.spec.js @@ -143,11 +143,11 @@ describe('secretRotationEnabled', function () { }); }); - it('should PASS if Secrets Manager is not in use', function (done) { + it('should PASS if no secrets found', function (done) { const cache = createCache([]); secretRotationEnabled.run(cache, {}, (err, results) => { expect(results.length).to.equal(1); - expect(results[0].status).to.equal(2); + expect(results[0].status).to.equal(0); expect(results[0].region).to.equal('us-east-1'); done(); });