Skip to content

Commit

Permalink
refactor some iam rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lhitchon committed Oct 20, 2018
1 parent a68aa20 commit 85367c8
Showing 1 changed file with 38 additions and 20 deletions.
58 changes: 38 additions & 20 deletions cli/assets/terraform.yml
Expand Up @@ -163,8 +163,11 @@ rules:
resource: aws_iam_role_policy
severity: WARNING
assertions:
- key: policy.Statement[].NotAction
op: absent
- none:
key: policy.Statement[]
expressions:
- key: NotAction
op: present
tags:
- iam
- role
Expand All @@ -175,8 +178,11 @@ rules:
resource: aws_iam_role_policy
severity: WARNING
assertions:
- key: policy.Statement[].NotResource
op: absent
- none:
key: policy.Statement[]
expressions:
- key: NotResource
op: present
tags:
- iam
- role
Expand All @@ -187,10 +193,12 @@ rules:
resource: aws_iam_role_policy
severity: FAILURE
assertions:
- not:
- key: policy.Statement[].Action
op: contains
value: "*"
- none:
key: policy.Statement[]
expressions:
- key: Action
op: contains
value: "*"
tags:
- iam
- role
Expand All @@ -201,10 +209,12 @@ rules:
resource: aws_iam_role_policy
severity: WARNING
assertions:
- not:
- key: policy.Statement[].Resource
op: contains
value: "*"
- none:
key: policy.Statement[]
expressions:
- key: Resource
op: contains
value: "*"
tags:
- iam
- role
Expand All @@ -215,8 +225,11 @@ rules:
resource: aws_iam_policy
severity: WARNING
assertions:
- key: policy.Statement[].NotAction
op: absent
- none:
key: policy.Statement[]
expressions:
- key: NotAction
op: present
tags:
- iam
- policy
Expand All @@ -226,8 +239,11 @@ rules:
resource: aws_iam_policy
severity: WARNING
assertions:
- key: policy.Statement[].NotResource
op: absent
- none:
key: policy.Statement[]
expressions:
- key: NotResource
op: present
tags:
- iam
- policy
Expand All @@ -237,10 +253,12 @@ rules:
resource: aws_iam_policy
severity: FAILURE
assertions:
- not:
- key: policy.Statement[].Action
op: contains
value: "*"
- none:
key: policy.Statement[]
expressions:
- key: Action
op: contains
value: "*"
tags:
- iam
- policy
Expand Down

0 comments on commit 85367c8

Please sign in to comment.