Skip to content

Commit

Permalink
fix: modify clusterpolicyreports in kuttl tests (#760)
Browse files Browse the repository at this point in the history
Signed-off-by: Mariam Fahmy <[email protected]>
Co-authored-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
MariamFahmy98 and eddycharly authored Sep 21, 2023
1 parent ac1756d commit cd47ec5
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 42 deletions.
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.

0 comments on commit cd47ec5

Please sign in to comment.