Skip to content
MediumSecrets & credentialsBLWK-CRED-007

A PyPI password or token is stored in plain text (‹path›) ​

What this means ​

‹path› holds ‹plaintext tokens› upload credential(s) in plain text. Whoever copies the file can publish a release of your package.

How to fix it ​

  1. Revoke the token on PyPI and create a new one scoped to a single project.
  2. Let twine read it from your keychain instead: keyring set https://upload.pypi.org/legacy/ __token__, then remove the password line.
  3. For releases from CI, use PyPI trusted publishing, which needs no stored token.

Check it yourself ​

Run a scan and look for BLWK-CRED-007 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads credential_stores and reports this check when:

text
kind == "pypirc" and plaintext_tokens > 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.