Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify clusterpolicyreports in kuttl tests (cherry-pick #760) #766

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions istio/require-authorizationpolicy/02-assert.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions istio/require-authorizationpolicy/03-cpolr.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: bash ./resource-check.sh
assert:
- report-assert.yaml
27 changes: 27 additions & 0 deletions istio/require-authorizationpolicy/report-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
ownerReferences:
- apiVersion: v1
kind: Namespace
name: istio-reqauthzpol-bad-ns
summary:
error: 0
fail: 1
pass: 0
skip: 0
warn: 0
---
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
ownerReferences:
- apiVersion: v1
kind: Namespace
name: istio-reqauthzpol-good-ns
summary:
error: 0
fail: 0
pass: 1
skip: 0
warn: 0
9 changes: 4 additions & 5 deletions other/e-l/inspect-csr/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
name: cpol-inspect-csr
ownerReferences:
- apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
name: inspect-csr-user
results:
- category: Other
message: A CSR was created by {"groups":["testorg","system:authenticated"],"username":"inspect-csr-user"}
holding ClusterRoles ["csr-manager","system:basic-user","system:discovery","system:public-info-viewer"]
and Roles null. The subjects and groups requested in the CSR were "{"CommonName":"inspect-csr-user","Country":null,"ExtraNames":null,"Locality":null,"Names":[{"Type":[2,5,4,10],"Value":"testorg"},{"Type":[2,5,4,3],"Value":"inspect-csr-user"}],"Organization":["testorg"],"OrganizationalUnit":null,"PostalCode":null,"Province":null,"SerialNumber":"","StreetAddress":null}"
policy: inspect-csr
resources:
- apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
name: inspect-csr-user
result: fail
rule: csr
scored: true
Expand Down
4 changes: 0 additions & 4 deletions other/m-q/namespace-inventory-check/02-assert.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions other/m-q/namespace-inventory-check/03-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
assert:
- report-assert.yaml
56 changes: 56 additions & 0 deletions other/m-q/namespace-inventory-check/report-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
ownerReferences:
- apiVersion: v1
kind: Namespace
name: inventory-check-ns01
results:
- result: fail
rule: networkpolicies
- result: pass
rule: resourcequotas
summary:
error: 0
fail: 1
pass: 1
skip: 0
warn: 0
---
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
ownerReferences:
- apiVersion: v1
kind: Namespace
name: inventory-check-ns02
results:
- result: pass
rule: networkpolicies
- result: fail
rule: resourcequotas
summary:
error: 0
fail: 1
pass: 1
skip: 0
warn: 0
---
apiVersion: wgpolicyk8s.io/v1alpha2
kind: ClusterPolicyReport
metadata:
ownerReferences:
- apiVersion: v1
kind: Namespace
name: inventory-check-ns03
results:
- result: pass
rule: networkpolicies
- result: pass
rule: resourcequotas
summary:
error: 0
fail: 0
pass: 2
skip: 0
warn: 0
12 changes: 0 additions & 12 deletions other/m-q/namespace-inventory-check/resource-check.sh

This file was deleted.

Loading