-
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.
check-compliance-policy and check-imagie-FIPS added
Signed-off-by: sratslla <[email protected]>
- Loading branch information
Showing
6 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
tetrate/check-compliance-policy/check-compliance-policy.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,33 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: enforce-istiod-fips-compliance | ||
annotations: | ||
policies.kyverno.io/title: "Ensure Istiod Compliance Policy" | ||
policies.kyverno.io/category: "Security" | ||
policies.kyverno.io/severity: "high" | ||
policies.kyverno.io/subject: "Deployment" | ||
policies.kyverno.io/description: "Ensures that Istiod deployments have COMPLIANCE_POLICY=fips-140-2 set in the environment variables." | ||
spec: | ||
validationFailureAction: Enforce | ||
background: true | ||
rules: | ||
- name: check-compliance-policy | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Deployment | ||
namespaces: | ||
- istio-system | ||
validate: | ||
message: "Istiod containers must have COMPLIANCE_POLICY=fips-140-2 set in their environment variables." | ||
pattern: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: discovery | ||
env: | ||
- name: COMPLIANCE_POLICY | ||
value: fips-140-2 |
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,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: istiod | ||
namespace: istio-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: istiod | ||
template: | ||
metadata: | ||
labels: | ||
app: istiod | ||
spec: | ||
containers: | ||
- name: discovery | ||
env: | ||
- name: COMPLIANCE_POLICY | ||
value: some-other-value |
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,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: istiod | ||
namespace: istio-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: istiod | ||
template: | ||
metadata: | ||
labels: | ||
app: istiod | ||
spec: | ||
containers: | ||
- name: discovery | ||
env: | ||
- name: COMPLIANCE_POLICY | ||
value: fips-140-2 |
31 changes: 31 additions & 0 deletions
31
tetrate/check-image-FIPS-compliant copy/check-image-FIPS-compliant.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,31 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: enforce-fips-compliant-images | ||
annotations: | ||
policies.kyverno.io/title: "Enforce FIPS Compliant Images" | ||
policies.kyverno.io/category: "Security" | ||
policies.kyverno.io/severity: "high" | ||
policies.kyverno.io/subject: "Pod, Deployment, StatefulSet, DaemonSet" | ||
policies.kyverno.io/description: "Ensures that container images are pulled from the FIPS-compliant registry fips-containers.istio.tetratelabs.com." | ||
spec: | ||
validationFailureAction: Enforce | ||
background: true | ||
rules: | ||
- name: check-fips-registry | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
- Deployment | ||
- StatefulSet | ||
- DaemonSet | ||
validate: | ||
message: "Container images must be pulled from fips-containers.istio.tetratelabs.com" | ||
pattern: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: "fips-containers.istio.tetratelabs.com/*" |
17 changes: 17 additions & 0 deletions
17
tetrate/check-image-FIPS-compliant copy/e2e/bad-resouces.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,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: non-fips-deployment | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: non-fips | ||
template: | ||
metadata: | ||
labels: | ||
app: non-fips | ||
spec: | ||
containers: | ||
- name: app-container | ||
image: docker.io/istio/proxyv2:1.20.0 |
17 changes: 17 additions & 0 deletions
17
tetrate/check-image-FIPS-compliant copy/e2e/good-resouce.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,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: non-fips-deployment | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: non-fips | ||
template: | ||
metadata: | ||
labels: | ||
app: non-fips | ||
spec: | ||
containers: | ||
- name: app-container | ||
image: fips-containers.istio.tetratelabs.com/istio/proxyv2:1.20.0 |