aws / aws-proton-public-roadmap

This is the public roadmap for AWS Proton
https://aws.amazon.com/proton
Other
199 stars 13 forks source link

[Request]: Integrate proton with cfn guard #43

Open pgdad opened 3 years ago

pgdad commented 3 years ago

Community Note

Tell us about your request

I would like to be able to configure proton such that cloudformation guard configuration of my specification is applied to a template prior to provisioning the template. In the case where the guard discovers policy violations the template should not be provisioned and reasonable explanation (cfn guard output?) should be supplied to the user.

What do you want us to build?

There should be an optional configuration for each environment and service template of cfn guard rule set. The rule set execution/checking should be automatically performed by a lambda provided by the proton service. In cases where newer implementations of the 'lambda performing the execution' are available, it selection of such version should be configurable. Default value for such configuration should be 'latest'. (Initially the 'latest' choice could be the only, and implicit, option. We might not ever have to provide other options.).

cfn rule sets should be obtained from s3 or as part of the proton configuration (inline). This should be configurable for each environment service template, and should be versioned. Meaning that different versions, for example, of service templates, should be able to be configured with a different rule set.

Changes to the rule sets should have their own IAM permissions. (proton:PutRuleSet, with appropriate condition keys. Condition keys should allow resource tags and perhaps others).

Rule Sets should be shareable and enforceable across accounts. (Shared access to 'centrally' available s3 bucket likely suffices.)

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

Larger enterprises in regulated industries would greatly benefit from 'policy as code' for their infra structure.

What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now? What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem.

cfn guard is an excellent idea, no aws provided cloudformation related (cfn, cdk or service catalog) currently has an 'enforced by the service/system' way to enforce cfn guard use.

This enforcement can not, in a regulated industry, be left to a CI/CD pipeline that can be altered by developers. (there are other potential ways to solve for this requirement, for example AWS could build this kind of a facility within the cloudformation service)

Are you currently working around this issue? How are you currently solving this problem?

We are not. We primarily use Service Catalog and Terraform Sentinel policies. Service Catalog has 'limited support' for controlling what kind of resources can be provisioned via 'launch templates'. But this is not sufficient, and in particular Service Catalog has other limitations (if Service Catalog allowed cdk synth to generate template 'on the fly' it would be much more useful, but would also require/benefit from cfn guard integration) Terraform Sentinel policies, in their current implementation, are not scalable, and get really difficult to read/understand as the policies grow to fulfill enterprise needs. Additionally, Terraform is not a 'native aws' service.

pgdad commented 3 years ago

Additionally proton environment and service template creation API call IAM permissions should be such that they can be configured with 'this api call, when called, must include "cfn guard Rule Set restriction"' similar to what is possible with IAM role creation with enforced permissions boundary use as part of the IAM role creation. (iam:CreateRole has a condition key iam:PermissionsBoundary, proton should have similar for enforcement of cfn guard rule set use)

rafavallina commented 3 years ago

@pgdad Thanks for opening an issue! I'm going to triage it to "researching" so it can be +1'd by others. This aligns with some of our longer-term ideas for the service, and I'd like to work on this direction - we have some critical priorities to deliver, but we can continue gathering input and researching in the meantime.

Let me ask a bit more: in the current implementation of Proton, the Proton template is fully written by the Platform team, and the development team only has access to whatever parameters are made available to them. So what would be the use case for CFN guard here? Would it be used to make sure that the Proton template writers are meeting certain rules?

I'm seeing to use cases for this as of now: (1) Policy teams can make sure that the infrastructure meets the enterprise requirements; (2) Platform teams can make sure that they don't mistakenly skip their own rules

Are there any other examples?

pgdad commented 3 years ago

My use case is that of 'provide evidence that our set of policies have been enforced'. This is a basic requiment for both 'platform' and 'application teams'.

In an idea case (skipping proton for a while) cfn would have a configuration, permissions model that would allow a principal's stack creation to be restricted such than a stack can only be provisioned if it passes a test. The test execution (all relevant details) should be logged (aws provides multiple methods how this could be implemented, cloudwatch, s3, ...). An enforcement of such a test could be implemented by adding a condition key to cloudformation:CreateStack IAM permission, similar to IAM role creation with 'enforce permissions boundaries'. The 'test' could be defined as 'customer provided lambda arn', meaning that the 'final' cfn template would be subject to test (with 'passing response') executed by a lambda that the customer provides. Likely substantial group of customers would want to use a 'cfn guard' lambda for that purpose, so it would be nice if WAS just provided such a lambda, where the input would simply be cfn guard ruleset. (or a number of such rules sets, perhaps with and/or logic to combine them)

Cloudformation is the correct place to implement the above.

I am now assuming that such a cloudformation implementation is long ways off (or not even considered), given that all of the above would be implementable in the context of proton.

My (imagined at this point) favorite way to use proton would be for proton to do 'cdk synth', then the resulting template would be (configurable) subject to a 'policy test lambda', and only if it passes, would it be provisioned.

Same concepts would apply to terraform templates. If you guys are really smart, you will provide such functionality for 'open source' terraform, so that a user would not have to pay for terraform enterprise to gain support for policy based infrastructure 'insurance'.

Now to your more direct question(s). (using cfn guard, in place of a more generic 'policy checking configurable lambda')

First and foremost, the 'platform team' would provide a template, that template would have to inspected by cfn guard. That is the easy part. If we have a situation where the 'platform team' provides a proton environment configuration that allows execution of a cdk application (with some mechanism for passing parameters), then the template produced by cdk synth would have to also pass cfn guard.

BTW, cdk synth should not be the only method of generating a template, why not a random program, or a customer provided container, with some convention on how to invoke it. Similar to the container based lambda runtimes that are now available.

Like the other email that I just sent, I would be more than willing to have a TAM facilitated discussion. Over the years I have learned a bit about 'missing enterprise features' of services such as cfn and service catalog.


From: Rafael Alvarez notifications@github.com Sent: Monday, March 8, 2021 8:38 PM To: aws/aws-proton-public-roadmap aws-proton-public-roadmap@noreply.github.com Cc: pgdad pgdad@hotmail.com; Mention mention@noreply.github.com Subject: Re: [aws/aws-proton-public-roadmap] [Request]: Integrate proton with cfn guard (#43)

@pgdadhttps://github.com/pgdad Thanks for opening an issue! I'm going to triage it to "researching" so it can be +1'd by others. This aligns with some of our longer-term ideas for the service, and I'd like to work on this direction - we have some critical priorities to deliver, but we can continue gathering input and researching in the meantime.

Let me ask a bit more: in the current implementation of Proton, the Proton template is fully written by the Platform team, and the development team only has access to whatever parameters are made available to them. So what would be the use case for CFN guard here? Would it be used to make sure that the Proton template writers are meeting certain rules?

I'm seeing to use cases for this as of now: (1) Policy teams can make sure that the infrastructure meets the enterprise requirements; (2) Platform teams can make sure that they don't mistakenly skip their own rules

Are there any other examples?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/aws/aws-proton-public-roadmap/issues/43#issuecomment-793248643, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFL5D7WSQJLADGCKEKNM3LTCV3ZFANCNFSM4YWUURFA.

tatcoo commented 1 year ago

Hi @pgdad - does your offer to have a TAM-facilitated discussion on this still stand? We've got a feature coming out soon that will help unlock some of this functionality and we'd like to get your input. To others following, stay tuned for additional design discussion here -> https://github.com/aws/aws-proton-public-roadmap/issues/67

pgdad commented 1 year ago

No since I now work at AWS... Happy to try to answer any questions though.

laineesa

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: tatcoo @.> Sent: Thursday, August 11, 2022 4:39:17 PM To: aws/aws-proton-public-roadmap @.> Cc: pgdad @.>; Mention @.> Subject: Re: [aws/aws-proton-public-roadmap] [Request]: Integrate proton with cfn guard (#43)

Hi @pgdadhttps://github.com/pgdad - does your offer to have a TAM-facilitated discussion on this still stand? We've got a feature coming out soon that will help unlock some of this functionality and we'd like to get your input. To others following, stay tuned for additional design discussion here -> #67https://github.com/aws/aws-proton-public-roadmap/issues/67

— Reply to this email directly, view it on GitHubhttps://github.com/aws/aws-proton-public-roadmap/issues/43#issuecomment-1212470757, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFL5D7MIBXIOY6HJZL5VPTVYVQHLANCNFSM4YWUURFA. You are receiving this because you were mentioned.Message ID: @.***>