Skip to content

Fix misleading security scan status message in jf skills publish - #541

Open
tal-qwak wants to merge 4 commits into
jfrog:mainfrom
tal-qwak:fix/skills-publish-scan-message-overclaim
Open

Fix misleading security scan status message in jf skills publish#541
tal-qwak wants to merge 4 commits into
jfrog:mainfrom
tal-qwak:fix/skills-publish-scan-message-overclaim

Conversation

@tal-qwak

@tal-qwak tal-qwak commented Aug 27, 2026

Copy link
Copy Markdown

Summary

  • jf skills publish (without --skip-scan) prints [SUCCESS] Skill "<slug>" v<version> passed security scan. as soon as the Skills Xray gate (GET .../api/skills/{repoKey}/xrayStatus) returns APPROVED.
  • In testing, this message printed ~2 seconds after upload, before Xray's own async scan pipeline for skill artifacts had produced a real verdict — a subsequent direct query to xray/api/v1/summary/artifact for the same artifact showed a Critical "Malicious skill" finding (XRAY-00672) that the gate never surfaced.
  • The CLI's polling logic in xray_gate.go is correct as-is (it already polls on SCAN_IN_PROGRESS until a terminal status). The issue is purely the wording: APPROVED reflects Artifactory/Xray's current indexing state at the moment of the check, not a guaranteed completed content scan, so asserting the artifact "passed security scan" overclaims what the gate can currently promise.

Change

Reworded both APPROVED log lines (the immediate case in CheckXrayGate and the post-poll case in pollUntilDone):

- [SUCCESS] Skill "<slug>" v<version> passed security scan.
+ [SCAN PENDING] Skill "<slug>" v<version>: no violations found yet.

Matches the file's existing bracket-tag convention ([VIOLATION] for the blocked case), and leads with the one word that matters (PENDING, not SUCCESS) so it's skimmable without reading the full line.

No behavior change — same statuses handled the same way, same control flow. Confirmed go build ./agent/skills/... and go test ./agent/skills/... pass unchanged.

Note for maintainers

This does not close the underlying gap — it only makes the CLI honest about what it doesn't know. The actual cause (why APPROVED can be returned before a skill's async content scan completes) is server-side, in Xray's artifact-processed status computation, not in this CLI. jf skills install shares the same gate check and remains exposed to the same window. Happy to share full details on request.

Test plan

  • go build ./agent/skills/...
  • go test ./agent/skills/...

Summary by CodeRabbit

  • Bug Fixes
    • Updated approved-scan messages to clearly indicate when no Xray violations are found, including both immediate and polling completion results.

The APPROVED status from the Skills Xray gate reflects Artifactory/Xray's
current indexing state at the moment of the check, not necessarily a
completed content scan - for freshly published skills the message could
print before Xray has had a chance to fully scan the artifact. Reword the
message so it reports what was actually observed (no violations found)
rather than asserting the artifact 'passed security scan', which implies a
guarantee the gate cannot currently make.
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4e38801-c731-441a-848a-adbd06f82165

📥 Commits

Reviewing files that changed from the base of the PR and between 9231a05 and 65771fb.

📒 Files selected for processing (1)
  • agent/skills/common/xray_gate.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • agent/skills/common/xray_gate.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Xray gate updates approved-status log messages in immediate and polling completion paths. The messages now state that no Xray violations were found for the skill and version.

Changes

Xray approval log wording

Layer / File(s) Summary
Update approved-status messages
agent/skills/common/xray_gate.go
Immediate and polling completion paths now use consistent no-violations wording instead of the previous success message.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 65771

This change only replaces misleading security-scan success text with a pending-status message and does not alter scan gating or control flow. No actionable merge-blocking risk remains after normal checks.

Suggested reviewers: agrasth

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: correcting a misleading security scan status message in jf skills publish.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Following up on the earlier wording fix: 'no violations found' alone still
reads as a clean bill of health, which is the same false confidence
'passed security scan' gave. Add an explicit caveat that the scan may
still be in progress, since Xray's current Skills gate status can report
APPROVED before the async content scan has actually finished.
The previous wording said the same thing twice ('so far' + 'may still be
pending') across two sentences. Match the file's existing bracket-tag
convention ([VIOLATION] for the blocked case) with [SCAN PENDING] here, so
the one word that matters is skimmable at a glance instead of requiring
the full sentence to be read.
@tal-qwak

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@fluxxBot fluxxBot added the improvement Automatically generated release notes label Aug 28, 2026
@tal-qwak tal-qwak changed the title Don't overclaim a full security verdict in the skills publish scan message Fix misleading security scan status message in jf skills publish Aug 28, 2026
return nil
case services.SkillXrayStatusApproved:
log.Info(fmt.Sprintf("[SUCCESS] Skill \"%s\" v%s passed security scan.", params.Slug, params.Version))
log.Info(fmt.Sprintf("[SCAN PENDING] Skill \"%s\" v%s: no violations found yet.", params.Slug, params.Version))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If jfrog-cli is doing checks to figure out what is the XRAY status via artifactory API, then changes has to be made on the API to return proper status instead of Approved. If the api is returning approved but still it means that scanning is not completed then API response should be improved.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and this PR is intentionally scoped as a mitigation, not the real fix. We traced this down to the actual root cause: Xray's GetArtifactState() (xray/backend/backend/service/artifact_details/artifact_details_service.go in JFROG/xray) sets ArtifactProcessed = true for PendingScanValue ("Pending Scan") and INDEXING, not just SCANNED - so the Skills gate can report APPROVED before the async content-scan (aiscanner) pipeline has actually produced a verdict. We drafted a fix scoped to PkgType == skills there, but couldn't push a branch to JFROG/xray (hit what looks like a repo-level policy blocking direct branch creation) - happy to hand off the diff or open it properly once we know the right contribution path for that repo. This PR just reduces the blast radius on the CLI side in the meantime.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an improvement again when there is a proper fix on JFROG/xray.

@bhanurp
bhanurp self-requested a review August 28, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants