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

feat(misconf): Add support for --cf-params for CFT #5507

Merged
merged 33 commits into from
Nov 15, 2023
Merged

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Nov 2, 2023

Description

Adds the support to pass in Cloudformation template files via --cf-params flag, similar to -tf-vars

Related issues

Required stacked PRs for release (this PR will be merged into the following PR)

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@simar7 simar7 self-assigned this Nov 2, 2023
@simar7 simar7 changed the title feat(misconf): Add support for --cf-params for CFT feat(misconf): Add support for --cf-params for CFT Nov 2, 2023
@simar7 simar7 requested a review from nikpivkin November 2, 2023 04:12
@simar7 simar7 marked this pull request as ready for review November 2, 2023 04:59
@simar7 simar7 requested a review from knqyf263 as a code owner November 2, 2023 04:59
pkg/misconf/scanner.go Outdated Show resolved Hide resolved
pkg/flag/misconf_flags.go Outdated Show resolved Hide resolved
docs/docs/coverage/iac/cloudformation.md Show resolved Hide resolved
pkg/flag/misconf_flags.go Show resolved Hide resolved
Base automatically changed from defsec-refactor-update to main November 9, 2023 02:48
pkg/misconf/scanner.go Outdated Show resolved Hide resolved
@simar7
Copy link
Member Author

simar7 commented Nov 14, 2023

@knqyf263 could you take a look at reviewing it?

Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

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

Looks great! I left small comments.

docs/docs/coverage/iac/cloudformation.md Outdated Show resolved Hide resolved
docs/docs/references/configuration/cli/trivy_image.md Outdated Show resolved Hide resolved
docs/docs/references/configuration/cli/trivy_kubernetes.md Outdated Show resolved Hide resolved
docs/docs/references/configuration/cli/trivy_vm.md Outdated Show resolved Hide resolved
@@ -55,6 +55,12 @@ var (
Default: []string{},
Usage: "specify paths to override the Terraform tfvars files",
}
CfParamsFlag = Flag{
Name: "cf-params",
ConfigName: "misconfiguration.cloudformation.vars",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: cloudformation.vars is a bit different from the CLI flag. Is it intended? cloudformation.params seems more aligned.

Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd defer to @nikpivkin. He recently spent more time on misconfiguration scanning than me.

Copy link
Contributor

@nikpivkin nikpivkin left a comment

Choose a reason for hiding this comment

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

LGTM

@knqyf263 knqyf263 added this pull request to the merge queue Nov 15, 2023
Merged via the queue into main with commit e3c28f8 Nov 15, 2023
22 checks passed
@knqyf263 knqyf263 deleted the support-cf-params-2 branch November 15, 2023 07:47
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.

feat(misconf): Support passing in of cloudformation template parameters
3 participants