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

Metadata filtering for tool in sbom #113

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lislei
Copy link
Contributor

@lislei lislei commented Feb 10, 2022

Hello Steve Springett.

I noticed the gradle plugin didn't fill inn the metadata of the tool producing the SBOM.

This pull request adds filtering capability to the gradle build.
Also, the commons-io dependency is replaced with use of the standard JDK-api.

I've successfully verified the contents of the property file as well as outputted XML and JSON files.
This produces similar data as what the maven plugin does.

What I'm uncertain of is the format of the value for "timestamp" as it is left unexpanded by the maven plugin.
The SBOM 1.4 schema doesn't specify this explicitly.
Is this field unused and to be removed or should it be formatted in a certain way?

@lislei
Copy link
Contributor Author

lislei commented Feb 10, 2022

My test produced this XML

  <metadata>
    <timestamp>2022-02-10T16:25:56Z</timestamp>
    <tools>
      <tool>
        <vendor>CycloneDX</vendor>
        <name>CycloneDX Gradle plugin</name>
        <version>1.5.0-SNAPSHOT</version>
      </tool>
    </tools>

.. and the content of the plugin property file is:

# Automatically populated by Gradle build - do not modify
vendor=CycloneDX
name=CycloneDX Gradle plugin
version=1.5.0-SNAPSHOT
timestamp=1644510352444

@@ -17,7 +16,6 @@ dependencies {
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
}
compile 'commons-codec:commons-codec:1.15'
compile 'commons-io:commons-io:2.8.0'
compile 'org.apache.maven:maven-core:3.5.0'
Copy link

Choose a reason for hiding this comment

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

Severe OSS Vulnerability:

pkg:maven/org.apache.maven/[email protected]

0 Critical, 1 Severe, 1 Moderate, 0 Unknown vulnerabilities have been found across 1 dependencies

Components
    pkg:maven/com.google.guava/[email protected]
      SEVERE Vulnerabilities (1)

        [CVE-2018-10237] Deserialization of Untrusted Data

        Unbounded memory allocation in Google Guava 11.0 through 24.x before 24.1.1 allows remote attackers to conduct denial of service attacks against servers that depend on this library and deserialize attacker-provided data, because the AtomicDoubleArray class (when serialized with Java serialization) and the CompoundOrdering class (when serialized with GWT serialization) perform eager allocation without appropriate checks on what a client has sent and whether the data size is reasonable.

        CVSS Score: 5.9

        CVSS Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

      MODERATE Vulnerabilities (1)

        [CVE-2020-8908] A temp directory creation vulnerability exists in all versions of Guava, allowin...

        A temp directory creation vulnerability exists in all versions of Guava, allowing an attacker with access to the machine to potentially access data in a temporary directory created by the Guava API com.google.common.io.Files.createTempDir(). By default, on unix-like systems, the created directory is world-readable (readable by an attacker with access to the system). The method in question has been marked @deprecated in versions 30.0 and later and should not be used. For Android developers, we recommend choosing a temporary directory API provided by Android, such as context.getCacheDir(). For other Java developers, we recommend migrating to the Java 7 API java.nio.file.Files.createTempDirectory() which explicitly configures permissions of 700, or configuring the Java runtime's java.io.tmpdir system property to point to a location whose permissions are appropriately configured.

        CVSS Score: 3.3

        CVSS Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

(at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)

Signed-off-by: Leif Lislegard <[email protected]>
Avoids resolving of all dynamic properties.
Project.findProperty(key) was introduced in Gradle 2.13 and doesn't throw an exception on property not found.

Signed-off-by: Leif Lislegard <[email protected]>
The SBOM format has a section for identifying tool used to produce the file - this was previously left empty.

Signed-off-by: Leif Lislegard <[email protected]>
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.

None yet

1 participant