Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added host-visibility to probe sub-command #254

Merged
merged 2 commits into from
Apr 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ type KubeArmorProbeData struct {
ContainerSecurity bool
ContainerDefaultPosture tp.DefaultPosture
HostDefaultPosture tp.DefaultPosture
HostVisibility string
daemon1024 marked this conversation as resolved.
Show resolved Hide resolved
}

func isKubeArmorRunning(c *k8s.Client, o Options) bool {
Expand Down Expand Up @@ -533,6 +534,11 @@ func printKubeArmorProbeOutput(buf []byte) error {
data = append(data, []string{" ", "Container Security:", green(strconv.FormatBool(kd.ContainerSecurity))})
data = append(data, []string{" ", "Container Default Posture:", green(kd.ContainerDefaultPosture.FileAction) + itwhite("(File)"), green(kd.ContainerDefaultPosture.FileAction) + itwhite("(Capabilities)"), green(kd.ContainerDefaultPosture.NetworkAction) + itwhite("(Network)")})
data = append(data, []string{" ", "Host Default Posture:", green(kd.HostDefaultPosture.FileAction) + itwhite("(File)"), green(kd.HostDefaultPosture.CapabilitiesAction) + itwhite("(Capabilities)"), green(kd.HostDefaultPosture.NetworkAction) + itwhite("(Network)")})
hv := strings.Split(kd.HostVisibility, ",")
nyrahul marked this conversation as resolved.
Show resolved Hide resolved
for i := len(hv) - 1; i < 4; i++ { // Possible values : none/process,file,network,capabilities
hv = append(hv, "")
}
data = append(data, []string{" ", "Host Visibility:", green(hv[0]), green(hv[1]), green(hv[2]), green(hv[3])})
nyrahul marked this conversation as resolved.
Show resolved Hide resolved
renderOutputInTableWithNoBorders(data)
return nil
}
Expand Down