Skip to content

Commit

Permalink
DLPX-86537 CIS: sudoers configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dbshah12 committed Oct 1, 2024
1 parent 9e78010 commit 096ff6b
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -738,3 +738,38 @@
path: /etc/environment
state: absent
regexp: '^\s*PATH\s*='


#
# Ensure Defaults use_pty is set in /etc/sudoers
#
- lineinfile:
path: /etc/sudoers
state: present
regexp: '^Defaults use_pty'
line: 'Defaults use_pty'

#
# Ensure Defaults logfile is set in /etc/sudoers
#
- lineinfile:
path: /etc/sudoers
state: present
regexp: '^Defaults logfile=/var/log/sudo.log'
line: 'Defaults logfile=/var/log/sudo.log'

#
# Create logrotate configuration for sudo.log
#
- copy:
dest: /etc/logrotate.d/sudo-log
content: |
/var/log/sudo.log {
weekly
rotate 4
compress
missingok
notifempty
create 640 root root
}
mode: '0644'

0 comments on commit 096ff6b

Please sign in to comment.