forked from kubescape/homebrew-tap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubescape.rb
26 lines (22 loc) · 1.13 KB
/
kubescape.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Kubescape < Formula
desc "Kubernetes testing according to Hardening Guidance by NSA and CISA"
homepage "https://github.com/armosec/kubescape"
url "https://github.com/armosec/kubescape/releases/download/v1.0.132/kubescape-macos-latest"
sha256 "7c55d8e140d511b3f9a22b2a81179f89899e928d16219bb7833d5f0ee8f5c4df"
license "Apache-2.0"
def install
system "chmod 555 kubescape-macos-latest"
bin.install "kubescape-macos-latest" => "kubescape"
output = Utils.safe_popen_read(bin/"kubescape", "completion", "bash")
(bash_completion/"kubescape").write output
output = Utils.safe_popen_read(bin/"kubescape", "completion", "zsh")
(zsh_completion/"_kubescape").write output
output = Utils.safe_popen_read(bin/"kubescape", "completion", "fish")
(fish_completion/"kubescape").write output
end
test do
assert_match version.to_s, shell_output("#{bin}/kubescape version")
manifest = "https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/master/release/kubernetes-manifests.yaml"
assert_match "FAILED RESOURCES", shell_output("#{bin}/kubescape scan framework nsa #{manifest}")
end
end