Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent/skills/common/xray_gate.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func CheckXrayGate(params XrayGateParams) error {
log.Info(fmt.Sprintf("Xray scanning is disabled for repository '%s'. Skipping scan.", params.RepoKey))
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.

return nil
case services.SkillXrayStatusBlocked:
return handleBlocked(params)
Expand Down Expand Up @@ -136,7 +136,7 @@ func pollUntilDone(sm artifactory.ArtifactoryServicesManager, params XrayGatePar
switch resp.Status {
case services.SkillXrayStatusApproved:
stopSpinner()
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))
return nil
case services.SkillXrayStatusBlocked:
stopSpinner()
Expand Down
Loading