GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(scan): scan jar, war and ear targets by their bundled Maven metadata by jfblaa · Pull Request #1701 · SocketDev/socket-cli

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

LLM Description written by Claude Code:claude-opus-5-5

Prototype: socket scan create app.war (without --reach) now writes app.war.socket.facts.json next to the archive from the Maven metadata bundled in it, and uploads it with the scan. --reach on archives is out of scope; its design is still open.

How

  • A small Java 8 loader (manifest/scripts/archive-loader) walks the archive and its nested archives with java.util.zip, without extracting them. It reads each META-INF/maven/*/*/pom.properties with java.util.Properties and emits records. The TS side (generate-archive-facts.mts) decides what they mean and assembles the facts.
  • The jar is built like the Maven extension jar (pnpm run build:archive-loader, publish workflow). A published build fails closed without it.
  • An archive target therefore needs Java 8+, from JAVA_HOME or PATH. Without it the scan fails, as a Maven build without mvn does.

Identification rules

  • The archive is the project. Every library identified in it is a direct dependency (containment, as Syft reports it; Trivy emits no edges for jars).
  • A nested archive is identified by the pom.properties whose coordinate its file name spells out: Trivy's rule, extended to classifiers, timestamped snapshots, wars and ears. Archives without a match are listed as unidentified. There is no SHA-1 or file-name lookup.
  • Libraries shaded into the scanned archive itself are reported. Libraries bundled inside a dependency jar (shaded pom.properties, jars in jars) are not, until the SBOM schema can mark bundled libraries (REA-890).
  • --exclude-paths applies. .gitignore and projectIgnorePaths do not hide an archive named as a target. The archive must be inside cwd.

Open questions

  • A renamed archive (e.g. ROOT.war) cannot be matched to its own pom.properties. It becomes a generic project, and its own coordinate is reported as one of its dependencies.
  • The facts file has no metadata: tool is limited to build tools, so stamping the CLI version needs a schema decision.
  • The facts file stays next to the archive, so a later directory scan picks up a stale copy.
  • Jars built without Maven metadata (Gradle, Ant) are not identified.

Verification

  • Unit tests (record → facts rules) and an e2e test running the loader jar on generated archives.
  • Facts for real war and jar artifacts from Maven Central pass depscan's parseSocketFacts with no validation alerts.
  • The loader gives identical output on a Java 8 and a Java 21 runtime.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jfblaa @claude
feat(scan): scan jar, war and ear targets by their bundled Maven meta…
3fc7cc3
…data

`socket scan create` now accepts a .jar, .war or .ear as a target (not with
--reach). A small Java 8 loader walks the archive and its nested archives with
java.util.zip and reads each META-INF/maven/*/*/pom.properties with
java.util.Properties; the CLI then writes `<archive>.socket.facts.json` next to
the archive and uploads it with the scan.

- The archive is the project; every library it ships is a direct dependency.
- A nested archive is identified by the pom.properties its file name spells
  out (classifiers and timestamped snapshots included).
- Libraries bundled inside a dependency jar are not reported until the SBOM
  schema can mark bundled libraries.
- --exclude-paths applies; .gitignore and projectIgnorePaths do not hide an
  archive the user named.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jfblaa
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.