Skip to content

Extended Manifest Parser Support(AST-146208) - #1534

Open
cx-atish-jadhav wants to merge 29 commits into
other/release_2_3_59from
other/release-manifest-parser
Open

Extended Manifest Parser Support(AST-146208)#1534
cx-atish-jadhav wants to merge 29 commits into
other/release_2_3_59from
other/release-manifest-parser

Conversation

@cx-atish-jadhav

Copy link
Copy Markdown
Contributor

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

Please provide a summary of the changes and the related issue. Include relevant motivation and context.

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.

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-anurag-dalke and others added 28 commits July 24, 2026 13:00
Remove the multi-mode session subsystem added in d3b436c (AST-160121)

and return credential storage to the pre-2.3.54 single cx_apikey slot.

Drop --session local/global/yaml; login/logout use cx_apikey only

Remove session_global, active_mode, shell_output, LoadActiveCredential

startup hook (cmd/main.go + MCP bridge)

Remove login-time revoke/nuke phase and logout server-side revoke

Replace OIDC .well-known discovery with realm-derived endpoints

Add configuration.PromptAuthConnection() interactive fallback

Update MCP degraded notice to drop --session references
…ml fallback

Persist the CLI's long-lived secrets (cx_apikey refresh token, cx_client_secret)

in the OS secret store — macOS Keychain, Windows Credential Manager, Linux Secret

Service — via github.com/zalando/go-keyring, instead of plaintext in

~/.checkmarx/checkmarxcli.yaml. Falls back transparently to the yaml file when no

keyring is available (headless Linux without D-Bus, WSL, locked keychain).

New internal/wrappers/credentialstore package: a CredentialStore interface

(Get/Set/DeleteSecret by viper key) with three implementations — keyringStore

(go-keyring, service "checkmarx-cli"), fileStore (yaml config), and chainStore

(keyring-first, yaml-fallback). A successful keyring write scrubs any plaintext

copy left in the yaml file. Default is file-backed until main() installs the

chain via Install(), which also wires configuration.Secrets so cx configure

routes through the same store.

The read path stays viper-based: LoadStoredSecrets copies stored secrets into

viper at startup so every wrapper resolves the credential unchanged, skipping

any key whose CX_* env var is set (env keeps precedence). configuration.go grows

a SecretStore hook plus setSecretQuiet/clearSecretQuiet so PromptConfiguration

writes secrets to the store and blanks their yaml keys.

Command wiring:

- auth login now stores the refresh token via credentialstore.Default

  (persistLogin replacing persistYamlLogin); chmod 0600 still applied in case it

  fell back to yaml.

- auth logout clears cx_apikey and cx_client_secret from both backends and blanks

  the non-secret cx_client_id best-effort; env credentials untouched.

- utils config set routes cx_apikey / cx_client_secret through SetSecretProperty.

- CheckPreferredCredentials re-asserts explicit --apikey / --client-secret flags

  over the viper-loaded stored value so a flag still wins.

- MCP bridge re-runs LoadStoredSecrets on config reload to pick up a rotated

  keyring token, keeping its 3s poll cheap.

Adds go-keyring to the depguard allowlist. No secret value is logged.
…oks & Fix Copilot CLI ASCA guardrail

Fix Copilot CLI ASCA guardrail: CRLF/LF mismatch and non-ASCII silent failure

Added normLF() in content.go to normalise CRLF/CR disk files against

LF-only old_str/new_str sent by Copilot CLI on Windows, gated on AgentCopilotCLI

Added asciiSafe() in stage.go to replace non-ASCII runes (e.g. EM dash in

Copilot-generated comments) with spaces before ASCA scan, gated on AgentCopilotCLI

Passed ev.Agent through ProposedContent() and stageForScan() to enable both fixes

Removed touchSessionFindingsMarker() and its marker file infrastructure to

avoid creating unnecessary files in ~/.checkmarx/

Restored TestAdditionalContext_EmitsProvenanceOptionalFlags and

TestAdditionalContext_FileNameWithPercent_NotMisformatted tests

Introduced McpReconnect function to provide tailored reconnect instructions for various agents.

Updated SCA and ASCA hooks to utilize agent-specific reconnect phrases instead of generic instructions.

Enhanced DenyMalicious and DenyVulnerable functions to include session ID and agent context in remediation messages.

Refactored CheckBashInstall and CheckManifestEdit methods to pass agent and session ID parameters for improved telemetry tracking.

Added unit tests to validate the new functionality and ensure proper behavior across different agents.
Introduce comprehensive file and directory filtering for scan uploads using Apache Ant-style glob patterns.

Changes:
- Add new internal/filtering package with Matcher interface and AntMatcher implementation
- Support ordered include/exclude rules with last-match-wins semantics
- Add --file-filter-ext CLI flag for specifying filter patterns
- Integrate ant-style filtering into scan compression workflow
- Support pattern features: *, **, ?, [abc], {a,b} with implicit depth anchoring
- Directory pruning optimization when no descendant can be re-included
- Comprehensive test coverage for matcher logic and edge cases

