kube-bench/kube-bench.spec

57 lines
1.1 KiB
RPMSpec
Raw Normal View History

2024-03-21 01:28:06 +03:00
%define debug %nil
%define debug_package %nil
2024-10-19 22:27:57 +00:00
%define secscan 0
2024-03-21 01:28:06 +03:00
Name: kube-bench
2025-02-13 20:45:32 +00:00
Version: 0.10.2
2024-03-21 01:28:06 +03:00
Release: 1
Summary: Checks whether Kubernetes
URL: https://github.com/aquasecurity/kube-bench
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
License: ASL 2.0
Group: Development/Other
BuildRequires: go
BuildRequires: git-core
BuildRequires: upx
2024-11-19 09:59:48 +00:00
BuildRequires: pkgconfig(openssl3.3)
2024-03-21 01:28:06 +03:00
2024-07-02 10:13:01 +00:00
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
2024-03-21 01:28:06 +03:00
%description
kube-bench is a tool that checks whether Kubernetes is
deployed securely by running the checks documented in
the CIS Kubernetes Benchmark.
%prep
%setup -q
2024-07-02 10:13:01 +00:00
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
2024-03-21 01:28:06 +03:00
%build
2024-07-02 11:01:04 +00:00
export GOPROXY=https://proxy.golang.org/cached-only
2024-03-21 01:28:06 +03:00
CGO_ENABLED=0 go build -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=%{version}" -o bin/%{name} .
upx bin/%{name}
%install
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
%files
%doc README.md LICENSE docs
%{_bindir}/%{name}
2024-07-02 10:13:01 +00:00
%check
2024-07-02 11:01:04 +00:00
export GOPROXY=https://proxy.golang.org/cached-only
2024-07-02 10:13:01 +00:00
#go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif