File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Generate SBOM
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ generate-sbom :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout Code
13+ uses : actions/checkout@v3
14+
15+ - name : Install Trivy
16+ run : |
17+ curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
18+ sudo mv bin/trivy /usr/local/bin
19+
20+ - name : Generate SBOM
21+ run : |
22+ IMAGE="registry.k8s.io/kube-apiserver:v1.32.0"
23+ trivy image --format cyclonedx --output sbom-${{ github.sha }}.json $IMAGE
24+
25+ - name : Upload SBOM Artifact
26+ uses : actions/upload-artifact@v3
27+ with :
28+ name : sbom
29+ path : sbom-${{ github.sha }}.json
30+
Original file line number Diff line number Diff line change 1+ curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.9.0/kube-bench_0.9.0_linux_amd64.deb -o kube-bench_0.9.0_linux_amd64.deb
2+
3+ sudo apt install ./kube-bench_0.9.0_linux_amd64.deb -f
4+
5+ kube-bench
6+
7+ docker run --pid=host -v /etc:/etc: ro -v /var:/var: ro -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~ /.kube:/.kube -e KUBECONFIG=/.kube/config -t aquasec/kube-bench: latest run --targets=master
8+
9+ docker run --pid=host -v /etc:/etc: ro -v /var:/var: ro -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~ /.kube:/.kube -e KUBECONFIG=/.kube/config -t aquasec/kube-bench: latest run --targets=node
You can’t perform that action at this time.
0 commit comments