|
|
|
@ -4,13 +4,12 @@ check_1() {
|
|
|
|
|
logit ""
|
|
|
|
|
local id="1"
|
|
|
|
|
local desc="Host Configuration"
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
info "$check"
|
|
|
|
|
checkHeader="$id - $desc"
|
|
|
|
|
info "$checkHeader"
|
|
|
|
|
startsectionjson "$id" "$desc"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check_1_1() {
|
|
|
|
|
logit ""
|
|
|
|
|
local id="1.1"
|
|
|
|
|
local desc="General Configuration"
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
@ -58,7 +57,6 @@ check_1_1_2() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check_1_2() {
|
|
|
|
|
logit ""
|
|
|
|
|
local id="1.2"
|
|
|
|
|
local desc="Linux Hosts Specific Configuration"
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
@ -69,7 +67,7 @@ check_1_2() {
|
|
|
|
|
check_1_2_1() {
|
|
|
|
|
local id="1.2.1"
|
|
|
|
|
local desc="Ensure a separate partition for containers has been created (Scored)"
|
|
|
|
|
local remediation="For new installations, you should create a separate partition for the /var/lib/docker mount point. For systems that have already been installed, you should use the Logical Volume Manager (LVM) within Linux to create a new partition."
|
|
|
|
|
local remediation="For new installations, you should create a separate partition for the \"/var/lib/docker\" mount point. For systems that have already been installed, you should use the Logical Volume Manager (LVM) within Linux to create a new partition."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -85,7 +83,7 @@ check_1_2_1() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -116,8 +114,8 @@ check_1_2_2() {
|
|
|
|
|
check_1_2_3() {
|
|
|
|
|
local id="1.2.3"
|
|
|
|
|
local desc="Ensure auditing is configured for the Docker daemon (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /usr/bin/dockerd -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /usr/bin/dockerd -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -130,8 +128,7 @@ check_1_2_3() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -141,8 +138,7 @@ check_1_2_3() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -152,8 +148,8 @@ check_1_2_3() {
|
|
|
|
|
check_1_2_4() {
|
|
|
|
|
local id="1.2.4"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /var/lib/docker (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /var/lib/docker -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /var/lib/docker -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -167,8 +163,7 @@ check_1_2_4() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -178,8 +173,7 @@ check_1_2_4() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -195,8 +189,8 @@ check_1_2_4() {
|
|
|
|
|
check_1_2_5() {
|
|
|
|
|
local id="1.2.5"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /etc/docker (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /etc/docker -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /etc/docker -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -210,8 +204,7 @@ check_1_2_5() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -221,8 +214,7 @@ check_1_2_5() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -238,8 +230,8 @@ fi
|
|
|
|
|
check_1_2_6() {
|
|
|
|
|
local id="1.2.6"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - docker.service (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w $(systemctl show -p FragmentPath docker.service | sed 's/.*=//') -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w $(systemctl show -p FragmentPath docker.service | sed 's/.*=//') -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -253,8 +245,7 @@ check_1_2_6() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -264,8 +255,7 @@ check_1_2_6() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -281,8 +271,8 @@ check_1_2_6() {
|
|
|
|
|
check_1_2_7() {
|
|
|
|
|
local id="1.2.7"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - docker.socket (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w $(systemctl show -p FragmentPath docker.socket | sed 's/.*=//') -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w $(systemctl show -p FragmentPath docker.socket | sed 's/.*=//') -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -296,8 +286,7 @@ check_1_2_7() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -307,8 +296,7 @@ check_1_2_7() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -324,8 +312,8 @@ check_1_2_7() {
|
|
|
|
|
check_1_2_8() {
|
|
|
|
|
local id="1.2.8"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /etc/default/docker (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /etc/default/docker -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /etc/default/docker -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -339,8 +327,7 @@ check_1_2_8() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -350,8 +337,7 @@ check_1_2_8() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -367,8 +353,8 @@ check_1_2_8() {
|
|
|
|
|
check_1_2_9() {
|
|
|
|
|
local id="1.2.9"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /etc/sysconfig/docker (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /etc/sysconfig/docker -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /etc/sysconfig/docker -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -382,8 +368,7 @@ check_1_2_9() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -393,8 +378,7 @@ check_1_2_9() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -410,8 +394,8 @@ check_1_2_9() {
|
|
|
|
|
check_1_2_10() {
|
|
|
|
|
local id="1.2.10"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /etc/docker/daemon.json (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /etc/docker/daemon.json -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /etc/docker/daemon.json -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -425,8 +409,7 @@ check_1_2_10() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -436,8 +419,7 @@ check_1_2_10() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -453,8 +435,8 @@ check_1_2_10() {
|
|
|
|
|
check_1_2_11() {
|
|
|
|
|
local id="1.2.11"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /usr/bin/containerd (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /usr/bin/containerd -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /usr/bin/containerd -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -468,8 +450,7 @@ check_1_2_11() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -479,8 +460,7 @@ check_1_2_11() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -496,8 +476,8 @@ check_1_2_11() {
|
|
|
|
|
check_1_2_12() {
|
|
|
|
|
local id="1.2.12"
|
|
|
|
|
local desc="Ensure auditing is configured for Docker files and directories - /usr/sbin/runc (Scored)"
|
|
|
|
|
local remediation="Install and configure auditd using the following command: sudo apt-get install auditd. Add the following line to the /etc/audit/rules.d/audit.rules file: -w /usr/sbin/runc -k docker. Then restart the audit daemon using the following command: service auditd restart."
|
|
|
|
|
local remediationImpact="Because the audit can generate large log files, you need to make sure that they are rotated and archived periodically. It is a good idea to create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local remediation="Install and configure auditd using command \"sudo apt-get install auditd\". Add \"-w /usr/sbin/runc -k docker\" to the \"/etc/audit/rules.d/audit.rules\" file. Then restart the audit daemon using command \"service auditd restart\"."
|
|
|
|
|
local remediationImpact="Audit can generate large log files. So you need to make sure that they are rotated and archived periodically. Create a separate partition for audit logs to avoid filling up other critical partitions."
|
|
|
|
|
local check="$id - $desc"
|
|
|
|
|
starttestjson "$id" "$desc"
|
|
|
|
|
|
|
|
|
@ -511,8 +491,7 @@ check_1_2_12() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
@ -522,8 +501,7 @@ check_1_2_12() {
|
|
|
|
|
currentScore=$((currentScore + 1))
|
|
|
|
|
else
|
|
|
|
|
warn "$check"
|
|
|
|
|
info " * Remediation: $remediation"
|
|
|
|
|
info " * Remediation impact: $remediationImpact"
|
|
|
|
|
saveRemediation --id "${id}" --rem "${remediation}" --imp "${remediationImpact}"
|
|
|
|
|
resulttestjson "WARN"
|
|
|
|
|
currentScore=$((currentScore - 1))
|
|
|
|
|
fi
|
|
|
|
|