Skip to content

Spring Boot Actuator "manifest" endpoint #22924

New issue

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

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

Already on GitHub? # to your account

Closed
philsttr opened this issue Aug 12, 2020 · 13 comments
Closed

Spring Boot Actuator "manifest" endpoint #22924

philsttr opened this issue Aug 12, 2020 · 13 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@philsttr
Copy link

I'd like an actuator endpoint that shows details of the jars that are included in the spring boot application.

Perhaps the endpoint id could be "manifest".

Some examples of things that could be discovered and reported for each jar:

  • jar filename
  • Identifying details from META-INF/MANIFEST.MF (subset of main attributes. no per-entry attributes)
    • Name
    • Automatic-Module-Name
    • Specification-Title/Version
    • Implementation-Title/Version
  • Identifying details from META-INF/**/pom.properties
    • version
    • groupId
    • artifactId

I haven't fully thought through all the intricacies, so I'm happy to discuss further.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 12, 2020
@wilkinsona
Copy link
Member

Thanks for the suggestion. This seems, somewhat at least, similar to #1465.

@philwebb
Copy link
Member

It's also somewhat related to the existing InfoEndpoint/InfoContributor areas. I've generally preferred git info for this kind of thing. The git sha doesn't give much away if it's accidentally exposed, but you can use it to discover exactly what was in your jar at the time it was created.

@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Aug 14, 2020
@philsttr
Copy link
Author

@philwebb, Yes, I agree that given a git sha and/or app version from the info endpoint, you can do additional detective work to figure out what was packaged within an app. i.e. look at some report (if it exists) from the app build output for the specific version, or go grab the artifact and peek inside it.

I'm looking to short-circuit that detective work by just obtaining that info from the running app instance, since it has absolute knowledge about the jars in the app.

Currently, actuator exposes information on A) the beans that are running (beans endpoint), and B) the configuration (env endpoint). The next logical extension is to add a third dimension... C) the version of those beans. With those three dimensions, I can have a complete view of a running instance. And yes, as mentioned, C can currently be derived from app version from the info endpoint, but it takes some additional detective work. I'd love if it was a bit easier.

Thanks for considering this feature!

@philwebb philwebb added status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Aug 24, 2020
@philwebb philwebb added this to the General Backlog milestone Aug 24, 2020
philsttr added a commit to philsttr/spring-boot that referenced this issue Feb 9, 2021
Adds a libraries actuator endpoint that displays details about the libraries used by the application.
Provides out-of-the-box support for displaying details about Java libraries that are bundled within the application jar/war archive.

The spring-boot-maven-plugin and spring-boot-gradle-plugin now generate a META-INF/bundled-libraries.yaml file when they package the application archive.
The file is included in the packaged application archive.

At runtime, libraries are contributed to the libraries endpoint via LibrariesContributor beans, similar to how InfoContributers contribute to the info endpoint.

spring-boot-actuator-autoconfigure auto-configures a LibrariesContributor that adds the libraries from META-INF/bundled-libraries.yaml to the libraries endpoint.
This auto-configuration can be disabled using environment properties similar to how other actuator endpoints behave.

An application can provide other LibrariesContributor instances to contribute more libraries to the libraries endpoint.
For example, an application might want to contribute libraries dynamically added at runtime.
Or an application might want to contribute details about front-end libraries.

Each Library is described as a simple set of key/value pairs.
For example, Java libraries with coordinates in a Maven repository typically contain entries for `groupId`, `artifactId`, and `version`.

Fixes spring-projects#22924
philsttr added a commit to philsttr/spring-boot that referenced this issue Feb 15, 2021
Adds a libraries actuator endpoint that displays details about the libraries used by the application.
Provides out-of-the-box support for displaying details about Java libraries that are bundled within the application jar/war archive.

The spring-boot-maven-plugin and spring-boot-gradle-plugin now generate a META-INF/bundled-libraries.yaml file when they package the application archive.
The file is included in the packaged application archive.

At runtime, libraries are contributed to the libraries endpoint via LibrariesContributor beans, similar to how InfoContributers contribute to the info endpoint.

spring-boot-actuator-autoconfigure auto-configures a LibrariesContributor that adds the libraries from META-INF/bundled-libraries.yaml to the libraries endpoint.
This auto-configuration can be disabled using environment properties similar to how other actuator endpoints behave.

An application can provide other LibrariesContributor instances to contribute more libraries to the libraries endpoint.
For example, an application might want to contribute libraries dynamically added at runtime.
Or an application might want to contribute details about front-end libraries.

Each Library is described as a simple set of key/value pairs.
For example, Java libraries with coordinates in a Maven repository typically contain entries for `groupId`, `artifactId`, and `version`.

Fixes spring-projects#22924
philsttr added a commit to philsttr/spring-boot that referenced this issue Feb 15, 2021
Adds a libraries actuator endpoint that displays details about the libraries used by the application.
Provides out-of-the-box support for displaying details about Java libraries that are bundled within the application jar/war archive.

The spring-boot-maven-plugin and spring-boot-gradle-plugin now generate a META-INF/bundled-libraries.yaml file when they package the application archive.
The file is included in the packaged application archive.

At runtime, libraries are contributed to the libraries endpoint via LibrariesContributor beans, similar to how InfoContributers contribute to the info endpoint.

spring-boot-actuator-autoconfigure auto-configures a LibrariesContributor that adds the libraries from META-INF/bundled-libraries.yaml to the libraries endpoint.
This auto-configuration can be disabled using environment properties similar to how other actuator endpoints behave.

An application can provide other LibrariesContributor instances to contribute more libraries to the libraries endpoint.
For example, an application might want to contribute libraries dynamically added at runtime.
Or an application might want to contribute details about front-end libraries.

Each Library is described as a simple set of key/value pairs.
For example, Java libraries with coordinates in a Maven repository typically contain entries for `groupId`, `artifactId`, and `version`.

Fixes spring-projects#22924
philsttr added a commit to philsttr/spring-boot that referenced this issue Feb 16, 2021
Adds a libraries actuator endpoint that displays details about the libraries used by the application.
Provides out-of-the-box support for displaying details about Java libraries that are bundled within the application jar/war archive.

The spring-boot-maven-plugin and spring-boot-gradle-plugin now generate a META-INF/bundled-libraries.yaml file when they package the application archive.
The file is included in the packaged application archive.

At runtime, libraries are contributed to the libraries endpoint via LibrariesContributor beans, similar to how InfoContributers contribute to the info endpoint.

spring-boot-actuator-autoconfigure auto-configures a LibrariesContributor that adds the libraries from META-INF/bundled-libraries.yaml to the libraries endpoint.
This auto-configuration can be disabled using environment properties similar to how other actuator endpoints behave.

An application can provide other LibrariesContributor instances to contribute more libraries to the libraries endpoint.
For example, an application might want to contribute libraries dynamically added at runtime.
Or an application might want to contribute details about front-end libraries.

Each Library is described as a simple set of key/value pairs.
For example, Java libraries with coordinates in a Maven repository typically contain entries for `groupId`, `artifactId`, and `version`.

Fixes spring-projects#22924
philsttr added a commit to philsttr/spring-boot that referenced this issue Feb 28, 2021
Adds a libraries actuator endpoint that displays details about the libraries used by the application.
Provides out-of-the-box support for displaying details about Java libraries that are bundled within the application jar/war archive.

The spring-boot-maven-plugin and spring-boot-gradle-plugin now generate a META-INF/bundled-libraries.yaml file when they package the application archive.
The file is included in the packaged application archive.

At runtime, libraries are contributed to the libraries endpoint via LibrariesContributor beans, similar to how InfoContributers contribute to the info endpoint.

spring-boot-actuator-autoconfigure auto-configures a LibrariesContributor that adds the libraries from META-INF/bundled-libraries.yaml to the libraries endpoint.
This auto-configuration can be disabled using environment properties similar to how other actuator endpoints behave.

An application can provide other LibrariesContributor instances to contribute more libraries to the libraries endpoint.
For example, an application might want to contribute libraries dynamically added at runtime.
Or an application might want to contribute details about front-end libraries.

Each Library is described as a simple set of key/value pairs.
For example, Java libraries with coordinates in a Maven repository typically contain entries for `groupId`, `artifactId`, and `version`.

Fixes spring-projects#22924
@wilkinsona
Copy link
Member

wilkinsona commented Mar 9, 2021

Via some discussions with the Maven Central folks, I was recently reminded of various efforts to define a software bill-of-materials (sbom) standard. It's a bit like a Maven bom, but with much broader scope. An sbom can be used to describe all of the components that comprise an application, for example. https://cyclonedx.org is one example of an sbom format. https://www.ntia.gov/SBOM and https://spdx.dev have also been mentioned. AIUI, CycloneDX builds upon the latter.

Given that one goal of an sbom is to describe all of the components that comprise an application and the dependencies between them, I can see this being tackled, at least in part, by a Maven or Gradle plugin that isn't specific to Spring Boot. Such a plugin already exists for CycloneDX when using Maven. A Boot endpoint could then serve the sbom exactly as generated by the build, or perhaps augment it with additional information about the operating system and the like.

I'm not sure what timescale that various sbom efforts are working on, but I think it would be a shame to ship something that's proprietary unless those efforts are a really long way out. CycloneDX is already publishing a versioned spec that appears to meet the needs of what's described here.

@wilkinsona
Copy link
Member

On the SBOM front, courtesy of this tweet from Kelsey Hightower, I learned that Go 1.8 has some built-in support to help with producing an SBOM. Go isn't, as far as I can tell, aligning with any particular format. It's just making the information needed to produce an SBOM more accessible.

@philwebb
Copy link
Member

See also PR #28884 which we'll want to consider when we implement this.

@scottfrederick
Copy link
Contributor

Also on the SBOM front, Cloud Native Buildpacks is adopting standardized SBOM formats for Docker images. Buildpacks have contributed BOM information in a custom format for a while, but they are adopting both CycloneDX and SPDX as standardized formats going forward.

@maciejwalkowiak
Copy link
Contributor

maciejwalkowiak commented Jul 25, 2022

Just in case anyone finds it useful (cc @BigMichi1), I wrote a piece on how to include CycloneDX SBOM or just a list of the dependencies in Spring Boot actuator. If you believe that this implementation make sense I can contribute it as a PR.

https://maciejwalkowiak.com/blog/maven-dependencies-spring-boot-actuator-info/

@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 26, 2022
@wilkinsona
Copy link
Member

Via @markfisher, I've just learned that Microsoft have open sourced their SBOM tooling. It's said to work with both Maven and Gradle and uses the SPDX format.

@bclozel
Copy link
Member

bclozel commented Jul 27, 2022

For people interested in the Maven/Gradle aspect of this, it looks like sbom-tool supports Maven and Gradle thanks to the component-detection project. As far as I understand, it's looking at pom.xml files for maven and *.lockfile for Gradle.

@wilkinsona
Copy link
Member

and *.lockfile for Gradle

That's an interesting choice. Not all projects will use Gradle's dependency locking.

@philwebb philwebb removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Aug 22, 2022
@tubbynl
Copy link

tubbynl commented Oct 10, 2023

relevant blog on this topic;
https://blog.sonatype.com/comparing-sbom-standards-spdx-vs.-cyclonedx-vs.-swid

TLDR; SPDX is not as complete as CycloneDX, SonaType uses CycloneDX but also participates in the SPDX Working Group and is awaiting the SPDX v3.0 specification

i hope those 2 standard merge :)

@mhalbritter
Copy link
Contributor

Spring Boot 3.3.0 contains an SBOM actuator endpoint, which provides the information about included dependencies, their versions, etc.

@mhalbritter mhalbritter closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@mhalbritter mhalbritter added status: superseded An issue that has been superseded by another and removed type: enhancement A general enhancement status: pending-design-work Needs design work before any code can be developed labels May 29, 2024
@mhalbritter mhalbritter removed this from the General Backlog milestone May 29, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants