Add --skip-default-filter flag to scan create command(AST-154378) - #1532
Merged
cx-atish-jadhav merged 23 commits intoAug 6, 2026
Conversation
Introduce a new --skip-default-filter flag to bypass the CLI's base include/exclude file filters. Changes: - Add flag constant and usage (internal/params/flags.go). - Wire the flag into scan create command and log when set (internal/commands/scan.go). - Extend compressFolder and related helpers to accept skipDefaultFilter and honor it when building include/exclude filters; callers updated accordingly. Also adjust unzip condition to preserve container-local-resolution behavior when skipping defaults. - Add unit tests covering filter behavior and zip compression permutations (internal/commands/scan_test.go). - Add integration tests to verify the flag path and log output (test/integration/scan_test.go). This preserves existing behavior by default and enables users to include files normally excluded by base filters (e.g., node_modules, binaries) when explicitly requested.
cx-atish-jadhav
requested review from
cx-anurag-dalke and
cx-umesh-waghode
as code owners
July 31, 2026 06:34
Introduce executeCommandWithTimeout in test/integration/util_command.go and update TestRunScaRealtimeScan in test/integration/scan_test.go to use it with a 15-minute timeout. This avoids flaky failures/timeouts during SCA resolver downloads by allowing longer execution time while preserving the existing error+output buffer behavior.
This reverts commit da1f4cd.
Move the SCA Realtime integration test out of the parallel test groups into a dedicated integration-sca-realtime job. The new job builds the binary, launches a Squid proxy, downloads ScaResolver, runs TestRunScaRealtimeScan with up to two retries, merges coverage with gocovmerge, and uploads coverage/log artifacts. Removed TestScaRealtime from the group run patterns and added the new job as a dependency of merge-coverage so its coverage is included in the final merge. This reduces resource contention and timeouts for the realtime SCA test.
Contributor
Security Policy Alert: Secret Policy ViolationThis workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch. Secret references detected:
To approve this workflow, please add the Note: The label must be added by someone other than the PR author (cx-atish-jadhav) or automation bots to ensure proper security review. After the label is added, you can re-run the blocked workflow to proceed. This workflow will be automatically approved once merged into the default branch. For more information, see StepSecurity's Secret Exfiltration Policy documentation. |
Address flaky SCA realtime failures by skipping the integration test and cleaning up CI. Add t.Skip to TestRunScaRealtimeScan to avoid "context deadline exceeded" failures. Remove the dedicated integration-sca-realtime job from .github/workflows/ci-tests.yml, reintroduce TestScaRealtime into the scan group run patterns, and update merge-coverage dependencies accordingly. Files changed: .github/workflows/ci-tests.yml, test/integration/scan_test.go.
Mark TestRunScaRealtimeScan as skipped in integration tests due to repeated "context deadline exceeded" failures. Adds a t.Skip call in test/integration/scan_test.go to avoid unstable test runs while root cause is investigated.
Correct a malformed t.Skip invocation in test/integration/scan_test.go. Replaced the invalid `t.Skip( args ...; "..." )` syntax with a proper `t.Skip("Skip this test cases due to context deadline exceeded")` and kept the args assignment after the skip. Prevents a syntax error during build/tests.
Add Trivy ignore entry for CVE-2026-58055 (libnghttp2) with context notes: affects libnghttp2-14 v1.69.0-r0 in base image checkmarx/bash:5.3-r12, fixed in libnghttp2-14 >= 1.70.0-r0. Notes include risk (MEDIUM), impact (awaiting base image patch), tracking ticket AST-166372, and expiry date exp:2027-02-28.
…iner engine)- #1528 #1528 (#1531) * AST-164154: Fix KICS agent-hook guardrail never scanning (empty container engine) The KICS file-edit guardrail passed an empty container engine name to RunIacRealtimeScan instead of "docker", causing engine resolution to always fail and the scan to silently fail open on every file edit. Now resolves the engine via CX_HOOKS_CONTAINER_ENGINE override, then PATH auto-detection (docker/podman), falling back to "docker". Also logs the swallowed scan errors via --debug so a future regression here is diagnosable instead of silently invisible. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Fix KICS guardrail to route Docker image findings to imageRemediation Dockerfile and docker-compose findings were sent through codeRemediation like any other IaC misconfiguration, but they need imageRemediation for base-image CVEs/hardening. Route by KICS's own platform field on the finding (Dockerfile/DockerCompose), falling back to filename heuristics only when platform metadata is unavailable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix lint issue. --------- Co-authored-by: avisab-cx <53776974+cx-avi-sabzerou@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Introduce a new --skip-default-filter flag to bypass the CLI's base include/exclude file filters. Changes: - Add flag constant and usage (internal/params/flags.go). - Wire the flag into scan create command and log when set (internal/commands/scan.go). - Extend compressFolder and related helpers to accept skipDefaultFilter and honor it when building include/exclude filters; callers updated accordingly. Also adjust unzip condition to preserve container-local-resolution behavior when skipping defaults. - Add unit tests covering filter behavior and zip compression permutations (internal/commands/scan_test.go). - Add integration tests to verify the flag path and log output (test/integration/scan_test.go). This preserves existing behavior by default and enables users to include files normally excluded by base filters (e.g., node_modules, binaries) when explicitly requested.
Introduce executeCommandWithTimeout in test/integration/util_command.go and update TestRunScaRealtimeScan in test/integration/scan_test.go to use it with a 15-minute timeout. This avoids flaky failures/timeouts during SCA resolver downloads by allowing longer execution time while preserving the existing error+output buffer behavior.
This reverts commit da1f4cd.
Move the SCA Realtime integration test out of the parallel test groups into a dedicated integration-sca-realtime job. The new job builds the binary, launches a Squid proxy, downloads ScaResolver, runs TestRunScaRealtimeScan with up to two retries, merges coverage with gocovmerge, and uploads coverage/log artifacts. Removed TestScaRealtime from the group run patterns and added the new job as a dependency of merge-coverage so its coverage is included in the final merge. This reduces resource contention and timeouts for the realtime SCA test.
Address flaky SCA realtime failures by skipping the integration test and cleaning up CI. Add t.Skip to TestRunScaRealtimeScan to avoid "context deadline exceeded" failures. Remove the dedicated integration-sca-realtime job from .github/workflows/ci-tests.yml, reintroduce TestScaRealtime into the scan group run patterns, and update merge-coverage dependencies accordingly. Files changed: .github/workflows/ci-tests.yml, test/integration/scan_test.go.
Mark TestRunScaRealtimeScan as skipped in integration tests due to repeated "context deadline exceeded" failures. Adds a t.Skip call in test/integration/scan_test.go to avoid unstable test runs while root cause is investigated.
Correct a malformed t.Skip invocation in test/integration/scan_test.go. Replaced the invalid `t.Skip( args ...; "..." )` syntax with a proper `t.Skip("Skip this test cases due to context deadline exceeded")` and kept the args assignment after the skip. Prevents a syntax error during build/tests.
Add Trivy ignore entry for CVE-2026-58055 (libnghttp2) with context notes: affects libnghttp2-14 v1.69.0-r0 in base image checkmarx/bash:5.3-r12, fixed in libnghttp2-14 >= 1.70.0-r0. Notes include risk (MEDIUM), impact (awaiting base image patch), tracking ticket AST-166372, and expiry date exp:2027-02-28.
…/Checkmarx/ast-cli into bug/AST-154378-skipDefaultFilter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a new --skip-default-filter flag to bypass the CLI's base include/exclude file filters. Changes:
This preserves existing behavior by default and enables users to include files normally excluded by base filters (e.g., node_modules, binaries) when explicitly requested.
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
Introduce --skip-default-filter flag for cx scan create command to skip applying default base-included and base-excluded file filters. When this flag is NOT passed, the command behaves exactly as today (backward compatible). When passed, only user-provided filters apply — no base filters are appended.
Type of Change
Related Issues
Link any related issues or tickets.
Checklist
Screenshots (if applicable)
Add screenshots to help explain your changes.
Additional Notes
Add any other relevant information.