Skip to content

Commit

Permalink
Merge pull request #417 from harkirat22/master
Browse files Browse the repository at this point in the history
IMDSv1 check policy
  • Loading branch information
Willie authored Dec 2, 2020
2 parents ab97a48 + 433415c commit 8d6e722
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/policies/opa/rego/aws/aws_instance/AC-AWS-NS-IN-M-1172.json
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 pkg/policies/opa/rego/aws/aws_instance/ec2UsingIMDSv1.rego
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"
}

0 comments on commit 8d6e722

Please sign in to comment.