Giter VIP home page Giter VIP logo

Comments (3)

hdm avatar hdm commented on August 20, 2024

Thanks! cc @TomSellers

from recog.

tsellers-r7 avatar tsellers-r7 commented on August 20, 2024

I dug into this a bit this morning. The data in the *.cpe23 fields is indeed CPE 2.3 but it is in the URI format. Jon called this out when he added CPE in PR #172

The 2.3 specification has 3 formats:

  1. URI format, intended to be backwards compatible with 2.2 (Section 6.1 in the ref below)
    cpe:/a:hp:insight_diagnostics:7.4.0.1570:-:~~online~win2003~x64~

  2. Formatted String (Section 6.2 in the ref below)
    cpe:2.3:a:hp:insight_diagnostics:7.4.0.1570:-:*:*:online:win2003:x64:*

  3. WFN - well formatted name (Section 5 in the ref below)

wfn:[
  part="a",
  vendor="hp",
  product="insight_diagnostics",
  version="7\.4\.0\.1570",
  update=NA,
  sw_edition="online",
  target_sw="win2003",
  target_hw="x64"
]

We are currently emitting the URI variant as our cpe23 value. I can likely add a new field named cpe23_fs that is more in line with what folks expect. Here's a rough explanation of the values.

part:vendor:product:version:update:edition:sw_edition:target_sw:target_hw:language:other
                              ^       ^         ^       ^           ^       
                              |       |         |       |           ---- x86, JVM, CLR, etc.
                              |       |         |       |
                              |       |         |       --- valid OS or software env
                              |       |         |
                              |       |         --- how tailored to market / class of users
                              |       | 
                              |       --- deprecated in formatted string format
                              |
                              --- update, service pack, point release - vendor specific

Also, there are a couple things we are likely doing incorrectly.

  1. CPE 2.3 as 4 new fields (sw_edition, target_sw, target_hw, language) that don't exist in 2.2. In order to express them in a backwards compatible way they are "packed" into the edition field (deprecated in 2.3) separated by the tilde ~ character.

  2. We have't been providing these new fields when we know them. We also haven't been consistently handling the update field which comes after the version.

  3. The URI format also introduced percent encoding for certain characters. We're almost certainly doing that incorrectly or incompletely.

Proposal:

  1. Add a new cpe23_fs field to contain the 2.3 formatted string format
  2. Add handling for the 4 new fields (sw_edition, target_sw, target_hw, language) in both the URI and formatted string output.
  3. Improve the documentation around CPEs, generation, etc. where appropriate.

Thoughts @p0lr @hdm ?

Reference:

  1. https://www.govinfo.gov/content/pkg/GOVPUB-C13-c213837a04c3bcc778ebfd420c6a3f2a/pdf/GOVPUB-C13-c213837a04c3bcc778ebfd420c6a3f2a.pdf

from recog.

dabdine avatar dabdine commented on August 20, 2024

Do we also want to deprecate the cpe23 field? Any reason to leave it this way instead of perhaps removing it later and, if kept, making a distinct cpe23_22compat field with its contents?

from recog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.