saving uncommitted changes in /etc prior to dnf run

This commit is contained in:
2022-03-18 16:30:29 +02:00
parent 4644686801
commit ac4f4c0405
4 changed files with 17 additions and 1 deletions

View File

@@ -2650,6 +2650,7 @@ maybe chmod 0644 'logrotate.d/rkhunter'
maybe chmod 0644 'logrotate.d/rspamd'
maybe chmod 0644 'logrotate.d/sa-update'
maybe chmod 0644 'logrotate.d/squid'
maybe chmod 0640 'logrotate.d/ssh-logins'
maybe chmod 0644 'logrotate.d/sssd'
maybe chmod 0644 'logrotate.d/subscription-manager'
maybe chmod 0644 'logrotate.d/syslog'

10
logrotate.d/ssh-logins Normal file
View File

@@ -0,0 +1,10 @@
/var/log/ssh-logins.log {
weekly
missingok
rotate 4
dateext
compress
delaycompress
notifempty
}

View File

@@ -1 +1 @@
nameserver 192.168.1.2
nameserver 192.168.1.1

View File

@@ -2,11 +2,16 @@
export PATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:$PATH"
DATE="$(date)"
HOSTNAME="$(hostname)"
USERIP="$(echo "$SSH_CONNECTION" | cut -d " " -f 1)"
RDNS="$(dig -x "$USERIP" +short)"
if [[ "$USER" == "laser" ]]
then
curl -s -X POST -H "content-type: application/json" -d '{"routing_key":"1969ec3d30b74608d0135d6321275bb7","event_action":"trigger","payload":{"summary":"User '"$USER"' has logged in via SSH!!","source":"/etc/ssh/sshrc","severity":"critical","component":"exploratory-stats","group":"prod-d atapipe","class":"deploy"}}' https://events.pagerduty.com/v2/enqueue
#echo "User $USER logged in via SSH using ip address: $USERIP (dns: $RDNS) at $DATE" >> /var/log/ssh-logins.log
else
#echo "User $USER logged in via SSH using ip address: $USERIP (dns: $RDNS) at $DATE" >> /var/log/ssh-logins.log
exit 0
fi