The matcher intelligently handles sub-tree pruning and respects negation rules to avoid incorrectly excluding files that may be explicitly included by later rules.
Enable OSS Realtime scanner to handle Swift ecosystem manifests and map CocoaPods/Carthage packages to the Swift package manager. Changes in internal/services/realtimeengine/ossrealtime/oss-realtime.go: add new pkg manager constants (cocoapods, carthage, swift); expand supported extensions and filenames (Podfile, Podfile.lock, Cartfile, Cartfile.resolved, Package.swift, .podspec.json handling, etc.); map cocoapods/carthage packages to swift in package map and request conversion.

Update go.mod/go.sum to use a local manifest-parser replacement for development: comment out the previous remote requirement, add a placeholder require entry and a replace pointing to C:/Users/AtishJ/GitHub_Repo/manifest-parser. go.sum updated accordingly.
Add conditional checks (if: inputs.dev == false) to macOS-specific release steps: Import Code-Signing Certificates, Updating/upgrading brew, and Install gon. This ensures those steps are skipped when the workflow is run in dev mode (inputs.dev=true), avoiding unnecessary or platform-specific operations during dev releases.
Remove the credentialstore abstraction and OS keyring dependency, routing credential storage to the YAML config instead. Update auth login/logout to write/clear cx_apikey in the config (persistYamlLogin, runAuthLogout) and restrict config file permissions. Remove keyring-related code, mocks and tests, and related startup wiring (Install/LoadStoredSecrets). Clean up imports and go.mod/.golangci.yml entries. Rationale: simplify credential handling by eliminating platform keyring complexity and keep credentials in the CLI config file (with best-effort file perms).
commit bfdca5a
Author: atishj99 <atish.jadhav@checkmarx.com>
Date:   Tue Jul 28 16:40:43 2026 +0530

    lint issue fix

commit 04b26b0
Author: atishj99 <atish.jadhav@checkmarx.com>
Date:   Tue Jul 28 16:17:42 2026 +0530

    Remove credentialstore/keyring; persist creds to YAML

    Remove the credentialstore abstraction and OS keyring dependency, routing credential storage to the YAML config instead. Update auth login/logout to write/clear cx_apikey in the config (persistYamlLogin, runAuthLogout) and restrict config file permissions. Remove keyring-related code, mocks and tests, and related startup wiring (Install/LoadStoredSecrets). Clean up imports and go.mod/.golangci.yml entries. Rationale: simplify credential handling by eliminating platform keyring complexity and keep credentials in the CLI config file (with best-effort file perms).

commit c4a7722
Author: atishj99 <atish.jadhav@checkmarx.com>
Date:   Tue Jul 28 14:50:39 2026 +0530

    Gate macOS release steps with dev input

    Add conditional checks (if: inputs.dev == false) to macOS-specific release steps: Import Code-Signing Certificates, Updating/upgrading brew, and Install gon. This ensures those steps are skipped when the workflow is run in dev mode (inputs.dev=true), avoiding unnecessary or platform-specific operations during dev releases.
Enable OSS Realtime scanner to handle Swift ecosystem manifests and map CocoaPods/Carthage packages to the Swift package manager. Changes in internal/services/realtimeengine/ossrealtime/oss-realtime.go: add new pkg manager constants (cocoapods, carthage, swift); expand supported extensions and filenames (Podfile, Podfile.lock, Cartfile, Cartfile.resolved, Package.swift, .podspec.json handling, etc.); map cocoapods/carthage packages to swift in package map and request conversion.

Update go.mod/go.sum to use a local manifest-parser replacement for development: comment out the previous remote requirement, add a placeholder require entry and a replace pointing to C:/Users/AtishJ/GitHub_Repo/manifest-parser. go.sum updated accordingly.
Update go.mod to use github.com/Checkmarx/manifest-parser v0.1.3-prerelease (remove local replace) and add corresponding go.sum entries. Update OSS realtime manifest validation: simplify supported extensions, add Cartfile.private and Package.resolved filename support, and add special-case handling for .podspec.json and Package@swift-*.swift variants. These changes enable the prerelease manifest-parser and broaden supported manifest filename/variant coverage for OSS realtime scanning.
Upgrade github.com/Checkmarx/manifest-parser to v0.1.3-prerelease2 (go.mod/go.sum). Remove several lock/resolved files from the OSS realtime manifest whitelist (Podfile.lock, Cartfile.resolved, pubspec.lock, Package.resolved) so they are no longer treated as supported manifest inputs.
Upgrade github.com/Checkmarx/manifest-parser from v0.1.3-prerelease2 to v0.1.3-prerelease3 and update go.sum with the new module checksums.
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.

2 participants