Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Package Purpose field #622

Merged
merged 1 commit into from
May 10, 2022

Conversation

nishakm
Copy link
Contributor

@nishakm nishakm commented Feb 8, 2022

Fixes #621

Signed-off-by: Nisha K [email protected]

@nishakm
Copy link
Contributor Author

nishakm commented Feb 8, 2022

@goneall, @iamwillbar This is a first-pass PR. A review is appreciated :)

@nishakm
Copy link
Contributor Author

nishakm commented Feb 8, 2022

cc @puerco

@swinslow
Copy link
Member

swinslow commented Feb 8, 2022

Thanks for this @nishakm! I haven't been closely involved with the discussions around adding a Package Purpose field, but here are a few random thoughts anyway :)

  • For the PR, should this maybe be merging into a development/v2.3 branch rather than v2.2.2? I think 2.2.2 would be a point release, just for bugfixes but not to add new fields. @goneall @kestewart do we need / want to create a separate development/v2.3 branch?
  • I tend to think that it should be optional and the cardinality should be 0..* rather than 1..1:
    • 0 rather than 1 on the left, because I don't think it should be a mandatory field. Both because (A) not all use cases for SPDX Documents are going to be appropriate (or possible) to define a Package Purpose for every Package; and also (B) because it would make existing 2.1, 2.2, etc. SPDX Documents no longer valid, which would be a breaking change for a minor release.
    • * rather than 1 on the right, because there may be cases where a Package has multiple "Purposes". E.g., a Package could contain the source code for both an application and a library, and therefore could have 3 PackagePurposes. I'm also thinking by comparison the File Type field, which has similar purpose and values and is 0..*
  • This is a more minor point, but it would also probably be useful to clarify what is meant by some of the different values, e.g. the distinction between APPLICATION vs. FRAMEWORK vs. LIBRARY.
    • The existing File Type field says that APPLICATION there means a specific category of MIME types; does that apply here also?
    • I'm not sure if there's an obvious distinction of FRAMEWORK vs. LIBRARY -- there probably is, but it might be helpful to clarify that.

Hope this helps -- and apologies if any of this is contrary to things the tech team has discussed separately!

@nishakm
Copy link
Contributor Author

nishakm commented Feb 8, 2022

Should I be turning this into a Draft PR?

@goneall
Copy link
Member

goneall commented Feb 9, 2022

Suggest adding one more enumeration:

  • FILE - A single distributed file that can be independently distributed (e.g. a properties file or a configuration file)

This would allow mapping to the CycloneDX file type and also solve some of the issues @rjb4standards has raised.

@goneall
Copy link
Member

goneall commented Feb 9, 2022

I tend to think that it should be optional and the cardinality should be 0..* rather than 1..1

I'm leaning toward 0..1 and changing the semantics slightly to be the "primary" purpose of the package. This would making the mappings to CycloneDX easier.

That being said, there is value to having the multiple purposes represented in that it may help identify expected properties to be present. However, this scenario may be better addressed through Profiles rather than having multiple purposes.

@puerco
Copy link
Contributor

puerco commented Feb 9, 2022

Thanks for filing this @nishakm!

I agree with @swinslow and @goneall , I would not make it mandatory as it would break compatibility with older docs.

I'm wondering if purpose really captures the notion we want. Talking about purpose sets the origin of the subject matter within the SBOM. In other words, it sounds as if the SBOM were dictating what the software should be used for while we are really trying to indicate what kind of bundle the package is describing. The said bundle has its inherent properties which the SBOM can only describe but not set.

I'm sorry, I know it is ontological pedantry, I just wanted to note the misalignment. I think I would add an enumerated PackageKind or PackageType mimicking FileType, but if naming it Purpose makes it compatible with 3.0, then there's no point to discuss. :)

@rjb4standards
Copy link

rjb4standards commented Feb 9, 2022

I believe the 2.3 effort is considering the addition of a Classification element; I'm wondering if PackageType would be more appropriate and in harmony with 3.0, if @puerco suggestion passes muster.

The 2.3 effort is intended to address DocFest issues involving NTIA minimum elements and is considering additional elements under the Package object:
Classification
AttestationsURL or something similar

@kestewart kestewart added this to the 2.3 milestone Feb 11, 2022
Copy link
Contributor

@kestewart kestewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this started @nishakm! Nice work.

Agree with Gary - this should be optional, so Cardinality 0..1

Of the Purposes (or Classifications) we've got listed, some are beyond software, so we should discuss further.

We should probably discuss if the Examples should include JSON as well at this point? Topic for the next tech call I guess.

@kestewart
Copy link
Contributor

@rjb4standards - FileTypes is referencing MIME types today, so as this has a different semantics, we should use a different term to describe it. Classification, Purpose, PrimaryPurpose, ???

yeah let's see if we can come to agreement either in this thread or at one of the meetings.

@rjb4standards
Copy link

I defer to the group consensus on the name to use. I'll be happy if I can report a version on a file that is part of an installation package. This fills the NTIA minimum check in SAG-PM that is kicking out SPDX SBOM for non-conformance with NTIA minimum standards. That solves a problem for me.

Also, we are currently coding in support for CycloneDX VEX for vulnerability reporting and look forward to doing the same for whatever the SPDX defects team produces to answer the question:
What is the vulnerability status of product P, version V from Supplier S at time(t) at the SBOM component level?

Thanks to all for their technical contributions in helping to solve these problems.

@seabass-labrax
Copy link
Contributor

Suggest adding one more enumeration:

* FILE - A single distributed file that can be independently distributed (e.g. a properties file or a configuration file)

@goneall, wouldn't a FILE always be for a specific purpose? For instance it could be a PATCH or CONFIGURATION.

@rjb4standards
Copy link

+1 for FILE as a catchall for objects that have a version identifier that don't fit comfortably into another calss.

@goneall
Copy link
Member

goneall commented Feb 11, 2022

wouldn't a FILE always be for a specific purpose? For instance it could be a PATCH or CONFIGURATION.

@seabass-labrax I agree a FILE will likely have a specific purpose, however, it may not be easy for the document creator to know the purpose of the file and it may not always be important to the use case.

I would suggest having a generic FILE purpose and if there are specific use cases where there is value in knowing the purpose having those as additional purposes.

@rjb4standards
Copy link

Quick question, is PURPOSE the current element name to represent CLASSIFICATION info, i.e. File, Library, installPackage, etc. in V 2.3 or are these two different concepts?
Thanks...

@goneall
Copy link
Member

goneall commented Feb 12, 2022

Quick question, is PURPOSE the current element name to represent CLASSIFICATION info, i.e. File, Library, installPackage, etc. in V 2.3 or are these two different concepts?

I am thinking we only have one new property to represent CLASSIFICATION info.

@rjb4standards
Copy link

Thanks, Gary. I can live with a minimum of 2 classifications:
Installation
File
But will be happy to support whatever the team decides for classifications.
The other important item for v 2.3 is the ability to identify an SBOM with a vulnerability report, that updates independently of the SBOM, and is always available for download to check the vulnerability status of the SBOM over time.

@nishakm
Copy link
Contributor Author

nishakm commented Feb 14, 2022

To summarize everyone's feedback thus far:

  1. Cardinality should be 0..1
  2. Add File enumeration: FILE - A single file that can be independently distributed (e.g. a properties file or a configuration file)

Do I understand correctly that we are unclear on whether this field should be "PackagePurpose" or "PackageType"?

@goneall
Copy link
Member

goneall commented Feb 14, 2022

Do I understand correctly that we are unclear on whether this field should be "PackagePurpose" or "PackageType"?

@iamwillbar - Did we already discuss and agree on the name for this field? If so, we should go with the previously chosen field name.

@iamwillbar
Copy link
Collaborator

@goneall For SPDX 3.0 there was agreement on PackagePurpose. Type was deemed to be ambiguous.

@nishakm
Copy link
Contributor Author

nishakm commented Feb 15, 2022

On Cardinality: 0..* is preferred.

@nishakm
Copy link
Contributor Author

nishakm commented Feb 15, 2022

