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

Task 4.4 changes owner/group for log files to root/utmp #83

Closed
jvleminc opened this issue May 3, 2022 · 1 comment
Closed

Task 4.4 changes owner/group for log files to root/utmp #83

jvleminc opened this issue May 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jvleminc
Copy link
Collaborator

jvleminc commented May 3, 2022

Task 4.4 states "Ensure logrotate assigns appropriate permissions"

In the CIS document the following example is given:

Edit /etc/logrotate.conf and update the create line to read 0640 or more restrictive,
following local site policy

Example:
create 0640 root utmp

Even though this is just an example, the "root utmp" is copied literally into the task and this leads to new log files getting wrong groups, which consecuently leads to logs not being able to be written to these files.

# 4.4 Ensure logrotate assigns appropriate permissions
# It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected.
- name: 4.4 Ensure logrotate assigns appropriate permissions
  lineinfile:
    dest: /etc/logrotate.conf
    regexp: "^create"
    line: "create 0640 root utmp"

The correct way should be just changing the file permissions, without changing the already set owner/group, something like:

    path: /etc/logrotate.conf
   regexp: '^create (.*) (.*)$'
   line: 'create 0640 \2'
   backrefs: yes
   ```
@jvleminc jvleminc added the Debugging Debugging Cases label May 3, 2022
@jvleminc jvleminc assigned alivx and jvleminc and unassigned alivx May 3, 2022
@jvleminc
Copy link
Collaborator Author

jvleminc commented May 3, 2022

@Sebastian-RG Can you fix this?

@jvleminc jvleminc added bug Something isn't working and removed Debugging Debugging Cases labels May 3, 2022
@jvleminc jvleminc removed their assignment May 4, 2022
@alivx alivx closed this as completed May 26, 2022
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