Skip to content

Add lightweight WordPress and Drupal persona containers behind ModSecurity WAF#52

Open
Divyateja2709 wants to merge 57 commits intoOWASP:masterfrom
Divyateja2709:chameleonpersonas2
Open

Add lightweight WordPress and Drupal persona containers behind ModSecurity WAF#52
Divyateja2709 wants to merge 57 commits intoOWASP:masterfrom
Divyateja2709:chameleonpersonas2

Conversation

@Divyateja2709
Copy link
Copy Markdown

Hi @adrianwinckles,
In my earlier PRs (9-11, now closed), I misunderstood the chameleon idea and implemented personas as file swapping inside a single container. After re-reading the GSoC idea and our Slack discussion, I now understand the correct approach is swapping actual Docker containers based on external stimuli.
This PR corrects that mistake and implements the right approach.
What this PR does:
personas/wordpress/ — a lightweight nginx container that mimics WordPress 5.8.1 fingerprints:

Response headers: X-Powered-By: PHP/7.4.3, X-Generator: WordPress 5.8.1
Bait paths: /wp-login.php, /xmlrpc.php, /wp-config.php, /wp-admin/
WordPress style robots.txt with disallowed entries bots actively scan for
meta name="generator" content="WordPress 5.8.1" in HTML

personas/drupal/ — a lightweight nginx container mimicking Drupal 7 (CVE-2018-7600 Drupalgeddon2):

Response headers: X-Generator: Drupal 7
Bait paths: /user/login, /install.php, /.env, /admin/
Drupal style robots.txt

docker-compose.yml — updated to:

Add honeypot network shared by all containers
Give all persona containers the persona-app network alias so ModSecurity always proxies to the active persona

httpd.conf — enabled mod_proxy and mod_proxy_http so ModSecurity WAF acts as reverse proxy to persona-app
scripts/swap_persona.sh — stops all persona containers and starts the requested one

Next PR:
Wire shodan_watcher.py to call scripts/swap_persona.sh so Shodan detection triggers automatic container swap.

Added optional CRS update logic and improved logging for background processes.
Added initial README.md for CRS Auto Update script with planned features and assumptions.
Removed comment about Sidekick code generation.
Added logging and process management for Apache and Filebeat.
Updated the script to enforce SHA256 checksum format and added timeout options for curl and wget commands.
Updated filebeat configuration path to absolute path.
Updated Dockerfile to include TARGETARCH argument and modified file paths.
Added headers to prevent HTTP_PROXY leakage and set authentication headers.
Add a test script to verify the existence of bundled CRS paths and includes in the Docker container.
This script tests the successful update of the CRS within a Docker container, ensuring that the configuration remains valid and usable after the update.
Refactor test script for CRS update to use unique identifiers and validate fixture installation.
This script tests the behavior of the CRS update when the updater is disabled, ensuring that the status reflects 'skipped' and that the bundled CRS files remain intact.
Add a test script to verify fallback behavior during CRS update download failure.
This script tests the fallback behavior of the CRS updater when the SHA256 checksum does not match the expected value. It verifies that the bundled CRS remains unchanged and that the correct status is recorded.
This script tests the behavior of the CRS update process when a lock is held by another instance. It verifies that the update is skipped and the bundled CRS remains intact.
@Divyateja2709 Divyateja2709 changed the title Chameleonpersonas2 Add lightweight WordPress and Drupal persona containers behind ModSecurity WAF Mar 21, 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