dreport: Add audit.log Data to Dump
Add all /var/log/audit/audit.log files to BMC dumps. This
file contains a log of the events that occurred and who initiated
them.
Tested:
```
BMCDUMP$ ls -la audit-log.log
-rw-r--r-- 1 xxxx xxxx 3993 Sep 19 10:59 audit-log.log
$ tar -tvf $DUMPFILE | grep audit
drwx------ root/root 0 2023-03-22 14:07 BMCDUMP.SIMP10R.00000000.20230322190714/audit/
-rw------- root/root 1729455 2023-03-22 14:07 BMCDUMP.SIMP10R.00000000.20230322190714/audit/audit.log
-r-------- root/root 2097279 2023-03-22 14:07 BMCDUMP.SIMP10R.00000000.20230322190714/audit/audit.log.3
-r-------- root/root 2097160 2023-03-22 14:07 BMCDUMP.SIMP10R.00000000.20230322190714/audit/audit.log.2
-r-------- root/root 2097227 2023-03-22 14:07 BMCDUMP.SIMP10R.00000000.20230322190714/audit/audit.log.1
```
Change-Id: I8e36edeca9ad40f8ddc02becf3a9246e0989d72a
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com>
diff --git a/tools/dreport.d/plugins.d/auditlog b/tools/dreport.d/plugins.d/auditlog
new file mode 100644
index 0000000..b254bd1
--- /dev/null
+++ b/tools/dreport.d/plugins.d/auditlog
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# config: 2 40
+# @brief: Save the audit log
+#
+
+# shellcheck disable=SC1091
+. "$DREPORT_INCLUDE"/functions
+
+# Multiple audit.log files can exist in the $log_path
+# directory. Copy all that exist to the dump.
+desc="Audit Log"
+log_path="/var/log/audit/"
+
+if [ -e "$log_path" ]; then
+ add_copy_file "$log_path" "$desc"
+fi