Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Xray scan fails to parse valid CPE from Amazon Linux 2023 (cpe:invalid wfn string)

Aperta
#458 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, go
Ambito
cli, security

Direzione di ricerca

Inizia riproducendo il problema con public.ecr.aws/amazonlinux/amazonlinux:2023 usando jf docker scan, quindi traccia il percorso di parsing dei metadati del sistema operativo e di CPE nella CLI. Esamina come vengono gestiti i campi di /etc/os-release come ID, Version, Distribution e CPE_NAME. Il lavoro è completato quando la scansione accetta il CPE_NAME valido oppure genera un fallback conforme alla specifica senza l’errore di parsing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

I'm encountering a persistent issue where jf docker scan fails to parse a valid CPE URI from an amazonlinux:2023 image, even after explicitly setting a correct CPE_NAME in /etc/os-release. This results in the error:

Failed to parse CPE URI: cpe:invalid wfn string

This affects automated scans in CI/CD and causes confusion for developers due to non-actionable output.

Current behavior

Error:

2025-05-28T17:09:51.757Z [jfxia] [DEBUG] [] [fileutil:157                  ] [main                ] checking if the file is supported executable usr/lib/motd
2025-05-28T17:09:51.757Z [jfxia] [DEBUG] [] [fileutil:157                  ] [main                ] checking if the file is supported executable usr/lib/motd.d/30-banner
2025-05-28T17:09:51.757Z [jfxia] [ERROR] [] [os_version:60                 ] [main                ] Failed to parse CPE URI: cpe:invalid wfn string.

2025-05-28T17:09:51.757Z [jfxia] [DEBUG] [] [extractor:245                 ] [main                ] 
OS Version Info:
ID: amzn
Distribution: 
Version: 2023

2025-05-28T17:09:51.772Z [jfxia] [DEBUG] [] [fileutil:157                  ] [main                ] checking if the file is supported executable usr/lib/rpm/macros
2025-05-28T17:09:51.773Z [jfxia] [DEBUG] [] [fileutil:157                  ] [main                ] checking if the file is supported executable usr/lib/rpm/platform/aarch64-linux/macros
2025-05-28T17:09:51.773Z [jfxia] [DEBUG] [] [fileutil:157                  ] [main                ] checking if the file is supported executable usr/lib/rpm/platform/alpha-linux/macros

Observed Behavior:
Despite the image containing a valid CPE_NAME (cpe:2.3⭕amazon:amazon_linux:2023) and trying to set a valid CPE_NAME (cpe:2.3⭕amzn:amazon_linux:2023) and adding a Distribution=amazonlinux field to /etc/os-release, the CLI scan fails with cpe:invalid wfn string.

Debug logs show:

OS Version Info:
ID: amzn
Distribution: 
Version: 2023
Reproduction steps
  1. Pull image: docker pull public.ecr.aws/amazonlinux/amazonlinux:2023
  2. Scan image: jf docker scan public.ecr.aws/amazonlinux/amazonlinux:2023 --watches "Default_Watch"
Expected behavior

Xray should use the explicitly set and valid CPE_NAME from /etc/os-release, or at least generate a fallback CPE that conforms to the CPE 2.3 specification.

The scan should not error due to OS-level metadata if it is complete and syntactically correct.

JFrog CLI version

2.76.0

Operating system type and version

macOS 15.5

JFrog Artifactory version

No response

JFrog Xray version

No response

Lingua principale
Go
Stelle
13
Fork
52
Merge medio
2g 11h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jfrog/jfrog-cli-security

Tutte le issue di jfrog/jfrog-cli-security

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.