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

ZOOKEEPER-4657: Publish SBOM artifacts #1969

Merged
merged 1 commit into from Jan 12, 2023

Conversation

dongjoon-hyun
Copy link
Member

This PR aims to publish SBOM artifacts along with the other Apache projects.

Here is an article to give some context.

Software Bill of Materials (SBOM) are additional artifacts containing the aggregate of all direct and transitive dependencies of a project. The US Government (based on NIST recommendations) currently accepts only the three most popular SBOM standards as valid, namely: CycloneDX, Software Identification (SWID) tag, Software Package Data Exchange® (SPDX).

We can use one of the Maven plugin, CycloneDX maven plugin, a lightweight software bill of materials (SBOM) standard designed for use in application security contexts and supply chain component analysis.

https://maven.apache.org/plugins/index.html#misc

The expected results

$ mvn install -DskipTests
...

$ ls -al ~/.m2/repository/org/apache/zookeeper/zookeeper/3.9.0-SNAPSHOT/
total 16768
drwxr-xr-x  12 dongjoon  staff      384 Jan 10 14:59 .
drwxr-xr-x   8 dongjoon  staff      256 Jan 10 14:59 ..
-rw-r--r--   1 dongjoon  staff      436 Jan 10 14:59 _remote.repositories
-rw-r--r--   1 dongjoon  staff     1945 Jan 10 14:59 maven-metadata-local.xml
-rw-r--r--   1 dongjoon  staff    70780 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-cyclonedx.json
-rw-r--r--   1 dongjoon  staff    61959 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-cyclonedx.xml
-rw-r--r--   1 dongjoon  staff  3291660 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-javadoc.jar
-rw-r--r--   1 dongjoon  staff  1365393 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-osgi.jar
-rw-r--r--   1 dongjoon  staff   883895 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-sources.jar
-rw-r--r--   1 dongjoon  staff  1533401 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT-tests.jar
-rw-r--r--   1 dongjoon  staff  1341057 Jan 10 14:59 zookeeper-3.9.0-SNAPSHOT.jar
-rw-r--r--   1 dongjoon  staff    11456 Jan 10 14:55 zookeeper-3.9.0-SNAPSHOT.pom

<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>2.7.3</version>

Choose a reason for hiding this comment

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

Suggested change
<version>2.7.3</version>
<version>2.7.4</version>

Choose a reason for hiding this comment

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

The cyclonedx-maven-plugin-2.7.4 was released last week, more information - https://github.com/CycloneDX/cyclonedx-maven-plugin/releases/tag/cyclonedx-maven-plugin-2.7.4

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I found it doesn't work in some cases, @VinodAnandan . While helping other projects, I tried and reverted to back 2.7.3.

Could you try that in a separate PR after this PR?

Choose a reason for hiding this comment

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

@dongjoon-hyun sure, I will try 2.7.4 update in a separate PR after this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you so much, @VinodAnandan !

Copy link
Member

Choose a reason for hiding this comment

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

@dongjoon-hyun

Actually, I found it doesn't work in some cases

I'm working on improving the plugin, can you point me where 2.7.3 works but not 2.7.4? I was not supposed to introduce any regression :)

@VinodAnandan if you worked on this, I'm interested to help

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

+1, pending CI.

  • Applied patch locally.
  • Ran mvn -B -T 8 clean install -Pfull-build.
  • Verified presence of cyclonedx.json and cyclonedx.xml files under ~/.m2/repository.

@dongjoon-hyun , thanks for driving this across multiple projects! I will wait until tomorrow to commit in case anyone else wants to comment. I see they just released a new version of the plugin last week, so let me know if you intend to upgrade to 2.7.4 before I commit.

@dongjoon-hyun
Copy link
Member Author

Hi, @cnauroth . I want to keep this PR AS-IS with 2.7.3 because it's the verified version in various environments and cases.

BTW, the CI failure looks irrelevant to this PR.

[ERROR] Errors: 
[ERROR]   ReadOnlyModeTest.testConnectionEvents:202 » Timeout Failed to connect in read-...
[INFO] 
[ERROR] Tests run: 2999, Failures: 0, Errors: 1, Skipped: 4

@dongjoon-hyun
Copy link
Member Author

Thank you for review, @VinodAnandan and @cnauroth !

@cnauroth cnauroth merged commit aa8790c into apache:master Jan 12, 2023
cnauroth pushed a commit that referenced this pull request Jan 12, 2023
Reviewed-by: Vinod Anandan <vinod@owasp.org>
Signed-off-by: Chris Nauroth <cnauroth@apache.org>
(cherry picked from commit aa8790c)
cnauroth pushed a commit that referenced this pull request Jan 12, 2023
Reviewed-by: Vinod Anandan <vinod@owasp.org>
Signed-off-by: Chris Nauroth <cnauroth@apache.org>
(cherry picked from commit aa8790c)
(cherry picked from commit 23bf6bf)
@cnauroth
Copy link
Contributor

I have committed this to master, branch-3.8 and branch-3.7. @dongjoon-hyun , thank you for the patch. @VinodAnandan , thank you for code reviewing.

@dongjoon-hyun
Copy link
Member Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants