25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

lab10-solution.org 1.2 KiB

11 ay önce
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #+title: Lab9 Solution
  2. #+title: Amirlan Sharipov (BS21-CS-01)
  3. #+author: Amirlan Sharipov (BS21-CS-01)
  4. #+PROPERTY: header-args :results verbatim :exports both
  5. #+OPTIONS: ^:nil
  6. * Question 1
  7. I would use rsyslog and journald. Forward them to ELK stack and use it as a SIEM.
  8. There are many people people familiar with the ELK stack, and it's easy to scale it.
  9. * Question 2
  10. > sudo cat /etc/rsyslog.d/auth-errors.conf
  11. auth.alert,authpriv.alert /var/log/auth-errors
  12. [[./rsyslogpriority.jpg][rsyslogpriority
  13. ]]
  14. * Question 3
  15. #+begin_src bash
  16. cat /etc/logrotate.d/httpd
  17. #+end_src
  18. #+RESULTS:
  19. : /var/log/httpd/*log {
  20. : rotate 10
  21. : compress
  22. : missingok
  23. : sharedscripts
  24. : postrotate
  25. : /usr/bin/systemctl reload httpd.service 2>/dev/null || true
  26. : endscript
  27. : }
  28. '* */6 * * * logrotate /etc/logrotate.d/httpd
  29. [[./logrotate.jpg][logrotate
  30. ]]
  31. * Question 4
  32. * Question 5
  33. in /etc/bashrc:
  34. export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" )"'
  35. in /etc/rsyslog.d/bash.conf
  36. local6.* /var/log/commands.log
  37. Taken from https://unix.stackexchange.com/questions/664581/how-do-i-log-all-commands-executed-by-all-users