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-14378] SecurityTask Authorization Handler #5039

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

shane-melton
Copy link
Member

@shane-melton shane-melton commented Nov 15, 2024

🎟️ Tracking

PM-14378

📔 Objective

Implement the SecurityTask authorization handlers with initial operations.

Adds a new CipherOrganizationPermissions_GetManyByOraganizationId query to list all ciphers and their permissions for a given user and organization. Used by the security task handler to determine if a user has access to a security task for a given operation.

⏰ 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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ A sproc to list the permission for a particular user for every cipher belonging to a specific organization

Copy link
Contributor

github-actions bot commented Nov 15, 2024

Logo
Checkmarx One – Scan Summary & Detailsa30e662a-ec2e-4661-9d68-73439fd3e35c

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Billing/Controllers/PayPalController.cs: 66 Attack Vector
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/AdminConsole/DomainClaimedByOrganization.html.hbs: 5 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 70
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationsController.cs: 52
MEDIUM CSRF /src/Billing/Controllers/RecoveryController.cs: 38
MEDIUM CSRF /src/Billing/Controllers/StripeController.cs: 164
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 470
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 91

@shane-melton shane-melton force-pushed the vault/pm-14378/security-task-auth-handler branch 2 times, most recently from 6a63d18 to 4e63af4 Compare December 6, 2024 01:02
@shane-melton shane-melton force-pushed the vault/pm-14378/security-task-auth-handler branch from 4e63af4 to df3e424 Compare December 6, 2024 01:03
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 56.71642% with 116 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@7637cbe). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ries/Queries/CipherOrganizationPermissionsQuery.cs 0.00% 50 Missing ⚠️
...tyFramework/Vault/Repositories/CipherRepository.cs 0.00% 38 Missing ⚠️
.../SecurityTasks/SecurityTaskAuthorizationHandler.cs 85.33% 5 Missing and 6 partials ⚠️
...ture.Dapper/Vault/Repositories/CipherRepository.cs 0.00% 9 Missing ⚠️
.../Vault/Queries/GetCipherPermissionsForUserQuery.cs 92.59% 2 Missing and 2 partials ⚠️
...ks/SecurityTaskOrganizationAuthorizationHandler.cs 87.50% 1 Missing and 2 partials ⚠️
.../Vault/Models/Data/OrganizationCipherPermission.cs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5039   +/-   ##
=======================================
  Coverage        ?   43.23%           
=======================================
  Files           ?     1457           
  Lines           ?    66507           
  Branches        ?     6099           
=======================================
  Hits            ?    28753           
  Misses          ?    36458           
  Partials        ?     1296           

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

@shane-melton shane-melton marked this pull request as ready for review December 12, 2024 00:50
@shane-melton shane-melton requested review from a team as code owners December 12, 2024 00:50
Copy link
Member

@gbubemismith gbubemismith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good. Just one question before I approve

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

gbubemismith
gbubemismith previously approved these changes Dec 13, 2024
@shane-melton shane-melton requested a review from rkac-bw December 13, 2024 19:26
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