Skip to content

build: update dependencies flagged by the scan - #67

Merged
uniqueg merged 12 commits into
devfrom
build/update-deps
Nov 6, 2026
Merged

uniqueg merged 12 commits into
devfrom
build/update-deps

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #60. Part of #72. Depends on #80 (#79), which is merged; dev is merged in.

  • Updates to the last open source releases of the Spring Boot 2.7 line, on Java 8, and pins the transitive dependencies that the scan flags. Fixable critical and high findings went from 75 to 13. Guava is 33.8.0, newer than the 33.7.1 on dev.
  • spring-security-oauth2 2.5 makes its exception translator generic. The entry point adapts to that and gives the same responses.
  • The 13 findings that remain are fixed only in Spring Boot 3, or in SnakeYAML 2, which the Kubernetes client can't use. They go to .trivyignore.yaml, each with a reason and an expiry date of 2027-01-31; build: move to Spring Boot 4 #66 tracks the move.
    • 12 concern code paths the app doesn't use.
    • The finding about static resources is accepted only because, since feat: make the Swagger UI optional, off by default #80, the app serves no static resources unless the Swagger UI is turned on (TESK_API_SWAGGER_UI_ENABLED, off by default).
  • Scan image now fails on fixable critical and high findings.
  • The image upgrades apt (CVE-2026-109518, a new finding in the pinned base image, fixed in the Ubuntu security updates), as foca does.

Verified

  • ./mvnw clean verify on JDK 8 (Docker, eclipse-temurin:8-jdk), after merging dev: 111 unit and 53 integration tests pass.
  • docker build .; with the auth profile, the 401 body and header are the same as before.
  • Trivy 0.75 with the ignore file but without the static resources entry: exactly one finding left (HIGH, spring-webmvc). With the entry: exit 0.
  • CI on this PR: all jobs pass, including Scan image (head of this PR, after the ignore entry and the dev merge).

Declined review findings

  • A reason per pin in pom.xml: .trivyignore.yaml and the group comment say why, and the pins go away with build: move to Spring Boot 4 #66.
  • Versionless purls in the ignore file: exact versions make an entry lapse when the version is bumped. That's on purpose.

🤖 Generated with Claude Code

uniqueg and others added 2 commits November 5, 2026 05:38
Add ci.yml as in the org's other repositories (PR title, lint, test,
smoke test, image scan, gate). The scan only reports until the
dependency update.

The base image of the Dockerfile no longer exists; build from source on
Temurin 8 instead (not Alpine: TLS handshakes fail there on Java 8).
Add a .dockerignore.

Remove the old workflows, which can't run any more and would publish
over the tag of the last release on every push to master, and Travis.

Closes #59

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move to the last releases of the Spring Boot 2.7 line, and pin the
transitive dependencies the scan flags. spring-security-oauth2 2.5
makes its exception translator generic, which the entry point adapts
to.

What is fixed only in Spring Boot 3 goes to .trivyignore.yaml, each
entry with its reason and expiry date. The scan in CI now fails on
fixable critical and high findings.

Closes #60

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

sourcery-ai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR updates the Spring Boot 2.7/Java 8 dependency baseline and pins vulnerable transitive libraries, adapts OAuth error translation for the upgraded generic API, and introduces a consolidated GitHub Actions pipeline with reproducible multi-stage Docker builds, smoke tests, and enforced Trivy scanning. Remaining incompatible vulnerabilities are recorded as exact-version, expiring exceptions.

Sequence diagram for the enforced image vulnerability scan

sequenceDiagram
    participant CI as GitHub Actions
    participant Docker as Docker build
    participant Trivy as Trivy scan
    participant Ignore as .trivyignore.yaml
    participant Gate as CI passed
    CI->>Docker: docker build
    Docker-->>CI: image
    CI->>Trivy: scan-image
    Trivy->>Ignore: read exact-version exceptions
    Ignore-->>Trivy: accepted findings with expiry
    Trivy-->>Gate: pass or fail on fixable critical/high findings
Loading

Sequence diagram for the adapted OAuth authentication error response

sequenceDiagram
    participant Client
    participant EntryPoint as CustomAuthenticationEntryPoint
    participant Translator as WebResponseExceptionTranslator
    participant Renderer as DefaultOAuth2ExceptionRenderer
    Client->>EntryPoint: unauthenticated request
    EntryPoint->>Translator: translate(authException)
    Translator-->>EntryPoint: ResponseEntity<OAuth2Exception>
    EntryPoint->>Renderer: handleHttpEntityResponse(newResult)
    Renderer-->>Client: unchanged OAuth error response
Loading

File-Level Changes

Change Details Files
Modernize dependency versions while remaining on Java 8 and Spring Boot 2.7, using explicit dependency-management overrides to reduce vulnerable transitive packages.
  • Upgrade Spring Boot and selected Spring, Tomcat, logging, Jackson, Guava, and OAuth dependencies to their final compatible releases.
  • Pin vulnerable transitive libraries, including protobuf, Commons, JOSE4J, and Bouncy Castle, with matching cryptography module versions.
  • Retain SnakeYAML 1.x for Kubernetes-client compatibility and document the Spring Boot 3/SnakeYAML 2 migration constraint.
pom.xml
Adapt OAuth error handling to the generic exception translator introduced by the upgraded OAuth dependency without changing the externally returned error response.
  • Type the translator as WebResponseExceptionTranslator.
  • Handle the translated response through a wildcard response entity and extract the OAuth exception before building the existing error payload.
src/main/java/uk/ac/ebi/tsc/tesk/config/security/CustomAuthenticationEntryPoint.java
Replace the previous CI configuration with a consolidated GitHub Actions pipeline that validates code, containers, and vulnerability status.
  • Run title validation, workflow linting, Java 8 tests, Docker smoke tests in default and auth profiles, and image scanning.
  • Make the scan fail on fixable critical/high findings and aggregate all job results through a required CI gate.
  • Pin third-party actions and container tooling, configure concurrency, permissions, Dependabot updates, and fork-safe SARIF uploads.
.github/workflows/ci.yml
.github/dependabot.yml
.github/workflows/docker-build-publish.yml
.github/workflows/maven-check.yml
.github/workflows/maven-publish.yml
.travis.yml
Make the Docker build self-contained and reproducible with pinned Java 8 builder/runtime images.
  • Build the Maven application inside a multi-stage Dockerfile instead of requiring a prebuilt target artifact.
  • Pin the Eclipse Temurin images by digest and copy only the packaged application into the runtime image.
Dockerfile
.dockerignore
Document and manage the remaining vulnerabilities as narrowly scoped, time-limited exceptions.
  • Ignore only exact affected Maven package versions, with a reason and 2027-01-31 expiry for each accepted finding.
  • Explain the compatibility and application-scope rationale for findings deferred until Spring Boot 3 or SnakeYAML 2.
.trivyignore.yaml
Update project documentation to reflect GitHub Actions CI and the new build workflow.
  • Replace the Travis badge with the GitHub Actions badge.
  • Document Java 8 verification and self-contained Docker image builds.
README.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.29%. Comparing base (6411597) to head (1bc3c42).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev      #67   +/-   ##
=======================================
  Coverage   56.29%   56.29%           
=======================================
  Files          66       66           
  Lines        2167     2167           
  Branches      236      236           
=======================================
  Hits         1220     1220           
  Misses        806      806           
  Partials      141      141           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 5, 2026 05:07

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".trivyignore.yaml" line_range="54" />
<code_context>
+    purls: ["pkg:maven/org.springframework/[email protected]"]
+    statement: Concerns JavaScriptUtils; the app doesn't use it
+    expired_at: 2027-01-31
+  - id: CVE-2026-41842
+    purls: ["pkg:maven/org.springframework/[email protected]"]
+    statement: Denial of service when resolving static resources, of which the app only has the Swagger UI (public, also with the auth profile); no code execution or data access
</code_context>
<issue_to_address>
**Public Swagger paths permit DoS**

When an unauthenticated remote caller sends a crafted request to a public Swagger UI or webjar static-resource path, spring MVC 5.3.39 resolves the public static-resource path through the vulnerable resolver, allowing requests to consume service resources and deny the API to other callers.

Upgrade to a Spring Framework version that fixes CVE-2026-41842, or prevent untrusted callers from reaching the vulnerable static-resource resolver.
</issue_to_address>

