Audit-Armada-App refactoring

This update changes the auditd daemon start command to use
the "no fork" option.
Also the auditd start command will be wrapped in a shell
script that will be called in the container.
Other changes include renaming the armada app and the helm
charts to "auditd".
Renaming has been applied to all the applicable configuration.

Story: 2008849
Task: 42691

Signed-off-by: Carmen Rata <carmen.rata@windriver.com>
Change-Id: I8cf0659f820bc3968c69fa981cfc6342d5571a7c
This commit is contained in:
Carmen Rata 2021-06-25 09:00:10 -04:00
parent 3235ba3182
commit 3bfaf3ee6a
8 changed files with 44 additions and 20 deletions

View File

@ -4,4 +4,6 @@ RUN yum -y update
RUN yum -y install\
audit
ENTRYPOINT ["/sbin/auditd", "-f", "-l"]
COPY startAuditd.sh .
RUN chmod 755 startAuditd.sh
ENTRYPOINT ["./startAuditd.sh"]

View File

@ -0,0 +1,22 @@
#!/bin/bash
#
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
set -u
echo "Starting auditd …"
# 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}

View File

@ -1,5 +1,5 @@
# Application tunables (maps to metadata)
%global app_name audit
%global app_name auditd
%global helm_repo stx-platform
%global armada_folder /usr/lib/armada
@ -11,7 +11,7 @@
%global helm_folder /usr/lib/helm
%global toolkit_version 0.1.0
Summary: StarlingX AUDIT Armada Helm Charts
Summary: StarlingX AUDITD Armada Helm Charts
Name: stx-audit-helm
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
@ -27,7 +27,7 @@ BuildArch: noarch
BuildRequires: helm
%description
StarlingX AUDIT Helm Charts
StarlingX AUDITD Helm Charts
%prep
%setup -n %{name}-%{version}

View File

@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "1.0"
description: A Helm chart for AUDIT service
name: audit
description: A Helm chart for AUDITD service
name: auditd
version: 1.0.0

View File

@ -1,5 +1,5 @@
#
# This file controls the configuration of the audit daemon
# This file controls the configuration of the auditd daemon
#
local_events = yes
write_logs = yes

View File

@ -1,4 +1,4 @@
1. AUDIT containerized deployment
1. AUDITD containerized deployment
This helm charts configuration creates:
- Config map for /etc/audit/auditd.conf
- Deploys auditd in a container

View File

@ -1,4 +1,4 @@
# Default values for audit.
# Default values for auditd.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

View File

@ -2,14 +2,14 @@
schema: armada/Chart/v1
metadata:
schema: metadata/Document/v1
name: audit
name: auditd
data:
chart_name: audit
release: audit
chart_name: auditd
release: auditd
namespace: kube-system
source:
location: http://172.17.0.1:8080/helm_charts/stx-platform/audit-1.0.0.tgz
subpath: audit
location: http://172.17.0.1:8080/helm_charts/stx-platform/auditd-1.0.0.tgz
subpath: auditd
type: tar
reference: master
wait:
@ -22,24 +22,24 @@ data:
delete:
- type: job
labels:
app: audit
app: auditd
dependencies: []
---
schema: armada/ChartGroup/v1
metadata:
schema: metadata/Document/v1
name: audit
name: auditd
data:
description: "StarlingX AUDIT"
description: "StarlingX AUDITD"
sequenced: false
chart_group:
- audit
- auditd
---
schema: armada/Manifest/v1
metadata:
schema: metadata/Document/v1
name: audit-manifest
name: auditd-manifest
data:
release_prefix: ns
chart_groups:
- audit
- auditd