This commit is contained in:
Sergey Zhemoytel 2024-07-02 10:13:01 +00:00
parent 686bb252b4
commit 2ab51f541f
2 changed files with 21 additions and 2 deletions

View file

@ -1,2 +1,2 @@
sources: sources:
kube-bench-0.7.2.tar.gz: 9489fe0129a47ec3023dd18f363d46c342263617 kube-bench-0.8.0.tar.gz: b09adeac159cc49c5f187b91805cf9202400479e

View file

@ -1,8 +1,9 @@
%define debug %nil %define debug %nil
%define debug_package %nil %define debug_package %nil
%define secscan 1
Name: kube-bench Name: kube-bench
Version: 0.7.2 Version: 0.8.0
Release: 1 Release: 1
Summary: Checks whether Kubernetes Summary: Checks whether Kubernetes
URL: https://github.com/aquasecurity/kube-bench URL: https://github.com/aquasecurity/kube-bench
@ -13,6 +14,11 @@ BuildRequires: go
BuildRequires: git-core BuildRequires: git-core
BuildRequires: upx BuildRequires: upx
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
%description %description
kube-bench is a tool that checks whether Kubernetes is kube-bench is a tool that checks whether Kubernetes is
deployed securely by running the checks documented in deployed securely by running the checks documented in
@ -21,6 +27,11 @@ the CIS Kubernetes Benchmark.
%prep %prep
%setup -q %setup -q
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
%build %build
export GOPROXY=direct export GOPROXY=direct
CGO_ENABLED=0 go build -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=%{version}" -o bin/%{name} . CGO_ENABLED=0 go build -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=%{version}" -o bin/%{name} .
@ -34,3 +45,11 @@ install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
%doc README.md LICENSE docs %doc README.md LICENSE docs
%{_bindir}/%{name} %{_bindir}/%{name}
%check
export GOPROXY=direct
#go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif