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

[Gh 884] IAM policy splitting for requestor IAM policies #1650

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

Conversation

TejasRGitHub
Copy link
Contributor

@TejasRGitHub TejasRGitHub commented Oct 17, 2024

Feature or Bugfix

  • Feature

Detail

  • Updates the process of modifying the IAM policies after approve / revoke to add / delete resources and also split the policies into chunks
  • Updates the managed IAM policies to have indexes at the end
  • Contains backward compatibility and other additional checks to make sure correct policies are created and older policies are deleted
  • Contains a UI update to address this issue - Consumer roles list page is very slow #1459

Relates

Tests

  • Inviting / removing team to an environment ✅
  • Adding/ Removing consumption role to an environment ✅
  • Creating / revoking a share with consumption role for S3 bucket with bucketpolicy sharing ✅
  • Creating / revoking a share with environment team for S3 bucket with bucketpolicy sharing ✅
  • Creating / revoking a share with consumption role for S3 access point ✅
  • Creating / revoking a share with environment team for S3 access point ✅
  • Creating a share with requestors IAM policy being on the brink of policy length limits and checking if new indexed policy is getting created ✅
  • Revoking a share with requestors IAM policy being on the brink of policy length limits and checking if extra policies are deleted ✅
  • Checking if all consumption roles are loaded quickly on the environment teams UI asynchronously ✅
  • Check if requestor’s receive emails when an IAM role is about to reach the managed policy attachment limit ( Email Notification Changes )
  • Migrating Shares from old to new policy management. via share validator and share verifier ( Share verifier successfully mentions error message and Share re-applier successfully converts policies to indexed managed policies ) ✅
  • Creating new environment and deleting an environment ✅

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)? No
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization? No
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features? No
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?No
  • Are you introducing any new policies/roles/users? yes
    • Have you used the least-privilege principle? How? yes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@anushka-singh
Copy link
Contributor

Can we fix the integration tests? Why are they failing?

@dlpzx dlpzx self-requested a review October 22, 2024 08:30
Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

Hi @TejasRGitHub thanks for the contribution! I reviewed the IAM chunking with the new utilities and left some easy-fix comments. I stopped after reviewing the the ManagedPolicy interface as it requires some re-work that could affect the rest of the implementation.

@TejasRGitHub TejasRGitHub changed the title [Gh 884] IAM policy splitting for requestor IAM policues [Gh 884] IAM policy splitting for requestor IAM policies Oct 24, 2024
Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

Hi @TejasRGitHub thank you for the changes, it is way more in shape :) I added some additional comments with suggestions and improvements. I am also going to request you to 1) fix the failing integration tests and 2) list in the PR description the testing that you have done to ensure this PR is not introducing any error. include all testing scenarios: approve-verify-revoke new share, approve-verify-revoke old share, upgrade an old share....

@TejasRGitHub
Copy link
Contributor Author

@dlpzx , I have updated the PR and replied to your comments where I thought more discussion is needed.

I have updated the tests that I had done while submitting the PR. I will perform those tests once the PR is ready for merging.
Also, I will fix all the integration test which are failing once the PR is in good shape.

Thanks Again for taking the time to review and providing your insightful review comments

Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

Left one ultra minor change comment about the exceptions name; but other than that the rest looks good! The only missing thing before approve are the integration tests.

Thank you for the great work @TejasRGitHub

@TejasRGitHub
Copy link
Contributor Author

Hi @dlpzx , I have updated the PR and fixed unit tests. ✅ . Also , I have tested the code with the test cases ( as described in the PR details section ).
I have updated the PR with a few code changes - for some fixes I found during testing - and also refactored code to simplify.
Can you please take a look at the latest changes and let me know if this PR still looks good

Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

Left some minor changes!

Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

It is reeaady! Thank you @TejasRGitHub 🚀

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.

3 participants