neolith.E005 can show a database password when DATABASES was changed after the builder

Open
#132 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
backend, security

Research direction

Start by reading _configure._difference, settings_problems, and the builder's refusal paths; the issue names these as the places that produce messages. Add or inspect a test that walks a DATABASES value with a marker string in every leaf and checks every relevant message. Done means all paths within every database alias are named without exposing either value, and the marker appears in no message.

Written by the indexing model from the issue text.

Description

bug

neolith.E005 compares the settings Django holds with what the host builds, and reports the first difference as <path> is <found value>, the host builds <built value> (_configure._difference). For DATABASES that comparison goes to every key at every depth, so when a settings module changes a connection value after build_settings, the message shows both values. If the key is PASSWORD, or an OPTIONS entry such as a key file or a connection string, the refusal prints a secret to standard error and to CI logs, and the host-built value it prints is the one configured under NEOLITH.

It needs a mistake in the settings module to appear, and it shows only in the deployer's own output. It still goes against the rule the other refusals keep: a message names the input and the rule, never a secret (K9).

Expected: a difference inside a DATABASES entry names the path (DATABASES['default']['PASSWORD']) and says it differs from what the host builds, without either value. The class to cover, not only this key: every value under a DATABASES alias, at any depth, in every message settings_problems and the builder's own refusals can produce; a test that walks a DATABASES with a marker string in every leaf and finds the marker in no message.

Found while preparing #130.

Dominant language
Python
Stars
1
Forks
0
Avg merge
5h 30m
Merged PRs (30d)
85

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stack314/django-neolith

All issues in stack314/django-neolith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.