Repository navigation
build: update dependencies flagged by the scan - #67
Conversation
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]>
Reviewer's GuideThe 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 scansequenceDiagram
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
Sequence diagram for the adapted OAuth authentication error responsesequenceDiagram
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
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# 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]>
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]>
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]>
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]>
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]>
# Conflicts: # pom.xml
There was a problem hiding this comment.
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. |
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]>
Summary
Closes #60. Part of #72. Depends on #80 (#79), which is merged;
devis merged in.dev.spring-security-oauth22.5 makes its exception translator generic. The entry point adapts to that and gives the same responses..trivyignore.yaml, each with a reason and an expiry date of 2027-01-31; build: move to Spring Boot 4 #66 tracks the move.TESK_API_SWAGGER_UI_ENABLED, off by default).Scan imagenow fails on fixable critical and high findings.apt(CVE-2026-109518, a new finding in the pinned base image, fixed in the Ubuntu security updates), as foca does.Verified
./mvnw clean verifyon JDK 8 (Docker,eclipse-temurin:8-jdk), after mergingdev: 111 unit and 53 integration tests pass.docker build .; with theauthprofile, the 401 body and header are the same as before.spring-webmvc). With the entry: exit 0.Scan image(head of this PR, after the ignore entry and thedevmerge).Declined review findings
pom.xml:.trivyignore.yamland the group comment say why, and the pins go away with build: move to Spring Boot 4 #66.🤖 Generated with Claude Code