Repository navigation
AST-180812 - Honour the VS Code Checkmarx Self-Healing setting in Copilot agent hooks - #1601
Open
cx-rahul-pidde wants to merge 3 commits into
Open
cx-rahul-pidde wants to merge 3 commits into
cx-rahul-pidde wants to merge 3 commits into
Conversation
…ilot agent hooks GitHub Copilot in VS Code runs the cx-devassist Copilot plugin's hooks, which call `cx hooks copilot-cli-*`. The Checkmarx VS Code extension writes its "Checkmarx Self-Healing" setting and scanner switches to ~/.checkmarx/cx-onboarding-ide.properties. - pluginHost(): where a Copilot hook runs, from the PLUGIN_ROOT the host injects (AST-186850 PoC): ~/.copilot/installed-plugins → terminal (checked first), <VS Code user data>/agentPlugins → VS Code (all OSes, Insiders); fallback GITHUB_COPILOT_INTEGRATION_ID=vscode-chat. - selfHealingOff(): for Copilot in VS Code with a valid IDE file saying cx_self_healing_enabled=false, the file-write handler skips ASCA / KICS / SCA-manifest / Secrets without telemetry. Shell-command policy, the SCA package-install scan and prompt guardrails are unchanged. Backup for hooks that call cx directly; the plugin already stops before running cx. - scannerOn(): Copilot in VS Code takes scanner switches from the IDE file while it is valid, else from cx-onboarding.properties. - scannerconfig: IDE file reader (IDEPath, SelfHealingEnabled, IDEEnabled); missing, unreadable, > 8 KB or unknown cx_schema_version means on. The terminal Copilot CLI never reads the IDE file. No ast-cx-hooks change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Rahul Pidde <206018639+cx-rahul-pidde@users.noreply.github.com>
|
| Secret Type | Status | Commit | File Path | View |
|---|---|---|---|---|
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 6fb5248d7e |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret | |
| URI | 0996fc220b |
internal/commands/gitmetadata_test.go |
🔎 View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Immediately rotate/revoke the exposed secret. (https://howtorotate.com/docs/introduction/getting-started/)
- Remove it from git history ( a new "remove secret" commit is NOT enough e.g. with
git-filter-repo).
To avoid such incidents in the future consider:
- Following the best practices for managing and storing secrets, including API keys and other credentials.
- Re-scan after cleanup before merging.
⚠️ These are unverified matches and do not block the merge — please review and confirm they are not real secrets.
2 of 3 tasks
Contributor
Author
|
Companion PRs for AST-180812: Checkmarx/cx-agentic-ai#38 (Copilot plugin, needs #37 first) · #1601 (agent hooks) · Checkmarx/ast-vscode-extension#1558 (VS Code setting) |
3 of 4 tasks
… host detection to VS Code - New package agenthooks/hostenv: PluginHost() (moved from cx/hooks.go) and TelemetryAgent(). Only VS Code's own agentPlugins folder (Code, Code - Insiders) counts as VS Code; ~/.copilot/installed-plugins is the terminal (checked first); any other PLUGIN_ROOT (VS Code forks, JetBrains, Visual Studio, ...) is another editor; GITHUB_COPILOT_INTEGRATION_ID=vscode-chat is used only when PLUGIN_ROOT is not set. - Telemetry agent for GitHub Copilot inside VS Code, by the extension that wrote the IDE file (cx_ide_extension): Copilot-VSCode-OneAssist (ast-results), Copilot-VSCode-DevAssist (cx-dev-assist), Copilot-VSCode (no valid file). Terminal Copilot and every other agent keep "<agent>-cli"; aiProvider is unchanged. Used by the ASCA, KICS, Secrets and remediation telemetry. - scannerconfig.IDEExtension() reads cx_ide_extension from a valid IDE file. - Self-Healing OFF only skips the file-write scans; shell-command policy, the SCA package-install scan and prompt guardrails always run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Rahul Pidde <206018639+cx-rahul-pidde@users.noreply.github.com>
VS Code has no severity threshold setting, so Copilot hooks running in VS Code now take cx_severity_threshold only from ~/.checkmarx/cx-onboarding-ide.properties, which is unset today and therefore low (nothing filtered). The terminal's cx-onboarding.properties threshold no longer relaxes VS Code denies; the terminal Copilot CLI and other agents are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Rahul Pidde <206018639+cx-rahul-pidde@users.noreply.github.com>
This branch has not been deployed
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.
Summary
Epic: AST-180812 · Design: TDD · Host detection based on the AST-186850 PoC (
feature/AST-186850-vsCodeInstallItself)GitHub Copilot in VS Code runs the cx-devassist Copilot plugin's hooks (
cx hooks copilot-cli-*). The Checkmarx VS Code extension writes its Checkmarx Self-Healing setting and scanner switches to~/.checkmarx/cx-onboarding-ide.properties. This PR lets the agent hooks honour that file for Copilot inside VS Code only.Changes (
internal/commands/agenthooks)cx/hooks.gopluginHost(): host from thePLUGIN_ROOTthe host injects —/.copilot/installed-plugins/→ terminal (checked first),/agentplugins/→ VS Code (Windows/macOS/Linux, Insiders); fallbackGITHUB_COPILOT_INTEGRATION_ID=vscode-chat.selfHealingOff()incxBeforeFileEditonly: Copilot in VS Code +cx_self_healing_enabled=false→ ASCA / KICS / SCA-manifest / Secrets skipped, no telemetry, verbose logskip_reason=self_healing_disabled. Shell-command policy (blacklist / ask-user), the SCA package-install scan and prompt guardrails are unchanged.scannerOn(): Copilot in VS Code takes scanner switches from the IDE file while it is valid, else fromcx-onboarding.properties.scannerconfig/scannerconfig.go: IDE file reader (IDEPath,SelfHealingEnabled,IDEEnabled). Missing, unreadable, > 8 KB or unknowncx_schema_version→ on / fallback.The terminal Copilot CLI and all other agents never read the IDE file. No
go.mod/ ast-cx-hooks change.This is a backup for hooks that call cx directly (e.g.
cx hooks install copilot); the plugin already stops before running cx when Self-Healing is off.Companion PRs: cx-agentic-ai (Copilot plugin) and ast-vscode-extension.
Test plan
go vet ./internal/commands/agenthooks/...go test ./internal/commands/agenthooks/...— all packages passcx/vscode_self_healing_test.go:pluginHosttable (incl. terminal-first order), OFF skips file-write scans, ON / missing / invalid file scans, terminal and other agents ignore the file, IDE scanner flags with fallback; existing blacklist / ask-user / SCA-install tests unchangedscannerconfigtests for the IDE file rules🤖 Generated with Claude Code