amplify-backend
amplify-backend copied to clipboard
Check IAM policies for new access
Problem
Currently, we rely on PR reviews and unit tests to manage IAM policies.
This PR introduces a new mechanism that detects and flags elevation of privilege. The new check's intention is to drew reviewers and maintainers attention when IAM policies get more permissive. This is to increase a chance that accidental policy change is caught in review process.
Issue number, if available:
Changes
This check is adding new e2e test type.
The algorithm is:
- Find the baseline version of repository
- Which is base branch for PRs for pull request events
- Previous commit for push events
- Checkout, build and stash somewhere in filesystem the baseline version of repo
- Vend packages from baseline version
- Execute create amplify and deploy flow with baseline version
- Read all policies from deployed stacks
- Vend packages from current version
- Reinstall dependencies for sample app created in previous steps
- Redeploy the app
- Read all policies from deployed stacks
- Match and compare policies
- Report any access elevation and if present fail the check.
Corresponding docs PR, if applicable:
Validation
Checklist
- [ ] If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
- [ ] If this PR requires a change to the Project Architecture README, I have included that update in this PR.
- [ ] If this PR requires a docs update, I have linked to that docs PR above.
- [ ] If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the
run-e2elabel set.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
🦋 Changeset detected
Latest commit: 2caca9cba6a98c550b5ad8a46f1f72caeeb9761a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 0 packages
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR