-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update example rules in docs, add TODO item
- Loading branch information
Larry Hitchon
committed
Apr 19, 2018
1 parent
f6e64ef
commit deb100d
Showing
5 changed files
with
250 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: 1 | ||
description: Rules for generic YAML file | ||
type: YAML | ||
files: | ||
- "*.config" | ||
|
||
# some anchors to keep rules DRY | ||
|
||
has_name: &has_name | ||
key: name | ||
op: present | ||
|
||
has_name: &has_description | ||
key: description | ||
op: present | ||
|
||
has_name_and_description: &has_name_and_description | ||
and: | ||
- <<: *has_name | ||
- <<: *has_description | ||
|
||
# resources to find in the config file | ||
|
||
resources: | ||
- type: widget | ||
key: widgets[] | ||
id: id | ||
- type: gadget | ||
key: gadgets[] | ||
id: name | ||
|
||
# rules to apply | ||
|
||
rules: | ||
|
||
- id: WIDGET_PROPERTIES | ||
message: Widget needs name and description | ||
severity: FAILURE | ||
resource: widget | ||
assertions: | ||
- <<: *has_name_and_description | ||
|
||
- id: GADGET_PROPERTIES | ||
message: Gadget needs name a description | ||
severity: FAILURE | ||
resource: gadget | ||
assertions: | ||
- <<: *has_name_and_description | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 1 | ||
description: Do not allow IAM actions | ||
type: Terraform | ||
files: | ||
- "*.tf" | ||
rules: | ||
|
||
- id: NO_IAM_ACTIONS | ||
message: IAM roles should not allow IAM actions | ||
resource: aws_iam_role | ||
assertions: | ||
- key: assume_role_policy.Statement[].Action[] | ||
op: not-contains | ||
value: "iam:*" | ||
severity: FAILURE | ||
tags: | ||
- iam |