From Kate: FILE is confusing. Need another term. FIRMWARE could also be a file.

@seabass-labrax
Copy link
Contributor

@nishakm, I would also agree with expanding the cardinality to 0..*, as this would abate my concern about FILE as a type limiting future refinement of the SBOM when a concrete purpose is discovered.

I also agree with Kate's point that FILE could be confused with the file information capability of the SPDX specification. I suggested MONOLITHIC at the 2022-02-15 meeting but Kate had some reservations about that!

@nishakm
Copy link
Contributor Author

nishakm commented Feb 25, 2022

@kestewart @goneall Will a 2.3 branch be created soon? :)

@goneall
Copy link
Member

goneall commented Feb 25, 2022

@kestewart @goneall Will a 2.3 branch be created soon? :)

@kestewart @tsteenbe were you going to set this up?

@iamwillbar iamwillbar mentioned this pull request Mar 1, 2022
3 tasks
@kestewart
Copy link
Contributor

@nishakm - please update fixes, and submit to 2.3 branch.

@nishakm nishakm changed the base branch from development/v2.2.2 to development/v2.3 March 9, 2022 01:41
@nishakm nishakm force-pushed the 621-package-purpose branch from 613227d to 91a9133 Compare March 9, 2022 01:51
Copy link
Member

@swinslow swinslow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few specific comments / suggested edits for particular parts of this, which I'm including inline.

I'd also asked earlier in the conversation thread about whether some of the definitions can be clarified, in particular FRAMEWORK vs. LIBRARY. But I know I haven't been on tech team calls for a long time so you may have discussed or resolved any of these comments already. Just sharing in case they're helpful. Thanks!

| Attribute | Value |
| --------- | ----- |
| Required | Yes |
| Cardinality | 0..* |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Cardinality will be 0..*, then I think Required should be "No" rather than "Yes"?

`APPLICATION` if the package is a software application;
`FRAMEWORK` if the package is a software framework;
`LIBRARY` if the package is a software library;
`CONTAINER` if the package refers to a container image which can be used by a container runtime application;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below, maybe consider whether "refers to" is the intended language to use here?

In the first few entries, it says "if the package is a...". Is it meant to mean something different where it says "refers to" instead of "is"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is hard - containers are usually declared in the form of "name:tag" and this refers to a remote tag which points to a merkle tree. Eventually, the leaf artifacts are downloaded by the client but container users have no visibility into this. So yes, I intentionally used "refers to", but I am willing to change it to something more appropriate.

`LIBRARY` if the package is a software library;
`CONTAINER` if the package refers to a container image which can be used by a container runtime application;
`OPERATING-SYSTEM` if the package refers to an operating system;
`DEVICE` if the package refers to a chipset, processor, or electronic board;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the meaning of DEVICE as defined here. Is the intention that this would be used for:

  1. files which are the actual embodiment of a chipset, etc. (such as PCB images, or VHDL files, etc.); or
  2. files which are specific to a particular device (such as architecture-specific files in the Linux kernel sources)

I'm guessing the intention is 1 but not 2, but the current definition seems to potentially apply to either one... maybe consider clarifying whether that's the intended meaning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC "DEVICE" is one of the CycloneDX enumerations.

