From 761767db299aa7a3cdc5632973a23de7496b42b2 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 2 Sep 2021 11:34:44 +0100 Subject: [PATCH] BIN: nessusComplianceFilter: various improvements --- bin/.bin/nessusComplianceFilter | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/.bin/nessusComplianceFilter b/bin/.bin/nessusComplianceFilter index 5ddfe393..39877d26 100755 --- a/bin/.bin/nessusComplianceFilter +++ b/bin/.bin/nessusComplianceFilter @@ -28,5 +28,10 @@ while [ "$#" -gt 0 ]; do shift done -echo "Compliance Check Compliance Result Current Expected" -cat - | xq -r ".NessusClientData_v2.Report.ReportHost.ReportItem[] | select(.compliance == \"true\") | select(.\"cm:compliance-result\" != \"PASSED\") $filters | [.\"cm:compliance-check-name\", .\"cm:compliance-result\", .\"cm:compliance-actual-value\", .\"cm:compliance-policy-value\"] | @tsv" | sort -V +echo "Compliance Check Compliance Result Profile Current Expected IP" +cat - | xq -r ".NessusClientData_v2.Report.ReportHost | if (. | type == \"array\") then .[] else . end | + (.ReportItem[] + {ip:.\"@name\"}) | + select(.compliance == \"true\") | + select(.\"cm:compliance-result\" != \"PASSED\") $filters | + [.\"cm:compliance-check-name\", .\"cm:compliance-result\", ( .\"cm:compliance-audit-file\" | match(\"L(evel_)?[12]\").string | sub(\"_\";\" \") | sub(\"L1\"; \"Level 1\") | sub(\"L2\"; \"Level 2\") ), .\"cm:compliance-actual-value\", .\"cm:compliance-policy-value\", .ip] + | @tsv" | sort -V