mirror of
https://github.com/CISOfy/lynis.git
synced 2026-03-11 08:55:28 +00:00
audit dockerfile: replace deprecated MAINTAINER lookup
The MAINTAINER instruction was deprecated in 2017 in favor of an OCI label "org.opencontainers.image.authors". This patch replaces the MAINTAINER line lookup for this label in Dockerfiles. see: https://docs.docker.com/reference/build-checks/maintainer-deprecated/
This commit is contained in:
parent
b85cd6b266
commit
3e5c7c37b5
1 changed files with 4 additions and 4 deletions
|
|
@ -94,11 +94,11 @@ fi
|
|||
#
|
||||
InsertSection "${SECTION_BASICS}"
|
||||
|
||||
MAINTAINER=$(grep -E -i "*MAINTAINER" ${AUDIT_FILE} | sed 's/=/ /g' | cut -d'"' -f 2)
|
||||
if [ -z "${MAINTAINER}" ]; then
|
||||
ReportWarning "dockerfile" "No maintainer found. Unclear who created this file."
|
||||
AUTHORS=$(grep -E -i "^[[:space:]]*LABEL[[:space:]]+org\.opencontainers\.image\.authors.*" ${AUDIT_FILE} | sed 's/=/ /g' | cut -d'"' -f 2)
|
||||
if [ -z "${AUTHORS}" ]; then
|
||||
ReportWarning "dockerfile" "No authors label found (org.opencontainers.image.authors). Unclear who created this file."
|
||||
else
|
||||
Display --indent 2 --text "Maintainer" --result "${MAINTAINER}"
|
||||
Display --indent 2 --text "Authors" --result "${AUTHORS}"
|
||||
fi
|
||||
|
||||
ENTRYPOINT=$(grep "^ENTRYPOINT" ${AUDIT_FILE} | cut -d' ' -f2 )
|
||||
|
|
|
|||
Loading…
Reference in a new issue