# Credential storage and log non-disclosure

Date: 2026-11-27
Stand: local Docker Desktop, compose project hla-lab7

Command:
  python tests/credential_storage.py --base-url https://localhost:8443 --ca-file secrets/pki/public-ca/ca.crt

Observed result:
  PASS: password and session token are stored only as hashes and are absent from API/LB logs.

What the check does:
  - creates one synthetic user and one session over verified HTTPS;
  - reads the user's password_hash and the session token_hash from
    PostgreSQL using the operator connection;
  - requires password_hash to start with the measured
    $argon2id$v=19$m=32768,t=2,p=1$ profile and to differ from the password;
  - requires token_hash to be exactly the SHA-256 of the issued token
    (64 hex characters / 32 bytes) and not the token itself;
  - scans the API and nginx logs for the synthetic password, the synthetic
    token, the stored password hash and the stored token hash;
  - fails if any of those values appear in the logs.

Related black-box check:
  tests/login_dos.py asserts that 401/429 bodies and headers do not contain
  the tested username, password, hash or token. Known and unknown usernames
  return the same 401 code and message.

The synthetic password and token exist only in process memory; this file
contains no credential values.
