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

Properties metadata.manifest.main are no more available in json output #2702

Closed
francescomedina opened this issue Mar 8, 2024 · 2 comments
Closed
Labels
question Further information is requested

Comments

@francescomedina
Copy link

What happened:

Up to version 0.103.1 the metadata.manifest.main properties were also included in the output json. Instead, in recent versions when trying to launch syft on the same target input, they are not not inserted in the resulting json.

What you expected to happen:

Include metadata.manifest.main values into the json output

Steps to reproduce the issue:

Anything else we need to know?:

Environment:

  • Output of syft version: syft 1.0.0
  • OS (e.g: cat /etc/os-release or similar):
@francescomedina francescomedina added the bug Something isn't working label Mar 8, 2024
@wagoodman wagoodman added the needs-reproduction missing steps to reproduce or steps have not been confirmed label Mar 21, 2024
@wagoodman
Copy link
Contributor

Assuming you're referring to the java manifest metadata type, which was:

syft/syft/pkg/java.go

Lines 68 to 71 in fef0e54

type JavaManifest struct {
Main map[string]string `json:"main,omitempty"`
NamedSections map[string]map[string]string `json:"namedSections,omitempty"`
}

And is now:

syft/syft/pkg/java.go

Lines 71 to 74 in f4e1896

type JavaManifest struct {
Main KeyValues `json:"main,omitempty"`
Sections []KeyValues `json:"sections,omitempty"`
}

This was a change made in #2553 (which is the closest culprit for what you're describing).

That being said, I'm not seeing the behavior you're referring to:

$ syft cloudbees/cloudbees-core-mm:latest -o json > /tmp/core-mm.json
$ cat /tmp/core-mm.json | jq '.artifacts[] | select(.metadata.manifest.main != null)'

{
  "id": "f5da67d7d1f4d742",
  "name": "aws-java-sdk-codeguruprofiler",
  "version": "1.11.995",
  "type": "java-archive",
  "foundBy": "java-archive-cataloger",
  "locations": [
    {
      "path": "/usr/share/jenkins/jenkins.war",
      "layerID": "sha256:545b89fe82a087acefa3ce12783e1da0a1268224364c7310341e408d73985846",
      "accessPath": "/usr/share/jenkins/jenkins.war:WEB-INF/plugins/aws-java-sdk.hpi:WEB-INF/lib/aws-java-sdk-codeguruprofiler-1.11.995.jar",
      "annotations": {
        "evidence": "primary"
      }
    }
  ],
  "licenses": [],
  "language": "java",
  "cpes": [... snip...],
  "purl": "pkg:maven/com.amazonaws/aws-java-sdk-codeguruprofiler@1.11.995",
  "metadataType": "java-archive",
  "metadata": {
    "virtualPath": "/usr/share/jenkins/jenkins.war:WEB-INF/plugins/aws-java-sdk.hpi:WEB-INF/lib/aws-java-sdk-codeguruprofiler-1.11.995.jar",
    "manifest": {
      "main": [
        {
          "key": "Manifest-Version",
          "value": "1.0"
        },
        {
          "key": "Archiver-Version",
          "value": "Plexus Archiver"
        },
        {
          "key": "Built-By",
          "value": "root"
        },
        {
          "key": "Created-By",
          "value": "Apache Maven 3.5.4"
        },
        {
          "key": "Build-Jdk",
          "value": "1.8.0_171"
        }
      ]
    },
    "pomProperties": {
      "path": "META-INF/maven/com.amazonaws/aws-java-sdk-codeguruprofiler/pom.properties",
      "name": "",
      "groupId": "com.amazonaws",
      "artifactId": "aws-java-sdk-codeguruprofiler",
      "version": "1.11.995"
    },
    "digest": [
      {
        "algorithm": "sha1",
        "value": "d16a17cdb41c76ef41b6172d903db751cccda395"
      }
    ]
  }
}
...

There are a lot more examples in that output too.

Do you have any example public docker images that you can share that show this behavior? (with java packages you were expecting to have a main manifest section that you are seeing as null?)

@tgerla tgerla added question Further information is requested and removed bug Something isn't working needs-reproduction missing steps to reproduce or steps have not been confirmed labels Apr 18, 2024
@tgerla
Copy link
Contributor

tgerla commented Apr 18, 2024

Since we haven't heard back, we'll go ahead and close this issue, but if you need more help, feel free to let us know! Thanks!

@tgerla tgerla closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@github-project-automation github-project-automation bot moved this to Done in OSS Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

3 participants