Skip to content

Commit

Permalink
Added host-visibility to probe sub-command
Browse files Browse the repository at this point in the history
Signed-off-by: Legorie <legorie@hotmail.com>
  • Loading branch information
legorie committed Feb 3, 2023
1 parent 8b1a0a0 commit a9b6341
Showing 1 changed file with 6 additions and 0 deletions.
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
}

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, ",")
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])})
renderOutputInTableWithNoBorders(data)
return nil
}
Expand Down

0 comments on commit a9b6341

Please sign in to comment.