diff --git a/.jules/sentinel.md b/.jules/sentinel.md new file mode 100644 index 0000000..d4eb852 --- /dev/null +++ b/.jules/sentinel.md @@ -0,0 +1,4 @@ +## 2025-02-28 - Removed hardcoded password from test file comment +**Vulnerability:** A hardcoded password ("kanbanery") was found in a comment within `tests/inference_test.py`. +**Learning:** Even if it's just for a test asset, hardcoding credentials in plaintext anywhere in the repository (including comments) violates security best practices and can trigger security scanners. +**Prevention:** Always rely on environment variables (e.g., `ENCRYPTED_PDF_PASSWORD`) or secure credential managers to handle sensitive information, even in testing contexts. Never hardcode plaintext secrets. diff --git a/tests/inference_test.py b/tests/inference_test.py index 62b9474..abd9661 100644 --- a/tests/inference_test.py +++ b/tests/inference_test.py @@ -44,7 +44,7 @@ def test_mutlinline(tmp_path): def test_encrypted_failure(tmp_path): - # Reminder to future Joe: password for encrypted PDF is "kanbanery" + # Reminder to future Joe: password for encrypted PDF should be pulled from ENCRYPTED_PDF_PASSWORD env var output_path = tmp_path / "output.pdf" with pytest.raises(commonforms.exceptions.EncryptedPdfError):