feat: rework Checkmarx from CxSAST on-premise to Checkmarx One cloud - #276
Conversation
…x One cloud
Replaces the CxSAST on-premise integration (username/password OAuth2 via /cxrestapi/)
with Checkmarx One (client_credentials OAuth2 via iam.checkmarx.net, /api/ endpoints).
Config keys: baseUrl, tenantName, clientId, clientSecret
Env vars: PNCLI_CHECKMARX_BASE_URL, PNCLI_CHECKMARX_TENANT_NAME,
PNCLI_CHECKMARX_CLIENT_ID, PNCLI_CHECKMARX_CLIENT_SECRET
Closes #274
Co-authored-by: Sunny Kolattukudy <kolatts@users.noreply.github.com>
|
Claude finished @kolatts's task in 3m 13s —— View job PR Review: feat: rework Checkmarx from CxSAST on-premise to Checkmarx One cloud
SummaryThe rework is solid. The OAuth2 Two substantive issues to fix before merging, one concern worth confirming: Blocking
if (cfg.checkmarx.baseUrl && cfg.checkmarx.clientId && cfg.checkmarx.clientSecret) {
if (!cfg.checkmarx.clientId || !cfg.checkmarx.clientSecret) {
That error propagates as an uncaught exception in the
const res = await this.http.checkmarx<CxOneProjectsResponse>('/api/projects', { params: { limit: 100 } });
return res.projects;The response type includes Concern (worth verifying)
export interface CxOneResultsSummary {
highSeverity: number;
mediumSeverity: number;
lowSeverity: number;
infoSeverity: number;
severitiesTotalCount?: number;
}The Checkmarx One Minor
|
There was a problem hiding this comment.
Two blocking issues before merge:
-
Missing
tenantNameinconfig test/config checkguards — both commands checkbaseUrl + clientId + clientSecretbut nottenantName. When tenantName is absent,buildCheckmarxFetcher()throws inside the connectivity branch instead of reporting 'not configured'. Add&& cfg.checkmarx.tenantNameto theconfig testcondition (line 212) and|| !cfg.checkmarx.tenantNameto theconfig checkblank guard (line 447). -
Silent truncation in
listProjects/listScans— hardcodedlimit: 100with no pagination loop means orgs with >100 projects/scans get partial results silently. The response already carriesfilteredTotalCount; at minimum emit a stderr warning when results are truncated.
Concern worth verifying: CxOneResultsSummary field names (highSeverity, mediumSeverity, etc.) may not match the actual Checkmarx One API response shape — if they're off, scan stats returns all-undefined severity counts.
The OAuth2 flow, token caching, config wiring, and test coverage are all well done.
Generated-with: OpenAI Codex (GPT-5)
Generated-with: OpenAI Codex (GPT-5)
Tasks
|
…ncated lists Add tenantName to config-test and config-check guards so that a missing tenantName is reported as 'not configured' rather than propagating a PncliError throw from buildCheckmarxFetcher. Also emit a stderr warning when listProjects or listScans receives a truncated response (filteredTotalCount > returned count). Co-authored-by: Sunny Kolattukudy <undefined@users.noreply.github.com>
There was a problem hiding this comment.
The two blocking issues from the previous review are now resolved (fixed in the latest commit):
-
tenantNameguard — added to bothconfig test(line 212) andconfig check(line 447). A missingtenantNamenow correctly reports "not configured" instead of propagating aPncliErrorthrow frombuildCheckmarxFetcher. -
Truncation warning —
listProjectsandlistScansnow emit astderrwarning whenfilteredTotalCountexceeds the returned count.
The e249adc commit (API key support) is well done: treating the API key as a JWT refresh token with grant_type: refresh_token, extracting the client ID from the azp claim, and deriving the IAM host from the API base URL (replacing the hardcoded constant) are all correct.
Remaining concern (non-blocking): CxOneResultsSummary field names (highSeverity, mediumSeverity, etc.) should be verified against the actual Checkmarx One API response before the next time this command is tested against a live tenant — if the field names don't match, scan stats returns all-undefined severity counts silently.
|
Claude finished @claude[bot]'s task in 3m 35s —— View job PR Review: feat: rework Checkmarx from CxSAST on-premise to Checkmarx One cloud
SummaryAll blocking issues from the prior review cycle are resolved. The code is clean and ready to merge. What was fixed since the CHANGES_REQUESTED review
Truncation warnings ( CI workflow change (
|
There was a problem hiding this comment.
Re-review after latest synchronize. All blocking issues from the prior round are resolved; the code is clean and ready to merge.
Both fixes confirmed present:
- tenantName guard in config test (commands.ts:212) and config check (commands.ts:447) — missing tenantName now correctly surfaces as 'not configured' rather than a raw PncliError throw.
- Truncation warnings in listProjects and listScans (client.ts:15, 29) — stderr warning when filteredTotalCount exceeds returned slice.
CI workflow change (e249adc) is sound: writing PR title/body to /tmp files and letting the post-step create the PR is cleaner than having the agent race the workflow; --state all on the existence check prevents duplicates.
Remaining non-blocking concern: CxOneResultsSummary field names (highSeverity, mediumSeverity, lowSeverity, infoSeverity) should be verified against the live /api/results/summary response before first production use of pncli checkmarx scan stats.
OAuth2 flow, token caching, IAM host derivation, config wiring, masking, and test coverage are all correct. Approved.

Replaces the CxSAST on-premise integration with Checkmarx One cloud.
Config now uses
clientId,clientSecret, andtenantNameinstead ofusername/password. Auth uses OAuth2 client_credentials flow viaiam.checkmarx.net/{tenant}. API endpoints updated from/cxrestapi/to/api/. Project and scan IDs are now UUID strings.Closes #274
Generated with Claude Code