Skip to content

Preserve database credentials as strings in Helm ConfigMaps - #385

Open
0x5t4l1n wants to merge 1 commit into
OWASP:developfrom
0x5t4l1n:fix/helm-database-configmap-strings
Open

0x5t4l1n wants to merge 1 commit into
OWASP:developfrom
0x5t4l1n:fix/helm-database-configmap-strings

Conversation

@0x5t4l1n

Copy link
Copy Markdown

Description

Quote PostgreSQL and MongoDB usernames, passwords and database names in the six Helm ConfigMaps that supply database configuration. Kubernetes requires ConfigMap data values to be strings: a password such as "123456" currently renders as a number, "null" renders as null, whitespace can be lost, and multiline values can break template parsing. Quoting preserves the configured value in both database and application ConfigMaps.

Refs #324 and the earlier, closed/unmerged #349. This PR covers database configuration values specifically, rather than claiming to resolve every Helm deployment issue. It bumps the chart version to 0.1.6 and adds rendered-manifest regression tests plus a dedicated CI job.

Testing

On Windows with Python 3.10 and Helm 3.16.4:

  • python -m pytest deploy/tests -q: 7 passed. The six custom-credential cases failed before the fix; the default configuration passed.
  • Tests render the actual chart, parse every ConfigMap and check that all data values are strings. They also verify exact round-trip values for numeric/boolean/null-looking strings, empty strings, leading/trailing spaces and multiline punctuation.
  • helm lint deploy/helm: passed; only the existing optional chart-icon recommendation appears.
  • Black check for the test file and git diff --check: passed.

The branch was tested independently from the chatbot fix. No live Kubernetes deployment or database login was performed. The new CI job runs chart rendering tests and Helm lint without a cluster.

Documentation

Added test setup and execution instructions in deploy/tests/README.md.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged (none required)
  • I have documented any changes if required in the docs.

This branch has not been deployed

No deployments
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