Skip to content

fix: iac-security-filter flag ignoring passed parameters (AST-145741)#1471

Open
cx-goncalo-lemos wants to merge 2 commits intoCheckmarx:mainfrom
cx-goncalo-lemos:fix/AST-145741
Open

fix: iac-security-filter flag ignoring passed parameters (AST-145741)#1471
cx-goncalo-lemos wants to merge 2 commits intoCheckmarx:mainfrom
cx-goncalo-lemos:fix/AST-145741

Conversation

@cx-goncalo-lemos
Copy link
Copy Markdown

@cx-goncalo-lemos cx-goncalo-lemos commented Apr 9, 2026

By submitting this pull request, you agree to the terms within the Checkmarx Code of Conduct. Please review the contributing guidelines for guidance on creating high-quality pull requests.

Description

Flag --iac-security-filter (and its deprecated alias --kics-filter) was registered as a String flag in internal/commands/scan.go, but deprecatedFlagValue() reads it using GetStringSlice. This silently returns an empty slice, causing the filter value to be dropped and never sent to the API. As a result, the filter had no effect and files that should have been excluded were still scanned.

Fixed by registering both flags as StringSlice, consistent with how --iac-security-platforms / --kics-platforms are registered.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Related Issues

Link any related issues or tickets.

https://checkmarx.atlassian.net/browse/AST-144685

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the CLI help for new/changed functionality in this PR (if applicable)
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used

Screenshots (if applicable)

Add screenshots to help explain your changes.

Additional Notes

Add any other relevant information.

@cx-goncalo-lemos cx-goncalo-lemos changed the title fix: iac-security-filter flag ignoring passed parameters fix: iac-security-filter flag ignoring passed parameters (AST-145741) Apr 9, 2026
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.

1 participant