Linked issues

#60 build: update dependencies flagged by the scan · 3 of 3 met

# Requirement Status Notes
1 Update dependencies as far as the Java 8 and Spring Boot 2.7 line allows, with the existing tests passing. ✅ Met pom.xml updates Spring Boot to 2.7.18 and pins newer compatible dependencies; the CI test job runs ./mvnw -B clean verify on Java 8.
2 Record what can't be fixed on that line in .trivyignore.yaml, with a reason and an expiry date. ✅ Met The ignore file lists the remaining findings with version-scoped package URLs, a reason, and an expiry date for each.
3 Switch the CI scan to fail on fixable critical and high findings. ✅ Met The CI scan uses the pinned shared scan-image action, and the workflow specifies failure on fixable critical and high vulnerabilities.

Sourcery assessment

Needs a human reviewer. 1 finding to address first, the security scan did not finish, and the Spring Security and OAuth upgrades, together with the changed authentication exception handling, could introduce a regression in how protected requests are handled; any data exposed during that time would not be made private by reverting. Reverting would restore the previous dependencies and handler, but not undo such exposure.

Blocking findings: .trivyignore.yaml:54


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .trivyignore.yaml Resolved
uniqueg and others added 3 commits November 6, 2026 04:56
Align CI with the branching model of the org's other repositories
(`dev` + `main`): run on pull requests and pushes to `dev`; on pushes,
push the image by digest in the environment `dev-images`, scan exactly
that digest, then attest, sign and tag it `dev` and `sha-<commit>`, as
cloud-registry does. Add the weekly scan of `latest` (`scan.yml`), let
Dependabot target `dev`, and fail pushes on Codecov upload errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Publish only on pushes to this repository, or to forks that set
`DOCKERHUB_ORG` (`PUBLISH`, as in proTES and foca): other runs scan a
local build, upload nothing to code scanning and don't fail on Codecov
upload errors, and the gate allows the skipped publishing jobs. Name
the environment and secrets publishing needs in the README, and fix
comments from the review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg and others added 3 commits November 6, 2026 05:37
# Conflicts:
#	.github/workflows/ci.yml
# Conflicts:
#	.github/workflows/ci.yml
#	.trivyignore.yaml
The pinned base image has apt with CVE-2026-109518, which has a fix in
the Ubuntu security updates; foca does the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg added a commit that referenced this pull request Nov 6, 2026
Restore the files of #67 to their state on `dev`, so that this pull
request no longer depends on #67, which waits for a decision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg added a commit that referenced this pull request Nov 6, 2026
Restore the files of #67 to their state on `dev`, so that this pull
request no longer depends on #67, which waits for a decision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg added a commit that referenced this pull request Nov 6, 2026
Restore the files of #67 to their state on `dev`, so that this pull
request no longer depends on #67, which waits for a decision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg and others added 2 commits November 6, 2026 14:33
The finding concerns static resources, which the app serves: keep it
reported until they can be turned off.

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Linked issues

#60 build: update dependencies flagged by the scan · 2 of 3 met

# Requirement Status Notes
1 Update dependencies as far as the Java 8 and Spring Boot 2.7 line allows, with existing tests passing. ✅ Met Updates the Spring Boot parent to 2.7.18 and pins the listed transitive dependencies; CI is configured to run ./mvnw -B clean verify on Java 8.
2 Record what cannot be fixed on that line in .trivyignore.yaml, with a reason and expiry date. 🟡 Partly met The ignore entries include reasons and expiry dates, but the two Spring MVC static-resource findings are suppressed even though a commit message says the app serves static resources and the finding should remain reported.
3 Make the CI scan fail on fixable critical and high findings. ✅ Met Removes fail: "false"; the workflow comments describe the scan failing on fixable critical and high vulnerabilities.

Comment thread .trivyignore.yaml Resolved
uniqueg and others added 2 commits November 6, 2026 16:06
The app serves no static resources unless the Swagger UI is turned on
(TESK_API_SWAGGER_UI_ENABLED, off by default; #79).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 8d80dd7 into dev Nov 6, 2026
34 checks passed
@uniqueg
uniqueg deleted the build/update-deps branch November 6, 2026 15:19
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.

build: update dependencies flagged by the scan

1 participant