On 12/05/2025 3:30 pm, Dag-Erling Smørgrav wrote:
> Dewayne Geraghty <
dew...@heuristicsystems.com.au> writes:
>> I don't recall the argument for adding a CPE (Common Platform
>> Enumeration) into USES for port building, nor why its inserted into
>> the annotation section when using "pkg info". Though on a lightly
>> configured machine, only 107 of the 265 ports actually had a CPE entry
>> in annotations.
>
> It gets added when a CVE has actually been issued.
>
>> So I wondered, if its important then shouldn't it be mandatory?
>
> No, because we can't just make up CPEs.
>
I suspect you're conflating CPE with a CVE. The CPE is a construct
defined in the /usr/ports/Mk/Uses/
cpe.mk file. It takes as input
standard fields from the port's Makefile, such as PORTNAME, PORTVERSION,
PORTREVISION etc.
>> Is there a reason that inclusion of a cpe being available, is
>> determined by the port maintainer?
>
> Because the port maintainer needs to make sure it is correct.
>
The contribution by the port maintainer is to ensure that the elements
required for the CPE record are current, like PORTVERSION PORTREVISION
etc. Where the details are not included in the Makefile they have defaults.
>> Interestingly, after reviewing
>>
https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf
>> its noteworthy that the ports team uses the "Other" field (described
>> in section 5.3.3.11) within the CPE structure for the port revision,
>> rather than the "Update" (refer 5.3.3.5) field, as given as an example
>> in the pdf.
>
> The port revision and epoch are specific to the FreeBSD ports system.
> The update field is intended for a patch level or such chosen by the
> original author of the software.
Yes - the update field should be a patch level. Is it really by the
original author or the maintainer? I suspect your familiarity with the
standard is as current as needed.
>
>> So using tmux as an example, the CPE would be
>> cpe:2.3:a:tmux_project:tmux:3.3a:1::::freebsd13:x64:
>> enabling the other field to be used for something else.
>
> That would be incorrect.
>
>> The question of why the "language" field isn't populated, is for
>> another day...
>
> You understand that we don't get to just make shit up, right?
>
> DES
Yes, thank-you DES, I did read the standard before writing the email.
You're involved in a great many areas of FreeBSD and I appreciate the
work that you do. Perhaps the PR that I've referenced will help refresh
familiarity with the matter.
For your convenience
The CPE v2.3 standard is available at
https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf
The "language" field references
https://www.rfc-editor.org/rfc/rfc5646.txt
Kind regards, Dewayne