Skip to content

Commit 2d618c2

Browse files
Merge pull request #57991 from rakshitgondwal/feat/pkg/cis-op
feat(pkg): cis-operator
2 parents 193c5c6 + e778a21 commit 2d618c2

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

cis-operator.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package:
2+
name: cis-operator
3+
version: "1.4.1"
4+
epoch: 0
5+
description: Helps to enable running CIS benchmark security scans on a Kubernetes cluster and generate compliance reports that can be downloaded
6+
copyright:
7+
- license: Apache-2.0
8+
9+
pipeline:
10+
- uses: git-checkout
11+
with:
12+
repository: https://github.com/rancher/cis-operator
13+
tag: v${{package.version}}
14+
expected-commit: cae64d5d3766e725a29825d4fb7b2c63b62741f1
15+
16+
- uses: go/bump
17+
with:
18+
deps: |-
19+
github.com/go-viper/mapstructure/v2@v2.3.0
20+
golang.org/x/net@v0.38.0
21+
22+
- uses: go/build
23+
with:
24+
packages: .
25+
ldflags: |
26+
-X github.com/rancher/cis-operator.Version=${{package.version}}
27+
-X github.com/rancher/cis-operator.GitCommit=$(git rev-parse --short HEAD)
28+
output: cis-operator
29+
30+
update:
31+
enabled: true
32+
github:
33+
identifier: rancher/cis-operator
34+
strip-prefix: v
35+
36+
test:
37+
environment:
38+
contents:
39+
packages:
40+
- curl
41+
pipeline:
42+
- name: basic test
43+
runs: |
44+
cis-operator --help
45+
- uses: test/kwok/cluster
46+
- name: Test operator
47+
uses: test/daemon-check-output
48+
with:
49+
setup: |
50+
# grab the node name
51+
NODE=$(kubectl get nodes --no-headers \
52+
-o custom-columns=NAME:.metadata.name | head -n1)
53+
# we will have to label the node so that the operator recognizes our cluster as an aks cluster
54+
# kwok is not recognized as a provider, https://github.com/rancher/kubernetes-provider-detector/tree/master/providers
55+
kubectl label node "$NODE" kubernetes.azure.com/cluster=""
56+
kubectl apply -f https://raw.githubusercontent.com/rancher/cis-operator/refs/heads/main/crds/clusterscan.yaml
57+
kubectl apply -f https://raw.githubusercontent.com/rancher/cis-operator/refs/heads/main/crds/clusterscanbenchmark.yaml
58+
kubectl apply -f https://raw.githubusercontent.com/rancher/cis-operator/refs/heads/main/crds/clusterscanprofile.yaml
59+
kubectl apply -f https://raw.githubusercontent.com/rancher/cis-operator/refs/heads/main/crds/clusterscanreport.yaml
60+
start: |
61+
cis-operator
62+
timeout: 10
63+
expected_output: |
64+
Starting CIS-Operator
65+
Starting cis.cattle.io/v1
66+
Starting /v1, Kind=Service controller
67+
Starting /v1, Kind=Pod controller
68+
Starting /v1, Kind=ConfigMap controller
69+
Starting batch/v1, Kind=Job controller
70+
post: |
71+
curl -sfSL http://localhost:8080/metrics | grep go_gc_duration_seconds

0 commit comments

Comments
 (0)