M11: Credential Detection Hardening, Packaging/Display Polish & v0.2.0 PyPI Release¶
- Task ID:
M11 - Priority:
P0 - Status:
Done - Dependencies:
M7,M8,M9,M10 - Target Repository:
/Users/ivan/Project/3t.tools.intellij/verityredteam-free(verity-redteam-core) - GitHub Project #5: Verity RedTeam Free Task Board
1. Context & Problem Statement¶
Following Wave 2 completion (M7–M10), three follow-up items remain to finalize the v0.2.0 PyPI release and close edge cases discovered during smoke testing:
- Credential Detection Hardening:
ConsolidatedSecurityAuditor.audit_server()(src/verity/discovery/auditor.py) currently only checksMultiClientConfigScanner.SECRET_KEY_PATTERNSon env variable names.- As observed during
M7smoke checks, embedded DSN credentials (e.g.,DATABASE_URL=postgres://admin:SuperSecretPass999@db.internal:5432/prod) and secret-format tokens (SECRET_VALUE_PATTERNS, e.g.,sk-...,ghp_...,eyJ...) under arbitrary env keys such asCUSTOM_FIELDare not flagged byaudit_server()yet. - Safe placeholder references such as
postgres://admin:${DB_PASS}@db.internal:5432/prodor${OPENAI_API_KEY}must remain exempt even when those variables are exported inos.environ. - Packaging & Terminal Display Polish:
uv buildprintsSetuptoolsDeprecationWarningbecausepyproject.tomlstill specifieslicense = { text = "Apache-2.0" }instead of SPDXlicense = "Apache-2.0"withsetuptools>=77.0.0.src/verity/reporting/terminal.pywraps/ellipsizes long rule IDs (SEC-STATIC-UNSAFE-SHELL-WR…) inrender_scan_terminal()because theRulecolumn lacksno_wrap=True.- Bump package version from
0.1.0to0.2.0inpyproject.tomlandsrc/verity/__init__.py. - PyPI
v0.2.0Publish & Live Cold-Install E2E Verification: - Push
main(M7–M11) and tagv0.2.0to trigger.github/workflows/workflow.yaml(PyPI Trusted Publishing). - Run
INSTALL_SOURCE=pypi ./tests/e2e_containers/run_e2e.shacross all 4 clean Docker containers to verify live PyPIpipanduvxinstallation from scratch.
2. Requirements & Target Files¶
pyproject.toml&src/verity/__init__.py:- Update
[build-system].requiresto["setuptools>=77.0.0"],version = "0.2.0", andlicense = "Apache-2.0". - Update
__version__ = "0.2.0". src/verity/discovery/config_scanner.py:- Add
DSN_CREDENTIAL_PATTERNonMultiClientConfigScanner(postgres/postgresql/mysql/mariadb/mongodb/mongodb+srv/redis/rediss/amqp/amqps/mssql/snowflake/http/httpswithuser:pass@). - Add
@classmethod def is_secret_env_entry(cls, key: str, raw_value: Any) -> boolhandlingSECRET_KEY_PATTERNS,SECRET_VALUE_PATTERNS, andDSN_CREDENTIAL_PATTERNwhile exempting${...}/$...env references (including${VAR}in the DSN password segment). src/verity/discovery/auditor.py:- Use
MultiClientConfigScanner.is_secret_env_entry(k, raw_text)inaudit_server(). src/verity/cli.py:- Use
MultiClientConfigScanner.is_secret_env_entry()and also extract DSN password groupdsn_match.group(1)into thesecretsscrub list in_collect_config_findings()so neither the full DSN nor embedded password leaks in any report format. src/verity/reporting/terminal.py:- Set
table.add_column("Rule", no_wrap=True)inrender_scan_terminal(). tests/unit/test_cli_auditor_parity.py&tests/unit/test_cli_and_reporting.py:- Assert full un-ellipsized
"SEC-STATIC-SECRET-IN-CONFIG"in terminal mode (no_wrap=True). - Assert parametrized across
["terminal", "json", "markdown", "html"]thatDATABASE_URLDSN credentials andCUSTOM_FIELD: sk-...are caught and scrubbed with zero leaks, whilepostgres://admin:${DB_PASS}@...is not flagged. - Assert
verity.__version__ == "0.2.0".
3. Verification Commands¶
cd /Users/ivan/Project/3t.tools.intellij/verityredteam-free
uv sync --extra dev
uv run ruff check src tests
uv run pytest tests/ -q
uv build
git push origin main && git tag -a v0.2.0 -m "Release v0.2.0" && git push origin v0.2.0
INSTALL_SOURCE=pypi ./tests/e2e_containers/run_e2e.sh
4. Acceptance Criteria¶
- [x]
MultiClientConfigScanner.is_secret_env_entry()detects plaintext key patterns,SECRET_VALUE_PATTERNSunder arbitrary keys, and DSN credential URLs while ignoring${VAR}references (including${DB_PASS}inside DSN URLs). - [x] Neither full DSN values nor embedded passwords leak in
terminal,json,markdown, orhtmloutputs. - [x]
terminal.pyrenders full rule IDs (no_wrap=True), anduv buildproduces0.2.0wheel/sdist with zeroSetuptoolsDeprecationWarning. - [x] Both
verityredteam-freeunit tests (ruff+pytest) andverityredteamPro MCP agent tests (17/17) pass cleanly. - [x] Tag
v0.2.0publishesverity-redteam-core==0.2.0to PyPI andINSTALL_SOURCE=pypi ./tests/e2e_containers/run_e2e.shpasses across all 4 clean containers.