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

All specification of ResourceTypes when deploying stack #4314

Closed
2 tasks
damonmaria opened this issue Oct 1, 2019 · 7 comments
Closed
2 tasks

All specification of ResourceTypes when deploying stack #4314

damonmaria opened this issue Oct 1, 2019 · 7 comments
Labels
@aws-cdk/aws-iam Related to AWS Identity and Access Management closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2

Comments

@damonmaria
Copy link

When deploying a stack with the SDK or aws CLI it's possible to specify ResourceTypes so that IAM users can be restricted to deploying stacks with only certain resources inside them. As far I can can tell this is not possible with the CDK.

Use Case

I want to restrict certain users to only be able to manage HostedZone RecordSets through CloudFormation, as per AWS CloudFormation security best practices.

Proposed Solution

I can see this being implemented in one of a few different ways:

  1. CLI argument to cdk deploy like the aws cloudformation create-stack CLI
  2. Specifying the resource types on the Stack itself in code
  3. CDK automatically scanning the resource types in a stack and specifying that automatically as the resource types to CloudFormation

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@damonmaria damonmaria added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 1, 2019
@RomainMuller
Copy link
Contributor

What improvement does "automatically specifying the list of resource types" provide over allowing all? It feels like this would be a self-fulfilling prophecy, as the perimeter of what's allowed would automatically expand to fit everything that's used inside the CDK Application... Or am I missing something in what your request is?

@SomayaB SomayaB added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 1, 2019
@SomayaB
Copy link
Contributor

SomayaB commented Oct 1, 2019

What improvement does "automatically specifying the list of resource types" provide over allowing all? It feels like this would be a self-fulfilling prophecy, as the perimeter of what's allowed would automatically expand to fit everything that's used inside the CDK Application... Or am I missing something in what your request is?

@damonmaria

@SomayaB SomayaB added the @aws-cdk/aws-iam Related to AWS Identity and Access Management label Oct 1, 2019
@damonmaria
Copy link
Author

Hmmmm.... I was thinking the sole purpose of specifying the ResourceTypes would be so that they can be enforced in an IAM policy restricting the user/role executing the template. But I guess they could also be used if the author of the template and the executor of it are different, and the executor wanted to enforce that the author was restricted to certain resource types. So I agree, in that case #3 does not make sense.

@SomayaB SomayaB removed needs-triage This issue or PR still needs to be triaged. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Oct 1, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 10, 2019

Can you not restrict the deployment role's permissions to only be able to do Route53 things, if that's the only thing you want users to be able to do?

If we add the restriction in CDK code, people can always get around them. That does not seem a productive use of engineering effort.

@damonmaria
Copy link
Author

As per the AWS CloudFormation Security Best Practices I linked to above I would like to restrict it so that ops users in our master account using CDK (CloudFormation) can only manage stacks that deal solely with Route53 hosted zones. For different projects we add DNS records into a hosted zone that is managed in our master account. I don't want these users to be able to access any other more general stacks in that account. But to do this I need to be able to specify ResourceTypes to CloudFormation.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jan 23, 2020

As far as I can tell, the ResourceTypes parameter to CreateStack will select a subset of resources from the template to deploy.

@rix0rrr rix0rrr added the effort/large Large work item – several weeks of effort label Jan 23, 2020
@rix0rrr rix0rrr added the p2 label Aug 12, 2020
@rix0rrr rix0rrr removed their assignment Jun 3, 2021
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 3, 2022
@github-actions github-actions bot closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-iam Related to AWS Identity and Access Management closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

4 participants