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 fe3b417
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -738,3 +738,37 @@
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
}
mode: '0644'

0 comments on commit fe3b417

Please sign in to comment.