Advertisement
oquidave

monitoring .htaccess changes

Apr 4th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.95 KB | None | 0 0
  1. #monitoring file changes with auditctl
  2.  
  3. sudo apt-get install auditd
  4. sudo /sbin/auditctl -w /home/amf/public/site/.htaccess  -p war -k hosts-file
  5. oquidave@web /h/a/p/site> sudo /sbin/ausearch -f /home/amf/public/site/.htaccess | more
  6.  
  7. type=UNKNOWN[1327] msg=audit(1459766547.822:130): proctitle=2F7573722F7362696E2F61706163686532002D6B007374617274
  8. type=PATH msg=audit(1459766547.822:130): item=0 name="/home/amf/public/site/.htaccess" inode=141561 dev=08:00 mode=0100444 ouid=33 ogid=33 rdev=00:00 nametype=NORMAL
  9. type=CWD msg=audit(1459766547.822:130):  cwd="/"
  10. type=SYSCALL msg=audit(1459766547.822:130): arch=c000003e syscall=2 success=yes exit=41 a0=7f3c23034cd0 a1=80000 a2=1b6 a3=8 items=1 ppid=24452 pid=6797 auid=42949672
  11. 95 uid=33 gid=33 euid=33 suid=33 fsuid=33 egid=33 sgid=33 fsgid=33 tty=(none) ses=4294967295 comm="apache2" exe="/usr/sbin/apache2" key="hosts-file"
  12.  
  13. #.htaccess permissions, apache has only read permissions
  14. -r--r--r-- 1 www-data www-data 235 Dec 10 15:29 .htaccess
  15.  
  16. #apache parent process is running as root user
  17. 24452 root      20   0  494060  33084  24568 S   0.0  1.6  22:18.19 apache2
  18.  
  19. #process with pid 6797 isn't available
  20. oquidave@web /h/a/p/site> sudo ps -aux | grep 6797
  21. oquidave 15294  0.0  0.0  11720  1724 pts/6    S    13:51   0:00 grep --color=auto 6797
  22.  
  23. #other apache child processes running as www-data with no write access to .htaccess file  
  24. 12184 www-data  20   0  654328  71900  51908 S   0.0  3.5   0:02.25 apache2                                                                                          
  25. 13602 www-data  20   0  654252  69148  49192 S   0.0  3.4   0:01.27 apache2                                                                                          
  26. 13333 www-data  20   0  580456  69020  49192 S  27.3  3.4   0:01.09 apache2                                                                                          
  27. 13623 www-data  20   0  502728  59968  42292 S   0.0  2.9   0:00.32 apache2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement