Repository navigation
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #789 +/- ##
==========================================
+ Coverage 71.64% 72.91% +1.26%
==========================================
Files 41 42 +1
Lines 5382 5409 +27
Branches 492 493 +1
==========================================
+ Hits 3856 3944 +88
+ Misses 1414 1347 -67
- Partials 112 118 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…mand Actions that change data were plain GET links, so a crafted link or a browser prefetch could delete a connection, run a task or stop the scheduler as the signed-in user. Stored secrets were also decrypted into every connection, project and task page. - Make 34 state-changing routes POST-only (deletes, run, schedule, enable, disable, duplicate, reset, end retry, refresh cache, file sends, dashboard bulk actions and scheduler controls). Hub's CSRFProtect now checks them. - Add a csrf-token meta tag and submit data-method="post" links as a form with the token; the enable/disable switch sends it as a header. - Add POST /secret/<kind>/<id>/<field> to reveal or copy one secret. Each use is written to the user history log, never the value, and the response is sent with Cache-Control: no-store. - Stop rendering decrypted passwords, keys, connection strings and sensitive parameters on connection, project and task pages. Show a masked value with Show and Copy instead; connection strings keep everything but the password visible. - Remove the database_pass filter, which put the password in the page twice, and the "Toggle Sensitive Values" block. - Update tests that called these routes with GET, and add tests for POST-only routes, CSRF, the reveal endpoint and masking. Edit forms still prefill decrypted values; that needs a "leave blank to keep" change and is left for a follow-up.
2791ad5 to
29ecbca
Compare
- Show connection strings and SSH/GPG keys in the Prism-highlighted code box again, with Show and Copy below; revealed values are highlighted. - Restore the "Toggle Sensitive Values" button and ini block for project and task parameters. The button now fetches sensitive values on demand (logged), and hides them again after 30 seconds.
Summary
Hub stores credentials for other systems, so two web issues mattered:
Changes
CSRFProtectnow checks them. A GET returns 405; a POST without the token returns 400.csrf-tokenmeta tag (outside the shared{% cache %}block), anddata-method="post"links submit as a form with the token. Confirms moved todata-confirm, so cancelling can't still submit. The enable/disable switch sends the token as a header.POST /secret/<kind>/<id>/<field>reveals or copies one secret. Each use is logged to Admin → User History (never the value), and responses areCache-Control: no-store.database_passfilter (it put the password in the page twice) and the "Toggle Sensitive Values" block.Not in this PR: edit forms still prefill decrypted values. That needs "leave blank to keep the current value" in each save handler, so it's a separate change.
Screenshots
Same demo data on
dev(before) and this branch (after).After clicking Show (hides again after 30 seconds):
Test plan
pytest web/tests: 193 passed, including new tests intest_post_actions_and_secrets.py:no-store