-
Notifications
You must be signed in to change notification settings - Fork 16
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 #152 from anusha94/tf-config-chart-update
Update AWS S3 and ECS tf config charts
- Loading branch information
Showing
16 changed files
with
195 additions
and
133 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
25 changes: 25 additions & 0 deletions
25
charts/best-practices-ecs-tf-config/pols/validate-ecs-task-definition-pid-mode-check.yaml
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,25 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: validate-ecs-task-definition-pid-mode-check | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
annotations: | ||
policies.kyverno.io/title: Validate ECS task definition PID mode check | ||
policies.kyverno.io/category: ECS Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
This policy ensures that ECS task definitions do not share the host's process namespace | ||
spec: | ||
rules: | ||
- name: validate-ecs-task-definition-pid-mode-check | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_ecs_task_definition != null): true | ||
assert: | ||
all: | ||
- message: ECS task definitions shares the host's process namespace | ||
check: | ||
~.(resource.aws_ecs_task_definition.values(@)[]): | ||
(pid_mode || 'task'): task |
28 changes: 28 additions & 0 deletions
28
charts/best-practices-ecs-tf-config/pols/validate-ecs-task-public-ip.yaml
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,28 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: validate-ecs-task-public-ip | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
annotations: | ||
policies.kyverno.io/title: Validate ECS Task Public IP | ||
policies.kyverno.io/category: ECS Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
ECS tasks with public IP address enabled, are easily reachable from the internet. | ||
This policy validates whether public IP address is enabled on the ECS task | ||
spec: | ||
rules: | ||
- name: validate-ecs-task-public-ip | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_ecs_service != null): true | ||
assert: | ||
any: | ||
- message: Public IP address should not be enabled | ||
check: | ||
~.(resource.aws_ecs_service.values(@)[]): | ||
~.(network_configuration[?assign_public_ip] || `[]`): | ||
assign_public_ip: false | ||
|
28 changes: 28 additions & 0 deletions
28
charts/best-practices-ecs-tf-config/pols/validate-efs-volume-encryption.yaml
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,28 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: validate-ecs-task-public-ip | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
annotations: | ||
policies.kyverno.io/title: Validate ECS Task Public IP | ||
policies.kyverno.io/category: ECS Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
ECS tasks with public IP address enabled, are easily reachable from the internet. | ||
This policy validates whether public IP address is enabled on the ECS task | ||
spec: | ||
rules: | ||
- name: validate-ecs-task-public-ip | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_ecs_service != null): true | ||
assert: | ||
any: | ||
- message: Public IP address should not be enabled | ||
check: | ||
~.(resource.aws_ecs_service.values(@)[]): | ||
~.(network_configuration[?assign_public_ip] || `[]`): | ||
assign_public_ip: false | ||
|
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
28 changes: 28 additions & 0 deletions
28
charts/best-practices-s3-tf-config/pols/abort-incomplete-uploads.yaml
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,28 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: validate-ecs-task-public-ip | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
annotations: | ||
policies.kyverno.io/title: Validate ECS Task Public IP | ||
policies.kyverno.io/category: ECS Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
ECS tasks with public IP address enabled, are easily reachable from the internet. | ||
This policy validates whether public IP address is enabled on the ECS task | ||
spec: | ||
rules: | ||
- name: validate-ecs-task-public-ip | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_ecs_service != null): true | ||
assert: | ||
any: | ||
- message: Public IP address should not be enabled | ||
check: | ||
~.(resource.aws_ecs_service.values(@)[]): | ||
~.(network_configuration[?assign_public_ip] || `[]`): | ||
assign_public_ip: false | ||
|
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
27 changes: 27 additions & 0 deletions
27
charts/best-practices-s3-tf-config/pols/enable-aws-cloudtrail.yaml
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,27 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: enable-aws-cloudtrail | ||
annotations: | ||
policies.kyverno.io/title: enable-aws-cloudtrail | ||
policies.kyverno.io/category: AWS S3 Security Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
CloudTrail stores Amazon S3 data event logs in an S3 bucket of your choosing. | ||
Consider using a bucket in a separate AWS account to better organize events from | ||
multiple buckets that you might own into a central place for easier querying and | ||
analysis. AWS Organizations helps you create an AWS account that is linked to | ||
the account that owns the bucket that you're monitoring. | ||
spec: | ||
rules: | ||
- name: check-aws-cloudtrail-logging | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_cloudtrail != null): true | ||
assert: | ||
all: | ||
- message: Set the enable_logging argument in aws_cloudtrail resource to true | ||
check: | ||
~.(resource.aws_cloudtrail.values(@)[]): | ||
(!contains(keys(@), 'enable_logging') || enable_logging == `true`): true |
32 changes: 32 additions & 0 deletions
32
charts/best-practices-s3-tf-config/pols/enable-kms-encryption.yaml
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,32 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: s3-enable-kms-encryption | ||
annotations: | ||
policies.kyverno.io/title: s3-enable-kms-encryption | ||
policies.kyverno.io/category: AWS S3 Security Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.kyverno.io/description: >- | ||
All Amazon S3 buckets have encryption configured by default, | ||
and all new objects that are uploaded to an S3 bucket are automatically | ||
encrypted at rest. Server-side encryption with Amazon S3 managed keys (SSE-S3) | ||
is the default encryption configuration for every bucket in Amazon S3. To use a | ||
different type of encryption, you can either specify the type of server-side encryption | ||
to use in your S3 PUT requests, or you can set the default encryption configuration in | ||
the destination bucket. | ||
spec: | ||
rules: | ||
- name: check-encryption-setting | ||
match: | ||
all: | ||
- ($analyzer.resource.type): terraform-config | ||
- (resource.aws_s3_bucket_server_side_encryption_configuration != null): true | ||
assert: | ||
all: | ||
- message: S3 server side encryption is not set to KMS | ||
check: | ||
~.(resource.aws_s3_bucket_server_side_encryption_configuration.values(@)[]): | ||
~.(rule): | ||
~.(apply_server_side_encryption_by_default || `[{}]`): | ||
(sse_algorithm == 'aws:kms'): 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
29 changes: 0 additions & 29 deletions
29
charts/best-practices-s3-tf-config/pols/enable-server-access-logging.yaml
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
charts/best-practices-s3-tf-config/pols/s3-cross-region-replication.yaml
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
charts/best-practices-s3-tf-config/pols/s3-enable-versioning.yaml
This file was deleted.
Oops, something went wrong.
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