-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from harkirat22/master
IMDSv1 check policy
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
pkg/policies/opa/rego/aws/aws_instance/AC-AWS-NS-IN-M-1172.json
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,10 @@ | ||
{ | ||
"name": "ec2UsingIMDSv1", | ||
"file": "ec2UsingIMDSv1.rego", | ||
"template_args": null, | ||
"severity": "MEDIUM", | ||
"description": "Ensure there are no ECS instances using IMDSv1", | ||
"reference_id": "AC-AWS-NS-IN-M-1172", | ||
"category": "Unknown", | ||
"version": 1 | ||
} |
13 changes: 13 additions & 0 deletions
13
pkg/policies/opa/rego/aws/aws_instance/ec2UsingIMDSv1.rego
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,13 @@ | ||
package accurics | ||
|
||
ec2UsingIMDSv1[api.id] { | ||
api := input.aws_instance[_] | ||
not api.config.metadata_options | ||
} | ||
|
||
ec2UsingIMDSv1[api.id] { | ||
api := input.aws_instance[_] | ||
value := api.config.metadata_options[_] | ||
not value.http_endpoint == "disabled" | ||
not value.http_tokens == "required" | ||
} |