`FIRMWARE` if the package provides low level control over a device's hardware;
`SOURCE` if the package is a collection of source files;
`ARCHIVE` if the package refers to an archived collection of files (.tar, .zip, etc);
`FILE` if the package is a single file which can be independently distributed (configuration file, statically linked binary, Kubernetes deployment, etc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Kubernetes deployment" seems a bit odd to call out here. Is Kubernetes always or typically deployed as a single file? Apologies if it is, I genuinely don't know :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a YAML file that directs kubernetes to pull and deploy 1 or more containers. I would say it's similar to a config file.


The metadata for the Package Purpose field is shown in Table 36.

**Table 36 — Metadata for the package name field**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caption here says "the package name field", should that be "the package purpose field"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nishakm does this proposal require the use of "CAPITAL" letters for the enumerated set of 'PackageProposal" content model members? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, enumerations are written with CAPITAL letters, at least in code. To be honest, I was just following the pattern in the model document :).
https://github.com/spdx/meetings/blob/main/tech/Model.png

@nishakm nishakm force-pushed the 621-package-purpose branch from 91a9133 to 555cc32 Compare April 1, 2022 15:55
@nishakm nishakm requested a review from kestewart April 1, 2022 15:55
@nishakm
Copy link
Contributor Author

nishakm commented Apr 1, 2022

Some questions have come up that I would like clarification on:

  • Alternative to "FILE" as the enumeration of singleton file distribution
  • Addition of "INSTALL" enumeration
  • Clarification of "DEVICE" enumeration
  • How to describe "CONTAINER" enumeration
  • What to use for kubernetes distribution

@nishakm nishakm force-pushed the 621-package-purpose branch from 555cc32 to 1026215 Compare April 1, 2022 16:03
@rjb4standards
Copy link

rjb4standards commented Apr 1, 2022

Suggestion:
Alternative to "FILE" as the enumeration of singleton file object

@kestewart
Copy link
Contributor

From discussion on call.

Agreement to add:
INSTALL - purpose to identify as installable image (ie. RPM, Deb, archive file, etc.)

Next steps: Nisha to revise PR, then submit for re-review.

@rjb4standards
Copy link

rjb4standards commented Apr 27, 2022

@nishakm , please include the proposed language for section 5.2 in your edits. Will need some cleanup to reflect consensus position changes since this was produced, i.e. classification should be replaced with PackagePurpose and the enumeration list needs to be replaced. Thanks.. #628

@nishakm nishakm force-pushed the 621-package-purpose branch 2 times, most recently from ba088fe to 722bd20 Compare April 28, 2022 17:22
@nishakm nishakm requested a review from kestewart April 28, 2022 17:24
@nishakm
Copy link
Contributor Author

nishakm commented Apr 28, 2022

@rjb4standards Not sure if I added the information you requested. Please review.

@nishakm nishakm force-pushed the 621-package-purpose branch from 722bd20 to d5a0c46 Compare April 28, 2022 17:32
a LICENSE file
a CHANGE log
a properties file
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nishakm this looks good. Will need to sync this material with section 5.2.2 which needs to be updated accordingly
https://github.com/spdx/spdx-spec/blob/development/v2.3/chapters/composition-of-an-SPDX-document.md
:
5.2.2 Package information section

If SPDX information is being used to describe packages, then one instance of the Package Information per package being described shall exist. It provides important meta information about the package as a whole. Packages are an abstract concept that can be used to refer to any distribution of software, typically consisting of one or more files and capable of containing sub-packages. Starting with SPDX 2.0, it is not necessary to have a package wrapping a set of files.

A Package refers to any unit of content that can be associated with a distribution of software. Typically, a Package is composed of one or more files. An SPDX document may, but is not required to, provide details about the individual files comprising a Package (see Clause 8).

Any of the following non-limiting examples may be (but are not required to be) represented in SPDX as a Package:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see! I will update accordingly.

@rjb4standards
Copy link

rjb4standards commented Apr 28, 2022 via email

@nishakm nishakm force-pushed the 621-package-purpose branch from d5a0c46 to 0531f15 Compare May 2, 2022 17:23
@nishakm
Copy link
Contributor Author

nishakm commented May 2, 2022

@rjb4standards I just realized what you were asking as a request to sync the package information section. There is a lot to synchronize, so if you don't mind, I would like to submit a separate PR for that bit once this PR is merged. I think you filed an issue for it so I will refer to that.

@rjb4standards
Copy link

No problem at all Nisha - I defer to your better judgement as to how to accomplish this matter. Thanks for the update.

- Add information about "package" in the information section
- Add metadata about Package Purpose

Fixes spdx#621

Signed-off-by: nisha <[email protected]>
@nishakm nishakm force-pushed the 621-package-purpose branch from 0531f15 to d66bab6 Compare May 10, 2022 16:58
@kestewart kestewart merged commit 185a7d1 into spdx:development/v2.3 May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a packagePurpose parameter to SPDX Package
8 participants