mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
# Send some requests & check log format
This commit is contained in:
parent
f32be70793
commit
686a74173f
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -49,4 +49,14 @@ jobs:
|
||||
run: |
|
||||
sudo systemctl restart apache2.service
|
||||
sudo cat /var/log/apache2/error.log
|
||||
|
||||
- name: Check error.log
|
||||
run: |
|
||||
# Send requests & check log format
|
||||
# Valid request
|
||||
curl -s http://127.0.01/ > /dev/null || echo $?
|
||||
# Invalid request
|
||||
curl -s http://127.0.01/%2e%2f > /dev/null || echo $?
|
||||
# Check log format
|
||||
grep -F ModSecurity < /var/log/apache2/error.log | grep -vP "^\[[^\]]+\] \[security2:[a-z]+\] \[pid [0-9]+:tid [0-9]+\] (?:\[client [0-9.:]+\] )?ModSecurity" || exit 0
|
||||
# grep -v succeeded => found some lines with invalid format
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user