@@ -48,6 +48,7 @@ export interface PolicyContent {
4848}
4949export interface QueryawsIamPolicy {
5050 id : string
51+ name : string
5152 policyContent : PolicyContent
5253}
5354
@@ -703,6 +704,7 @@ describe('CIS Amazon Web Services Foundations: 1.4.0', () => {
703704
704705 describe ( 'AWS CIS 1.16 Ensure IAM policies that allow full "*:*" administrative privileges are not attached' , ( ) => {
705706 const getTestRuleFixture = (
707+ name : string ,
706708 effect : string ,
707709 action : string [ ] ,
708710 resource : string [ ]
@@ -711,6 +713,7 @@ describe('CIS Amazon Web Services Foundations: 1.4.0', () => {
711713 queryawsIamPolicy : [
712714 {
713715 id : cuid ( ) ,
716+ name,
714717 policyContent : {
715718 statement : [
716719 {
@@ -741,7 +744,7 @@ describe('CIS Amazon Web Services Foundations: 1.4.0', () => {
741744 }
742745
743746 test ( 'No Security Issue when IAM policies not allow full "*:*" administrative privileges' , async ( ) => {
744- const data : CIS1xQueryResponse = getTestRuleFixture ( 'Allow' , [
747+ const data : CIS1xQueryResponse = getTestRuleFixture ( 'AdministratorAccess-Amplify' , ' Allow', [
745748 'secretsmanager:DeleteSecret' ,
746749 'secretsmanager:GetSecretValue' ,
747750 'secretsmanager:UpdateSecret' ,
@@ -750,23 +753,28 @@ describe('CIS Amazon Web Services Foundations: 1.4.0', () => {
750753 } )
751754
752755 test ( 'No Security Issue when IAM policies that have a statement with "Effect": "Allow" with "Action": "*" over restricted "Resource"' , async ( ) => {
753- const data : CIS1xQueryResponse = getTestRuleFixture ( 'Allow' , [ '*' ] , [ 'arn:aws:secretsmanager:*:*:secret:A4B*' ] )
756+ const data : CIS1xQueryResponse = getTestRuleFixture ( 'AdministratorAccess-Amplify' , ' Allow', [ '*' ] , [ 'arn:aws:secretsmanager:*:*:secret:A4B*' ] )
754757 await testRule ( data , Result . PASS )
755758 } )
756759
757760 test ( 'No Security Issue when IAM policies that have a statement with "Effect": "Allow" with restricted "Action" over "Resource": "*"' , async ( ) => {
758- const data : CIS1xQueryResponse = getTestRuleFixture ( 'Allow' , [
761+ const data : CIS1xQueryResponse = getTestRuleFixture ( 'AdministratorAccess-Amplify' , ' Allow', [
759762 'secretsmanager:DeleteSecret' ,
760763 'secretsmanager:GetSecretValue' ,
761764 'secretsmanager:UpdateSecret' ,
762765 ] , [ '*' ] )
763766 await testRule ( data , Result . PASS )
764767 } )
765768
766- test ( 'No Security Issue when IAM policies that allow full "*:*" administrative privileges' , async ( ) => {
767- const data : CIS1xQueryResponse = getTestRuleFixture ( 'Allow' , [ '*' ] , [ '*' ] )
769+ test ( 'Security Issue when IAM policies that allow full "*:*" administrative privileges for non AdministratorAccess policy ' , async ( ) => {
770+ const data : CIS1xQueryResponse = getTestRuleFixture ( 'AdministratorAccess-Amplify' , ' Allow', [ '*' ] , [ '*' ] )
768771 await testRule ( data , Result . FAIL )
769772 } )
773+
774+ test ( 'No Security Issue when IAM policies that allow full "*:*" administrative privileges for AdministratorAccess policy' , async ( ) => {
775+ const data : CIS1xQueryResponse = getTestRuleFixture ( 'AdministratorAccess' , 'Allow' , [ '*' ] , [ '*' ] )
776+ await testRule ( data , Result . PASS )
777+ } )
770778 } )
771779
772780 describe ( 'AWS CIS 1.17 Ensure a support role has been created to manage incidents with AWS Support' , ( ) => {
0 commit comments