Skip to content

Commit

Permalink
Modify result display colors for Allow/Audit/Block (#244)
Browse files Browse the repository at this point in the history
* Modify result display colors for Allow/Audit/Block
* Change color for Audit
  • Loading branch information
seswarrajan authored Jan 19, 2023
1 parent 5ad9094 commit 95ad9c0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions summary/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func DisplaySummaryOutput(resp *opb.Response, revDNSLookup bool, requestType str
// Colored Status for Allow and Deny
agc := ansi.ColorFunc("green")
arc := ansi.ColorFunc("red")
ayc := ansi.ColorFunc("yellow")

if strings.Contains(requestType, "process") {
if len(resp.ProcessData) > 0 {
Expand All @@ -50,7 +51,9 @@ func DisplaySummaryOutput(resp *opb.Response, revDNSLookup bool, requestType str
procStrSlice = append(procStrSlice, procData.UpdatedTime)
if procData.Status == "Allow" {
procStrSlice = append(procStrSlice, agc(procData.Status))
} else if procData.Status == "Deny" {
} else if procData.Status == "Audit" {
procStrSlice = append(procStrSlice, ayc(procData.Status))
} else {
procStrSlice = append(procStrSlice, arc(procData.Status))
}
procRowData = append(procRowData, procStrSlice)
Expand Down Expand Up @@ -82,7 +85,9 @@ func DisplaySummaryOutput(resp *opb.Response, revDNSLookup bool, requestType str
fileStrSlice = append(fileStrSlice, fileData.UpdatedTime)
if fileData.Status == "Allow" {
fileStrSlice = append(fileStrSlice, agc(fileData.Status))
} else if fileData.Status == "Deny" {
} else if fileData.Status == "Audit" {
fileStrSlice = append(fileStrSlice, ayc(fileData.Status))
} else {
fileStrSlice = append(fileStrSlice, arc(fileData.Status))
}
fileRowData = append(fileRowData, fileStrSlice)
Expand Down

0 comments on commit 95ad9c0

Please sign in to comment.