Repository navigation
Enforce access rules for organisations, invites, members, and references - #169
Merged
Merged
Conversation
docs/audit/ is ignored by git. The repository is public, and audit reports can describe weaknesses that are not fixed yet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Remove the unchecked organisation delete event and context function. Deleting an organisation goes through delete_org_by_id!/2 only. - Do not cast risk_id of a mitigation from parameters. - Check that the system and the asset of a threat belong to the threat's organisation. - List and accept invites only for users with a confirmed email address. - Replace delete_invite/1 by reject_invite/2 (invitee) and revoke_invite/2 (right :invite_new_members). - Check :delete_member with the membership rights when a member is removed, and handle a refusal in the members page. Adds regression tests for each rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Closes gaps in the access rules that an internal review found. Each rule now has a regression test.
deleteevent on the organisations page and the context function behind it. Deleting an organisation goes only throughOrganisations.delete_org_by_id!/2, which checks the:delete_organisationright.risk_idis no longer cast from parameters, so a mitigation stays in its risk.create_threat/3andupdate_threat/3check that the system and the asset belong to the threat's organisation.delete_invite/1is replaced byreject_invite/2(only the invitee) andrevoke_invite/2(needs the right:invite_new_members).:delete_member). Before, the check used the platformRBACmodule and always failed.Changes in behaviour
/organisations. The page shows a notice with a link to send the confirmation email again. Registration through an invite link is unchanged.Also in this branch
docs/audit/is ignored by git, anddocs/README.mdsays so.Tests
mix test: 154 tests, 0 failures (139 before, 15 new). Run with Elixir 1.20.4 and PostgreSQL 18.Not included
The four new user messages are not added to
priv/gettext. An extraction would also change many unrelated entries, because the files are out of date. The English text is shown as fallback.🤖 Generated with Claude Code