Ubuntu 20.04 Audit
Overview
This repository is forked from ansible-lockdown/UBUNTU20-CIS-Audit branch: devel
and commit: b0b484f198b145eb7cbe8cc0e8a7b0abab3003b5
Perform Audit
# Install GOSS
sudo curl -L https://github.com/aelsabbahy/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
sudo chmod +rx /usr/local/bin/goss
# Install Git and clone repo
sudo apt update
sudo apt install git -y
cd /var/tmp/
sudo git clone --single-branch --branch dev https://bitbucket.it.keysight.com/scm/kps011/ansible-lockdown-ubuntu20-audit.git
cd ansible-lockdown-ubuntu20-audit
# Run audit
sudo ./run_audit.sh
Report Dissection
- Report will be generated at
/var/tmp
with the naming formataudit_ansible-lockdown-ubuntu20_${epoch_time}.json
- N.B.: each CIS rule can have multiple goss checks
- 2 main keys:
-
summary: high level goss statistic
"summary": { "failed-count": 142, "summary-line": "Count: 372, Failed: 142, Duration: 42.973s", "test-count": 372, "total-duration": 42972592899 }
- where:
failed-count
: number of failed checkssummary-line
: summary oftest-count
,failed-count
andtotal-duration
ins
test-count
: total number of checkstotal-duration
: time taken to perform all checks inns
- where:
-
results: contains a list of goss check in the following format
"results": [ ..., { "duration": 597607, "err": null, "expected": [ "/^Storage=none/", "/^ProcessSizeMax=0/" ], "found": null, "human": "", "meta": { "CIS_ID": [ "1.5.1" ], "CISv8": [ 4.1 ], "CISv8_IG1": true, "CISv8_IG2": true, "CISv8_IG3": true, "server": 1, "workstation": "NA" }, "property": "contains", "resource-id": "/etc/systemd/coredump.conf", "resource-type": "File", "result": 1, "successful": false, "summary-line": "File: /etc/systemd/coredump.conf: contains: patterns not found: [/^Storage=none/, /^ProcessSizeMax=0/]", "test-type": 2, "title": "1.5.1 | Ensure core dumps are restricted | coredump.conf" }, ... ],
- where:
duration
: time taken to run the check in nserr
: error encountered during goss auditexpected
: desired valuefound
: actual valuehuman
: autogenerated string usingexpected
andfound
meta
: metadata of the corresponding CIS ruleproperty
: specific check performed correspond to resource-typeresource-id
: UID of goss checkresource-type
: type of goss check (availabe tests here)result
:- goss result in integer:
0
iffound == expected
else1
- special case:
2
if skipped,3
if unknown
- goss result in integer:
successful
: goss result in string:true
iffound == expected
elsefalse
summary-line
: autogenerated string usingresource-type
,resource-id
,property
,expected
andfound
test-type:
1
if skipped else0
- special case:
2
whenresource-type == Command
andproperty == stdout
resource-type == File
andproperty == contains
title
: title of the corresponding CIS rule
- where:
-