Skip to content

Docker support, Hurl test harness, and fixes (#8, #33, #103)#115

Open
amarcalfaria wants to merge 8 commits into
masterfrom
pr/docker-hurl-fixes
Open

Docker support, Hurl test harness, and fixes (#8, #33, #103)#115
amarcalfaria wants to merge 8 commits into
masterfrom
pr/docker-hurl-fixes

Conversation

@amarcalfaria
Copy link
Copy Markdown

Summary

Adds container-based deployment, a language-agnostic test harness, and three bug fixes to the modern (Java 5–8) mainline. All changes are additive except the SQLi test-script replacement.

Docker support (#68)

  • Multi-stage Dockerfile (build WAR on JDK 8 / Maven → deploy on Tomcat 9, JDBC drivers preinstalled).
  • One compose file per database: docker-compose.{mysql,mssql,oracle}.yml, each bringing up the app + a seeded DB.
  • docker/entrypoint.sh rewrites conf/Spiracle.properties from env vars (default connection + DB host) so the committed config is untouched.
  • One-command run: docker compose -f docker-compose.mysql.yml up --build then http://localhost:8080/spiracle/.

Hurl test harness

  • Replaces the Python 2 tests/spiracle_sqli_test.py (bespoke <split> format) with Hurl suites under tests/hurl/:
    • smoke/ + functional/ — run against a plain (unprotected) deployment, no agent (covers SendRedirect, SQL, reflected XSS, path traversal, negative cases).
    • rasp/ — the 440-case injection matrix; asserts the 550 block status, which is only emitted with the Waratek RASP agent attached (agent-only).
  • Validated green against the MySQL Docker stack (smoke + functional, 19 requests).

Fixes

Docs

  • README.adoc gains Docker quickstart, Testing, the -Dversion.jdk/-Dversion.webxml build matrix, and a branch-model note (master = Java 5–8; java4 = Java 1.4 variant).

Notes

Verification

  • mvn install -Dversion.webxml=30 -DskipTests then BUILD SUCCESS.
  • Smoke + functional Hurl suites pass against the live MySQL stack.

mkennedywaratek and others added 8 commits June 19, 2025 07:42
The old tests/spiracle_sqli_test.py was Python 2 and used a bespoke
<split> data format. Replace it with Hurl (hurl.dev): a generator turns
the existing mysql.txt/oracle.txt payload matrices into .hurl files
under tests/hurl/rasp/, with the block status as a {{block_status}}
variable. Because the 550 block code is only emitted when the Waratek
RASP agent intercepts the query, that suite is RASP-efficacy only; a
separate tests/hurl/smoke/ suite runs against a plain (unprotected)
deployment for CI, proving the app serves and that injections succeed
unprotected. Includes run.sh and docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
First run failed on DROP TABLE (tables absent); re-runs failed on
CREATE USER (user already present). Guard CREATE USER with IF NOT EXISTS
and the three DROP TABLE statements with IF EXISTS so the script can be
run repeatedly without manual cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SendRedirect wrote plaintext instructions via getWriter() with no
Content-Type header when the redirectMeTo param was absent. Every other
output path in the app already sets Content-Type via setHeader; this was
the last servlet response missing one. Use text/plain since the body is
plain instructional text, not HTML.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ction (#103)

CreateC3p0Connection.init() read non-existent bare property keys
(c3p0.url, c3p0.classname, ...) instead of the per-database keys defined
in Spiracle.properties (c3p0.oracle.url, ...). url resolved to null, so
ComboPooledDataSource.setJdbcUrl(null) led to DriverManager.getDriver(null)
and OracleDriver.acceptsURL(null) threw NPE. Derive the key prefix from the
default.connection property (matching SpiracleInit's convention) so the
correct per-database connection settings are loaded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Multi-stage Dockerfile builds the WAR (JDK 8 / Maven) and deploys it on
Tomcat 9 with the MySQL, MSSQL and Oracle JDBC drivers preinstalled. An
entrypoint rewrites conf/Spiracle.properties from env vars (default
connection + DB host/URL) so the committed config is untouched. One
compose file per database (mysql/mssql/oracle) brings up the app plus a
seeded database for a one-command, no-local-install test target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…raversal/negative

Expands test coverage beyond smoke with endpoint-level functional tests
that run against an unprotected deployment: a regression test for the
SendRedirect Content-Type fix (#8), benign + injection SQL behavior,
reflected XSS, path traversal, and negative cases. Validated green
against the MySQL Docker stack. (The rasp/ matrix remains agent-only.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
README now covers the per-database Docker compose stacks, the Hurl test
suites (smoke/functional run on a plain deployment, rasp is agent-only),
and the -Dversion.jdk/-Dversion.webxml build matrix with the master
(Java 5-8) vs java4 branch split. Notes the SendRedirect Content-Type
(#8), setupdb idempotency (#33), and Oracle NPE (#103) fixes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants