How to enforce standards and controls when using CDK Pipeline

有些话、适合烂在心里 提交于 2021-01-28 11:24:58

问题


CDK Pipelines is great, specially for cross-account deployments. It enables the developers to define and customize the CI/CD pipeline for their app to their heart's content.

But to remain SoC compliant, we need to make sure that necessary controls like below are validated/enforced

  1. A manual approval stage should be present before the stage that does the cross-account deployment to production
  2. Direct deployment to production bypassing dev/staging environment is not allowed
  3. Test cases (Unit tests/Integration tests) and InfoSec tests should pass before deployment

I know that above things are straightforward to implement in CDK Pipelines but I am not quite sure about how to ensure that every CDK Pipeline always conforms to these standards.

I can think of below solutions

  • Branch restrictions - Merge to master branch (which the CDK pipeline monitors) should be restricted and allowed only via pull requests
  • Tests - Add unit tests or integration tests which validate that the generated cloud formation template has specific resources/properties
  • Create a standard production stage with all necessary controls defined and wrap it in a library which developers need to use in their definition of the CDK Pipeline if the want to deploy to production

But how to enforce above controls in an automated fashion? Developers can choose to bypass above controls by simply not specifying them while defining the pipeline. And we do not want to rely on an Approver to check these things manually.

So in summary, the question is - When using CDK pipelines, how to give developers maximum customizability and freedom in designing their CI/CD solution while ensuring that SoC restrictions and mandatory controls are validated and enforced in an automated fashion?

来源:https://stackoverflow.com/questions/65773331/how-to-enforce-standards-and-controls-when-using-cdk-pipeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!