PT-079: XNAT set-password invite link (no emailed password) + enclave branding - #977
Draft
atriaybagur wants to merge 2 commits into
Draft
PT-079: XNAT set-password invite link (no emailed password) + enclave branding#977atriaybagur wants to merge 2 commits into
atriaybagur wants to merge 2 commits into
Conversation
FLIP-PT-079: the hub decrypted the XNAT account password and emailed it in cleartext via SES, so anyone able to read the mailbox held standing PACS access to a trust's imaging archive. Trust-side, imaging-api now creates the XNAT user with a throwaway random password that is never disclosed, mints a single-use XNAT alias token, and returns a host-less "set your own password" path. The hub emails that path (new flip-xnat-invite SES template, renamed from flip-xnat-credentials) with a note that the link only works from inside the trust's XNAT network. The decrypt-and-email-password path is removed, so no standing credential is ever transmitted. Retest `git grep "password=decrypted"` returns zero. The account is created with a password (not passwordless) on purpose: XNAT's password-change path raises on a user that has no existing password. Users who already have an XNAT account and are added to a further project continue to receive the existing added-to-project notification. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
… logo The mocked XNAT at each trust shipped with the stock XNAT logo and the default "Welcome to XNAT..." placeholder description, so a user reaching it over the enclave could not tell which trust's XNAT they were on. configure-xnat.sh now sets the site description to "Welcome to FLIP's XNAT at <trust>" (from TRUST_NAME, passed through to the xnat-web container by the xnat stack; XNAT_SITE_DESCRIPTION overrides the whole string) and points siteLogoPath at a FLIP logo baked into the webapp image. The description JSON is built with jq so a trust name containing an apostrophe stays valid. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses FLIP-PT-079 (High — plaintext XNAT passwords emailed via SES) and, alongside it, brands the mocked enclave XNAT so users can tell which trust they are on.
Two logical commits:
security(pt-079)— email a set-password invite link instead of a password.feat(xnat)— trust-named site description + FLIP logo on the XNAT login page.PT-079 — invite link, never a password
Previously the hub decrypted the generated XNAT account password and emailed it in cleartext via SES, so anyone able to read the mailbox held standing PACS access to a trust's imaging archive.
Now:
flipServiceAccountalready holds theAdministratorrole this needs), and returns a host-less…/XDATScreen_UpdateUser.vm?a=…&s=…path.flip-xnat-inviteSES template (renamed fromflip-xnat-credentials), with a note that the link only works from inside the trust's XNAT network — XNAT is not reachable over the public internet. No standing credential is ever transmitted.git grep "password=decrypted" -- 'flip-api/**/*.py'→ 0 hits.The account is created with a password (not passwordless) on purpose: XNAT's password-change path raises on a user that has no existing password. Existing users added to a further project still receive the existing added-to-project notification.
XNAT enclave branding
configure-xnat.shnow sets the login-page site description to "Welcome to FLIP's XNAT at <trust>" (fromTRUST_NAME, passed through to the xnat-web container;XNAT_SITE_DESCRIPTIONoverrides) and pointssiteLogoPathat a FLIP logo baked into the XNAT webapp image.Testing
terraform fmtcleanDeploy notes
terraform applythe SES module so theflip-xnat-invitetemplate exists before the hub is redeployed, otherwisesend_emailfails on a missing template.configure-xnat.shon fresh bring-up).