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

chore(cdk greenfield support): Changes to support greenfield account restrictions present in higher environments #700

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

mdial89f
Copy link
Contributor

@mdial89f mdial89f commented Aug 2, 2024

Purpose

In higher environments, iam path and permissions boundary is enforced on our users and service roles. This required modifying the cdk tool kit bootstrapping process, as well as adding config to our application.

Linked Issues to Close

None

Approach

The CDK is bootstrapped with a template that accounts for iam path and permissions boundary. The roles generated are then passed in the synthesizer config. Finally, two cdk aspects ensure all iam objects built by our application have the path and permissionsboundary set.

Assorted Notes/Considerations/Learning

A procedure on bootstrapping cdk is warranted, and will come along a bit later.

@mdial89f
Copy link
Contributor Author

mdial89f commented Aug 2, 2024

also note, the clamscan dependency at the top level can probably be removed. thats unrelated but i noticed it

Copy link
Contributor

github-actions bot commented Aug 2, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 52.45% 4097 / 7810
🔵 Statements 52.29% 4313 / 8248
🔵 Functions 45.66% 943 / 2065
🔵 Branches 26.56% 787 / 2962
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
lib/local-aspects/iam-path/index.ts 0% 0% 0% 0% 10, 14-16, 15, 18-20, 19, 22-24, 23
lib/local-aspects/iam-permissions-boundary/index.ts 0% 0% 0% 0% 10, 14-19, 15-18
lib/packages/shared-utils/cdk-type-guards.ts 0% 100% 0% 0% 4, 8, 12
lib/stacks/deployment-config.test.ts 94.23% 81.25% 100% 94.11% 62, 71, 118
lib/stacks/deployment-config.ts 96.66% 93.33% 100% 96.66% 115-117
Generated in workflow #34

Copy link
Collaborator

@asharonbaltazar asharonbaltazar left a comment

Choose a reason for hiding this comment

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

Not an AWS powerhouse, but LGTM

package.json Outdated Show resolved Hide resolved
lib/local-aspects/iam-path/index.ts Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Aug 2, 2024

Code Climate has analyzed commit c89a0d8 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 0.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 52.4% (-0.1% change).

View more on Code Climate.

Copy link
Collaborator

@13bfrancis 13bfrancis left a comment

Choose a reason for hiding this comment

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

ship it


public visit(node: IConstruct): void {
if (node instanceof iam.Role && isCfnRole(node.node.defaultChild)) {
node.node.defaultChild?.addPropertyOverride("Path", this.iamPath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just noticed this ?. The other ones don't have it so I'm assuming you forgot this one?

Copy link
Contributor

github-actions bot commented Aug 5, 2024

🎉 This PR is included in version 1.5.0-val.69 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants