Skip to content

Commit 686a741

Browse files
author
Marc Stern
committed
# Send some requests & check log format
1 parent f32be70 commit 686a741

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,14 @@ jobs:
4949
run: |
5050
sudo systemctl restart apache2.service
5151
sudo cat /var/log/apache2/error.log
52-
52+
- name: Check error.log
53+
run: |
54+
# Send requests & check log format
55+
# Valid request
56+
curl -s http://127.0.01/ > /dev/null || echo $?
57+
# Invalid request
58+
curl -s http://127.0.01/%2e%2f > /dev/null || echo $?
59+
# Check log format
60+
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
61+
# grep -v succeeded => found some lines with invalid format
62+
exit 1

0 commit comments

Comments
 (0)