Bug 286737 - Mk/cpe.mk does not conform to NIST CPE V2.3 standard
Summary: Mk/cpe.mk does not conform to NIST CPE V2.3 standard
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-12 03:58 UTC by dewayne
Modified: 2025-05-13 00:33 UTC (History)
1 user (show)

See Also:


Attachments
Correct CPE record. Adds both language and CPUTYPE into record (1.34 KB, patch)
2025-05-12 03:58 UTC, dewayne
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2025-05-12 03:58:32 UTC
Created attachment 260347 [details]
Correct CPE record. Adds both language and CPUTYPE into record

Reviewing /usr/ports/Mk/cpe.mk against 
https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf
it became apparent that cpe.mk has field 7 "language" should be field 10.

Its also arguable that the current field 5, "Update" would be better used for the Port Revision information rather than field 11 "Other".

The attachment is how I have cpe configured.  It includes both the language, in field 10, and the CPUTYPE, as field 11, other.  This unambiguously defines the package as I build for both different languages and different CPU_TYPES.

It would make a great deal of sense if a simiar record was added to /sys/conf/newvers.sh so "uname -c" could provide a CPE record.
Comment 1 dewayne 2025-05-13 00:33:32 UTC
Subsequent to an offline discussion with DES, I'm sharing the conclusion:

NIST 7695 provides the necessary guidance for CPE content.  The structure of the CPE is defined in section 6.2.  The inclusion of a CPE can't be automated because the port maintainer must review the National Vulnerability Database per instructions in the Porters Handbook section 17.19 to maintain alignment in the event of a vulnerability.

References:
1. https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf
2. https://docs.freebsd.org/en/books/porters-handbook/book/#uses-cpe