Skip to content

test: add Docker-based build and smoke test environment - #92

Open
fzipi wants to merge 3 commits into
owasp-modsecurity:masterfrom
fzipi:test/docker-build-environment
Open

test: add Docker-based build and smoke test environment#92
fzipi wants to merge 3 commits into
owasp-modsecurity:masterfrom
fzipi:test/docker-build-environment

Conversation

@fzipi

@fzipi fzipi commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Add a multi-stage Dockerfile that builds libmodsecurity v3, Apache 2.4.62, and the connector, and produces a runnable test image
  • Add docker-compose.yml for container management
  • Add test-connector.sh, an automated smoke test suite (normal requests, query-string blocking, request-body blocking, large/multi-bucket POST handling)
  • Add DOCKER_TEST.md and FIXES_SUMMARY.md documenting how to run the tests and what they verify
  • Fix the request-body test rule to use a standard HTTP status (403) instead of a non-standard one (488) that Apache can't put on the wire, and align test-connector.sh's expectations so the suite passes consistently
  • Add a GitHub Actions workflow (.github/workflows/docker-build.yml) that builds the image and runs test-connector.sh on pushes to master and on PRs touching the Dockerfile, compose file, test script, or src/ — there was no CI covering the Docker build before

Test plan

  • docker build -t modsec3-apache-test . completes successfully
  • Container starts and Apache loads mod_security3
  • ./test-connector.sh passes all 6 checks (200/403/200/200/403 as expected)
  • actionlint and zizmor report no findings on the new workflow

fzipi and others added 3 commits July 25, 2026 15:49
Adds a multi-stage Dockerfile that builds libmodsecurity v3, Apache
2.4.62, and the connector, plus docker-compose.yml, an automated
test-connector.sh smoke test, and docs summarizing the fixes and how
to verify them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test-rules.conf's REQUEST_BODY rule used status:488, a non-standard
code Apache can't emit on the wire (it falls back to 500), while
test-connector.sh inconsistently expected 403 for the same rule in one
test and 488 in another. Use 403 everywhere so the smoke suite
actually passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Builds the Docker image and runs test-connector.sh on push to master
and on pull requests that touch the Dockerfile, docker-compose.yml,
test-connector.sh, or src/. There was previously no CI covering the
Docker build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fzipi fzipi changed the title Add Docker-based build and smoke test environment test: add Docker-based build and smoke test environment Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant