-
Notifications
You must be signed in to change notification settings - Fork 17
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: Vishal Choudhary <vishal.choudhary@nirmata.com>
- Loading branch information
1 parent
c378c92
commit 3617f32
Showing
11 changed files
with
326 additions
and
1 deletion.
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
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
61 changes: 61 additions & 0 deletions
61
website/docs/catalog/policies/ecs/ecs-cluster-enable-logging.md
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,61 @@ | ||
--- | ||
tags: | ||
- aws | ||
- aws/ecs | ||
--- | ||
# ECS cluster enable logging | ||
|
||
## Description | ||
|
||
This Policy ensures that ECS clusters have logging enabled. | ||
|
||
## Install | ||
|
||
### In cluster | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-enable-logging.yaml | ||
``` | ||
|
||
### Download locally | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-enable-logging.yaml | ||
``` | ||
|
||
## Manifest | ||
|
||
[Original policy](https://github.com/kyverno/kyverno-json/blob/main/catalog/ecs/ecs-cluster-enable-logging.yaml) | ||
[Raw](https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-enable-logging.yaml) | ||
|
||
```yaml | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
annotations: | ||
description.policy.kyverno.io: This Policy ensures that ECS clusters have logging | ||
enabled. | ||
title.policy.kyverno.io: ECS cluster enable logging | ||
creationTimestamp: null | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-cluster | ||
name: ecs-cluster-enable-logging | ||
spec: | ||
rules: | ||
- assert: | ||
all: | ||
- check: | ||
values: | ||
~.configuration: | ||
~.execute_command_configuration: | ||
(contains($forbidden_values, @.logging)): false | ||
message: ECS Cluster should enable logging of ECS Exec | ||
context: | ||
- name: forbidden_values | ||
variable: | ||
- NONE | ||
match: | ||
any: | ||
- type: aws_ecs_cluster | ||
name: ecs-cluster-enable-logging | ||
``` |
57 changes: 57 additions & 0 deletions
57
website/docs/catalog/policies/ecs/ecs-cluster-required-container-insights.md
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,57 @@ | ||
--- | ||
tags: | ||
- aws | ||
- aws/ecs | ||
--- | ||
# ECS requires container insights | ||
|
||
## Description | ||
|
||
This Policy ensures that ECS clusters have container insights enabled. | ||
|
||
## Install | ||
|
||
### In cluster | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-required-container-insights.yaml | ||
``` | ||
|
||
### Download locally | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-required-container-insights.yaml | ||
``` | ||
|
||
## Manifest | ||
|
||
[Original policy](https://github.com/kyverno/kyverno-json/blob/main/catalog/ecs/ecs-cluster-required-container-insights.yaml) | ||
[Raw](https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-cluster-required-container-insights.yaml) | ||
|
||
```yaml | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
annotations: | ||
description.policy.kyverno.io: This Policy ensures that ECS clusters have container | ||
insights enabled. | ||
title.policy.kyverno.io: ECS requires container insights | ||
creationTimestamp: null | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-cluster | ||
name: required-container-insights | ||
spec: | ||
rules: | ||
- assert: | ||
all: | ||
- check: | ||
values: | ||
~.setting: | ||
name: containerInsights | ||
value: enabled | ||
message: Container insights should be enabled on ECS cluster | ||
match: | ||
any: | ||
- type: aws_ecs_cluster | ||
name: required-container-insights | ||
``` |
61 changes: 61 additions & 0 deletions
61
website/docs/catalog/policies/ecs/ecs-service-public-ip.md
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,61 @@ | ||
--- | ||
tags: | ||
- aws | ||
- aws/ecs | ||
--- | ||
# ECS public IP | ||
|
||
## Description | ||
|
||
This Policy ensures that ECS services do not have public IP addresses assigned to them automatically. | ||
|
||
## Install | ||
|
||
### In cluster | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-public-ip.yaml | ||
``` | ||
|
||
### Download locally | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-public-ip.yaml | ||
``` | ||
|
||
## Manifest | ||
|
||
[Original policy](https://github.com/kyverno/kyverno-json/blob/main/catalog/ecs/ecs-service-public-ip.yaml) | ||
[Raw](https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-public-ip.yaml) | ||
|
||
```yaml | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
annotations: | ||
description.policy.kyverno.io: This Policy ensures that ECS services do not have | ||
public IP addresses assigned to them automatically. | ||
title.policy.kyverno.io: ECS public IP | ||
creationTimestamp: null | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
name: ecs-public-ip | ||
spec: | ||
rules: | ||
- assert: | ||
all: | ||
- check: | ||
values: | ||
~.network_configuration: | ||
(contains('$allowed-values', @.assign_public_ip)): false | ||
message: ECS services should not have public IP addresses assigned to them | ||
automatically | ||
context: | ||
- name: allowed-values | ||
variable: | ||
- false | ||
match: | ||
any: | ||
- type: aws_ecs_service | ||
name: ecs-public-ip | ||
``` |
60 changes: 60 additions & 0 deletions
60
website/docs/catalog/policies/ecs/ecs-service-required-latest-platform-fargate.md
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,60 @@ | ||
--- | ||
tags: | ||
- aws | ||
- aws/ecs | ||
--- | ||
# ECS require latest platform fargate | ||
|
||
## Description | ||
|
||
This Policy ensures that ECS Fargate services runs on the latest Fargate platform version. | ||
|
||
## Install | ||
|
||
### In cluster | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-required-latest-platform-fargate.yaml | ||
``` | ||
|
||
### Download locally | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-required-latest-platform-fargate.yaml | ||
``` | ||
|
||
## Manifest | ||
|
||
[Original policy](https://github.com/kyverno/kyverno-json/blob/main/catalog/ecs/ecs-service-required-latest-platform-fargate.yaml) | ||
[Raw](https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-service-required-latest-platform-fargate.yaml) | ||
|
||
```yaml | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
annotations: | ||
description.policy.kyverno.io: This Policy ensures that ECS Fargate services runs | ||
on the latest Fargate platform version. | ||
title.policy.kyverno.io: ECS require latest platform fargate | ||
creationTimestamp: null | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-service | ||
name: required-latest-platform-fargate | ||
spec: | ||
rules: | ||
- assert: | ||
all: | ||
- check: | ||
values: | ||
platform_version: LATEST | ||
message: ECS Fargate services should run on the latest Fargate platform version | ||
context: | ||
- name: pv | ||
variable: platform_version | ||
match: | ||
any: | ||
- type: aws_ecs_service | ||
values: | ||
launch_type: FARGATE | ||
name: required-latest-platform | ||
``` |
56 changes: 56 additions & 0 deletions
56
website/docs/catalog/policies/ecs/ecs-task-definition-fs-read-only.md
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,56 @@ | ||
--- | ||
tags: | ||
- aws | ||
- aws/ecs | ||
--- | ||
# ECS require filesystem read only | ||
|
||
## Description | ||
|
||
This Policy ensures that ECS Fargate services runs on the latest Fargate platform version. | ||
|
||
## Install | ||
|
||
### In cluster | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-task-definition-fs-read-only.yaml | ||
``` | ||
|
||
### Download locally | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-task-definition-fs-read-only.yaml | ||
``` | ||
|
||
## Manifest | ||
|
||
[Original policy](https://github.com/kyverno/kyverno-json/blob/main/catalog/ecs/ecs-task-definition-fs-read-only.yaml) | ||
[Raw](https://raw.githubusercontent.com/kyverno/kyverno-json/main/catalog/ecs/ecs-task-definition-fs-read-only.yaml) | ||
|
||
```yaml | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
annotations: | ||
description.policy.kyverno.io: This Policy ensures that ECS Fargate services runs | ||
on the latest Fargate platform version. | ||
title.policy.kyverno.io: ECS require filesystem read only | ||
creationTimestamp: null | ||
labels: | ||
ecs.aws.tags.kyverno.io: ecs-task-definition | ||
name: fs-read-only | ||
spec: | ||
rules: | ||
- assert: | ||
any: | ||
- check: | ||
values: | ||
~.(json_parse(container_definitions)): | ||
readonlyRootFilesystem: true | ||
message: ECS containers should only have read-only access to root filesystems | ||
match: | ||
any: | ||
- type: aws_ecs_task_definition | ||
name: require-fs-read-only | ||
``` |
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