Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-11409] prevent managed user from leaving managing organization #4995

Merged

Conversation

BTreston
Copy link
Contributor

@BTreston BTreston commented Nov 7, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11409

📔 Objective

This PR implements a server side check to ensure that users that are managed by the org they may be attempting to leave will throw BadRequestException.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@BTreston BTreston requested a review from a team as a code owner November 7, 2024 16:18
@BTreston BTreston requested a review from jrmccannon November 7, 2024 16:18
@BTreston BTreston requested a review from jrmccannon November 7, 2024 16:42
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.53%. Comparing base (b5014ed) to head (d1edb5e).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4995   +/-   ##
=======================================
  Coverage   42.53%   42.53%           
=======================================
  Files        1391     1391           
  Lines       64816    64825    +9     
  Branches     5949     5950    +1     
=======================================
+ Hits        27567    27571    +4     
- Misses      36024    36029    +5     
  Partials     1225     1225           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Logo
Checkmarx One – Scan Summary & Details5fe16fb9-0a99-4698-8d52-651cfebef44c

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 603 Attack Vector
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 603 Attack Vector
LOW Unpinned Actions Full Length Commit SHA /build.yml: 651 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 227 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /build.yml: 568 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 606
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 530
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 563
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 597
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 646
MEDIUM Unpinned Actions Full Length Commit SHA /build.yml: 218
LOW Unpinned Actions Full Length Commit SHA /build.yml: 218
LOW Unpinned Actions Full Length Commit SHA /build.yml: 563
LOW Unpinned Actions Full Length Commit SHA /build.yml: 646
LOW Unpinned Actions Full Length Commit SHA /build.yml: 530
LOW Unpinned Actions Full Length Commit SHA /build.yml: 597

@BTreston BTreston merged commit 15bc506 into main Nov 7, 2024
52 checks passed
@BTreston BTreston deleted the ac/pm-11409-prevent-managed-user-from-leaving-organization branch November 7, 2024 19:10
cyprain-okeke pushed a commit that referenced this pull request Nov 12, 2024
…4995)

* prevent managed user from leaving managing organization

* fix org check to be specific to single org

* simplify logic
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
…itwarden#4995)

* prevent managed user from leaving managing organization

* fix org check to be specific to single org

* simplify logic
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
…itwarden#4995)

* prevent managed user from leaving managing organization

* fix org check to be specific to single org

* simplify logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants