-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anders Eknert <[email protected]>
- Loading branch information
1 parent
83e25e8
commit 0c782ab
Showing
32 changed files
with
247 additions
and
207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,20 @@ | ||
rules: | ||
custom: | ||
one-liner-rule: | ||
level: error | ||
imports: | ||
prefer-package-imports: | ||
level: error | ||
ignore: | ||
files: | ||
- "*_test.rego" | ||
style: | ||
line-length: | ||
level: error | ||
non-breakable-word-threshold: 80 | ||
testing: | ||
print-or-trace-call: | ||
level: error | ||
ignore: | ||
files: | ||
- "assertions.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
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
# organizations: | ||
# - Styra | ||
package aws | ||
|
||
import rego.v1 |
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package aws.ec2.securitygroup | ||
|
||
import future.keywords | ||
import rego.v1 | ||
|
||
deny[msg] { | ||
deny contains msg if { | ||
input.resource.properties.SecurityGroupIngress[0].CidrIp == "0.0.0.0/0" | ||
|
||
msg := sprintf("Security Group cannot contain rules allow all destinations (0.0.0.0/0 or ::/0): %s", [input.resource.id]) | ||
msg := sprintf( | ||
"Security Group cannot contain rules allow all destinations (0.0.0.0/0 or ::/0): %s", | ||
[input.resource.id], | ||
) | ||
} | ||
|
||
deny[msg] { | ||
deny contains msg if { | ||
input.resource.properties.SecurityGroupIngress[0].CidrIpv6 == "::/0" | ||
|
||
msg := sprintf("Security Group cannot contain rules allow all destinations (0.0.0.0/0 or ::/0): %s", [input.resource.id]) | ||
msg := sprintf( | ||
"Security Group cannot contain rules allow all destinations (0.0.0.0/0 or ::/0): %s", | ||
[input.resource.id], | ||
) | ||
} |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package aws.eks.cluster | ||
|
||
import future.keywords | ||
import rego.v1 | ||
|
||
deny[msg] { | ||
deny contains msg if { | ||
not cluster_logging_enabled | ||
msg := sprintf("no logging types are enabled for cluster: %s", [input.resource.id]) | ||
} | ||
|
||
cluster_logging_enabled { | ||
count(input.resource.properties.Logging.ClusterLogging.EnabledTypes) > 0 | ||
} | ||
cluster_logging_enabled if count(input.resource.properties.Logging.ClusterLogging.EnabledTypes) > 0 |
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 |
---|---|---|
@@ -1,22 +1,18 @@ | ||
package aws.eks.cluster | ||
|
||
import future.keywords | ||
import rego.v1 | ||
|
||
deny[msg] { | ||
deny contains msg if { | ||
not public_endpoint_disabled | ||
msg := sprintf("public endpoint needs to be disabled for cluster: %s", [input.resource.id]) | ||
} | ||
|
||
deny[msg] { | ||
deny contains msg if { | ||
public_endpoint_disabled | ||
not private_endpoint_enabled | ||
msg := sprintf("invalid configuration, please enable private api for cluster: %s", [input.resource.id]) | ||
} | ||
|
||
public_endpoint_disabled { | ||
input.resource.properties.ResourcesVpcConfig.EndpointPublicAccess == "false" | ||
} | ||
public_endpoint_disabled if input.resource.properties.ResourcesVpcConfig.EndpointPublicAccess == "false" | ||
|
||
private_endpoint_enabled { | ||
input.resource.properties.ResourcesVpcConfig.EndpointPrivateAccess == "true" | ||
} | ||
private_endpoint_enabled if input.resource.properties.ResourcesVpcConfig.EndpointPrivateAccess == "true" |
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
Oops, something went wrong.