Repository navigation
Open
Milestone
Description
Replaces #1025. Instead of publishing custom MariaDB and MongoDB images, provide scripts that set up the databases on stock images and on any MariaDB/MySQL or MongoDB server. The Docker Compose quick start and self-hosting then share one setup path, and only owasp/security-shepherd is published.
Why
The custom images in docker/mariadb and docker/mongo are the stock images plus:
- the schema files
coreSchema.sql,moduleSchemas.sqlandmoduleSchemas.js, copied into/docker-entrypoint-initdb.d; - three text edits, done with
sedat build time:- uncommenting the
DELIMITERlines (docker/scripts/convert-sql-scripts.sh); - rewriting the challenge users' grants from
'@localhost'to'@'%'(Docker - Establish communication with module schema #367); - removing the
//REMOVEmarkers in the Mongo script;
- uncommenting the
- a small config file.
Publishing them would mean rebuilding and republishing for every upstream MariaDB/Mongo patch, or serving stale databases under the OWASP name. The quick start clones the repo anyway, so the scripts are already there.
Proposal
- Scripts such as
scripts/db/setup-mariadb.shandscripts/db/setup-mongo.shthat:- read the schema files from
src/main/resources, and make the three edits when they run rather than at build time; - take the challenge users' grant host as a setting, defaulting to
'%', so remote databases work; - work in a stock image's
/docker-entrypoint-initdb.d, using that image's admin credentials; - also run against your own server, with host, port and admin credentials as arguments.
- read the schema files from
docker-compose.ymluses the stockmariadbandmongoimages and mounts the scripts and schema files.- Remove
docker/mariadb/Dockerfile,docker/mongo/Dockerfile,convert-sql-scripts.shand the Maven steps that copy and convert the database files.mvn -Pdockerthen only builds the WAR. - Docs: the README's Docker section, plus a short "bring your own database" section covering supported versions and how to run the scripts.
Related
- Publish the MariaDB and MongoDB images to Docker Hub as owasp/security-shepherd-db and owasp/security-shepherd-mongo #1025: publishing the database images (closed in favour of this).
- Move database configuration from build-time to runtime environment variables #814: database configuration from environment variables at runtime.
- Upgrade MongoDB server 4.1.13 → 8.0 and Java driver 3.12 → 5.x #958: the MongoDB 8 upgrade, which affects the Mongo script (
mongoshinstead ofmongo). - it-test profile tags its Mongo build as mongo:${MONGODB_VERSION}, breaking the next local IT run #938 / build: give the it-test MongoDB image its own name (PR 3 of #958) #1009: the integration tests' own Mongo image.
- AGENTS.md: 'mvn -Pdocker validate' doesn't produce usable docker/mariadb init scripts #962:
mvn -Pdocker validateand the database init scripts.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsBacklog
Activity
2300031984 commentedon Oct 29, 2026
Hi @ismisepaul, I’d like to contribute to this issue. I understand the goal is to replace the custom MariaDB and MongoDB images with stock images and reusable database setup scripts that support both Docker Compose and externally hosted databases.
Would you be open to a contribution for this? Given the scope, would you prefer the work to be split into smaller PRs, and is there a particular part you’d recommend starting with?
ismisepaul commentedon Nov 1, 2026
we not focusing on this right now, our aim is to get a release out (4.0.0 milestone), planning this to be within 4.1.0 instead
2300031984 commentedon Nov 2, 2026
Thanks for letting me know. I understand the focus is currently on the 4.0.0 release, and this issue is planned for 4.1.0.