diff --git a/debian_stable_docker_images.inc b/debian_stable_docker_images.inc new file mode 100644 index 0000000..cc62b53 --- /dev/null +++ b/debian_stable_docker_images.inc @@ -0,0 +1 @@ +stx-audit-helm diff --git a/stx-audit-helm/debian/docker/stx-audit/Dockerfile b/stx-audit-helm/debian/docker/stx-audit/Dockerfile new file mode 100644 index 0000000..3d1f72f --- /dev/null +++ b/stx-audit-helm/debian/docker/stx-audit/Dockerfile @@ -0,0 +1,16 @@ +ARG BASE +FROM ${BASE} AS stx + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get -y update && \ + apt-get -y install auditd + +COPY startAuditd.sh . + +RUN mkdir -p /etc/audit && \ + touch /etc/audit/audit.rules && \ + chmod 600 /etc/audit/audit.rules + +RUN chmod 755 startAuditd.sh +ENTRYPOINT ["./startAuditd.sh"] diff --git a/stx-audit-helm/debian/docker/stx-audit/startAuditd.sh b/stx-audit-helm/debian/docker/stx-audit/startAuditd.sh new file mode 100644 index 0000000..5d2739d --- /dev/null +++ b/stx-audit-helm/debian/docker/stx-audit/startAuditd.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# +# Copyright (c) 2022 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -u + +echo "Starting auditd …" + +# update /etc/audit/audit.rules with any changes made to +# /etc/audit/rules.d/audit.rules +augenrules --load + +# start auditd with no fork to run in the background in the container +/sbin/auditd -n -l +EXIT_STATUS=$? + +if [ "$EXIT_STATUS" -ne "0" ]; then + echo "Error code: $EXIT_STATUS" + echo "Could not start auditd" >&2 +fi + +exit ${EXIT_STATUS} diff --git a/stx-audit-helm/debian/stx-snmp-helm-audit.stable_docker_image b/stx-audit-helm/debian/stx-snmp-helm-audit.stable_docker_image new file mode 100755 index 0000000..8501dcb --- /dev/null +++ b/stx-audit-helm/debian/stx-snmp-helm-audit.stable_docker_image @@ -0,0 +1,3 @@ +BUILDER=docker +LABEL=stx-audit +DOCKER_CONTEXT=docker/stx-audit