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(cli): fix security related changes integ test #8274

Merged
merged 2 commits into from
Jun 2, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented May 29, 2020

The test was passing because (1) the stack contained an incorrect service principal
and (2) --require-approval was set to never by default. This means that the stack
was actually deployed but failed, making the test pass.

Corrected the service principal, added an expectation to ensure that the stack
did not deploy and removed the --require-approval CLI option during this test.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

The test was passing because (1) the stack contained an incorrect service principal
and (2) `--require-approval` was set to `never` by default. This means that the stack
was actually deployed but failed, making the test pass.

Corrected the service principal, added an expectation to ensure that the stack
did not deploy and removed the `--require-approval` CLI option during this test.
@jogold
Copy link
Contributor Author

jogold commented May 29, 2020

@rix0rrr noticed this while doing #8275

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 99a7688
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

great catch! I really appreciate the detailed commit body outlining why this test was succeeding despite the conditions not being met and mitigating it.

@@ -39,6 +39,7 @@ export interface ShellOptions extends child_process.SpawnOptions {

export interface CdkCliOptions extends ShellOptions {
options?: string[];
neverRequireApproval?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer if we could avoid the negation in the name (i.e. prefer requireApproval).
In this case its closely tied to the flag we want to set so I don't mind it

@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 2ee083a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 171b039 into aws:master Jun 2, 2020
mergify bot pushed a commit that referenced this pull request Jun 2, 2020
following on from #8274 where a broken integ test that never ran was fixed.
A different test for the IAM diff was verifying previously incorrect service
principal and we missed updating the expectation.

This fixes up the expectations to align to the changes made in #8274 and
uses the corrected service principal (ec2.amazonaws.com).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@jogold jogold deleted the cli-integ-security-changes branch June 10, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants