Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit_log_dir not created #239

Open
gocyclones opened this issue Sep 18, 2024 · 1 comment
Open

audit_log_dir not created #239

gocyclones opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gocyclones
Copy link

Describe the Issue
audit_log_dir is not created

Expected Behavior
log directory should be created to defined var audit_log_dir

Actual Behavior
TASK [/runner/project/RHEL9-CIS : Post Audit | ensure audit files readable by users] ***
failed: [server1] (item=/var/log/lockdown/server1-RHEL9-CIS-v1.0.0_post_scan_1726677170.json) => {"ansible_loop_var": "item", "changed": false, "item": "/var/log/lockdown/server1-RHEL9-CIS-v1.0.0_post_scan_1726677170.json", "msg": "file (/var/log/lockdown/server1-RHEL9-CIS-v1.0.0_post_scan_1726677170.json) is absent, cannot continue", "path": "/var/log/lockdown/server1-RHEL9-CIS-v1.0.0_post_scan_1726677170.json", "state": "absent"}

Control(s) Affected
Audit logs

Environment (please complete the following information):

  • branch being used: 1.3.2
  • Ansible Version: 2.15
  • Host Python Version: Python 3.9.19
  • Ansible Server Python Version: 3.9.18

Possible Solution

diff --git a/RHEL9-CIS/tasks/pre_remediation_audit.yml b/RHEL9-CIS/tasks/pre_remediation_audit.yml
index 5a99844..167797d 100644
--- a/RHEL9-CIS/tasks/pre_remediation_audit.yml
+++ b/RHEL9-CIS/tasks/pre_remediation_audit.yml
@@ -14,6 +14,12 @@
       state: directory
       mode: '0755'

+- name: Pre Audit Setup | Ensure {{ audit_log_dir }} exists
+  ansible.builtin.file:
+      path: "{{ audit_log_dir }}"
+      state: directory
+      mode: '0755'
+
 - name: Pre Audit Setup | If using git for content set up
   when:
       - audit_content == 'git'
@gocyclones gocyclones added the bug Something isn't working label Sep 18, 2024
@uk-bolly
Copy link
Member

hi @gocyclones

Thank you for taking the time to raise this issue. I can see that the step already exists in the pre-remediation task to create the directory and the fact that the remediation runs and doesn't fail.
Can we go through the setting to have to see if we are able to reproduce the issue.

Many thanks

uk-bolly

@uk-bolly uk-bolly self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants