Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/container-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Container Vulnerability Scanning

on:
pull_request:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '0 2 * * 1' # weekly scan, every Monday 02:00 UTC
Expand Down Expand Up @@ -37,7 +40,7 @@ jobs:
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #v7.0.0
with:
# renovate: datasource=python-version depName=python
python-version: '3.14.7'
python-version: '3.15.0'

- name: Build Docker image
run: docker build -t ${{ env.IMAGE_NAME }} .
Expand All @@ -63,7 +66,7 @@ jobs:

- name: Upload merged SARIF to GitHub Security tab
if: ${{ !cancelled() && hashFiles(env.CONTAINER_SCAN_MERGED_SARIF_OUTPUT) != '' }}
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.2
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: ${{ env.CONTAINER_SCAN_MERGED_SARIF_OUTPUT }}
category: container-scan
Expand Down Expand Up @@ -91,7 +94,7 @@ jobs:

- name: Upload encrypted SARIF artifact
if: ${{ !cancelled() && steps.encrypt.outputs.encrypted != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: container-scan-sarif-report
path: ${{ steps.encrypt.outputs.encrypted }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e #v4.3.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 #v4.4.1

- name: Harbor connectivity probe
run: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
${{ runner.os }}-buildx-backend-

- name: Build BACKEND docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a #v7.3.0
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc #v7.4.0
with:
context: .
file: ./Dockerfile
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/sast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Static Application Security Testing (SAST)

on:
pull_request:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '0 2 * * 1' # weekly scan, every Monday 02:00 UTC
Expand Down Expand Up @@ -29,7 +32,7 @@ jobs:
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #v7.0.0
with:
# renovate: datasource=python-version depName=python
python-version: '3.14.7'
python-version: '3.15.0'

- name: Setup tools
run: bash ci/setup-tools.sh --install-tool opengrep,semgrep-rules
Expand All @@ -39,7 +42,7 @@ jobs:

- name: Upload SARIF to GitHub Security tab
if: ${{ !cancelled() && hashFiles(env.OPENGREP_SARIF_OUTPUT) != '' }}
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.2
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: ${{ env.OPENGREP_SARIF_OUTPUT }}
category: semgrep-app
Expand Down Expand Up @@ -67,7 +70,7 @@ jobs:

- name: Upload encrypted SARIF artifact
if: ${{ !cancelled() && steps.encrypt.outputs.encrypted != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sast-scan-sarif-report
path: ${{ steps.encrypt.outputs.encrypted }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/sca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Software Composition Analysis (SCA)

on:
pull_request:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '0 2 * * 1' # weekly SCA scan, every Monday 02:00 UTC
Expand Down Expand Up @@ -32,7 +35,7 @@ jobs:
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #v7.0.0
with:
# renovate: datasource=python-version depName=python
python-version: '3.14.7'
python-version: '3.15.0'

- name: Cache Maven packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Expand All @@ -49,7 +52,7 @@ jobs:

- name: Upload merged SARIF to GitHub Security tab
if: ${{ !cancelled() && hashFiles(env.SCA_MERGED_SARIF_OUTPUT) != '' }}
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.2
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: ${{ env.SCA_MERGED_SARIF_OUTPUT }}
category: sca-app
Expand Down Expand Up @@ -77,7 +80,7 @@ jobs:

- name: Upload encrypted SARIF artifact
if: ${{ !cancelled() && steps.encrypt.outputs.encrypted != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sca-scan-sarif-report
path: ${{ steps.encrypt.outputs.encrypted }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install gitleaks
run: bash ci/setup-tools.sh --install-tool gitleaks
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Upload SARIF to code scanning
if: always()
uses: github/codeql-action/upload-sarif@c35d1b164463ee62a100735382aaaa525c5d3496 #v2.25.6
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: ${{ env.GITLEAKS_SARIF_OUTPUT }}
category: gitleaks
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This repository contains the Spring Boot backend for the Medical Informatics Pla
## Stack
- Language/runtime: Java 21.
- Build/package manager: Maven (`pom.xml`); no Maven wrapper is committed.
- Frameworks/libraries: Spring Boot 4.1.1, Spring Security 7, OAuth2 client/resource server, Spring Data JPA, Hibernate, Flyway, Gson, Log4j2, springdoc OpenAPI.
- Frameworks/libraries: Spring Boot 4.1.2, Spring Security 7, OAuth2 client/resource server, Spring Data JPA, Hibernate, Flyway, Gson, Log4j2, springdoc OpenAPI.
- Database: PostgreSQL, configured through Spring datasource properties.
- Auth: Keycloak/OIDC when `authentication.enabled` is enabled; anonymous development mode exists when disabled.
- External services: Exaflow endpoints for algorithms, data models, metadata, dataset variables, and algorithm execution.
Expand Down
14 changes: 7 additions & 7 deletions ci/setup-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ trap 'echo "[setup-tools] ERROR: command failed (exit $?) at line $LINENO: $BASH
# *_SHA256 must be overridden as well or verification will fail.

# renovate: datasource=github-release-attachments depName=aquasecurity/trivy
TRIVY_VERSION="${TRIVY_VERSION:-v0.74.0}"
TRIVY_SHA256="${TRIVY_SHA256:-2ae6fe3ee734b7fdf11335663e18c75ea12dccc76062f09f164a3b0f8be4371a}"
TRIVY_VERSION="${TRIVY_VERSION:-v0.76.0}"
TRIVY_SHA256="${TRIVY_SHA256:-e24b1c51293c1b15e4ba8d45bbc7891ba053f90278ec2698f3562c993e145fe7}"

# renovate: datasource=github-release-attachments depName=google/osv-scanner
OSV_SCANNER_VERSION="${OSV_SCANNER_VERSION:-v2.5.1}"
OSV_SCANNER_SHA256="${OSV_SCANNER_SHA256:-f9f25499a2c8cc367b3af45df2ea7eeca7fbccceab9c35079968f4b3652194be}"
OSV_SCANNER_VERSION="${OSV_SCANNER_VERSION:-v2.7.0}"
OSV_SCANNER_SHA256="${OSV_SCANNER_SHA256:-160c6253e2922e9e0a6a9771c5c4c40a4b3c6090b34a3cdd5e80c96cc2e4218b}"

# renovate: datasource=github-release-attachments depName=opengrep/opengrep
OPENGREP_VERSION="${OPENGREP_VERSION:-v1.30.0}"
OPENGREP_SHA256="${OPENGREP_SHA256:-35779bdd72e92129c8df2a77f0c55e8c08356801ea92591ef32108d6b28d564c}"
OPENGREP_VERSION="${OPENGREP_VERSION:-v1.31.0}"
OPENGREP_SHA256="${OPENGREP_SHA256:-dbbe3c2058dbe600c449a8ba22ea79a1643a6660658400090d0323a8d0d31147}"

# renovate: datasource=git-refs depName=https://github.com/semgrep/semgrep-rules
SEMGREP_RULES_REF="${SEMGREP_RULES_REF:-40b8c63f75dc7c22c8a77482d73bfb864b146f7e}"
SEMGREP_RULES_REF="${SEMGREP_RULES_REF:-17e31e11ebac99fb7dfe1cd288f7a32151b6f3f9}"
SEMGREP_RULES_DIR="semgrep-rules"

# renovate: datasource=github-release-attachments depName=hadolint/hadolint
Expand Down
16 changes: 16 additions & 0 deletions docs/context/decision-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ Files affected: `ci/setup-tools.sh`, `.github/workflows/sca.yml`, `.github/workf

Date: 2026-09-15

### Decision: Upgrade to Spring Boot 4.1.2 and refresh CI pins (October 2026)

Status: Verified locally / needs one CI run

Context: Routine "everything to latest, zero vulnerabilities" pass. Before the change the CycloneDX SBOM already scanned clean (Trivy v0.76.0 and osv-scanner v2.7.0: 0 findings), but Boot, several pinned libraries, four action pins and three scanner pins had newer releases.

Decision: Boot parent 4.1.1 -> 4.1.2 (Spring Framework 7.0.10, Security 7.1.2, Data 2026.0.2, Tomcat 11.0.27), Hibernate 7.4.8.Final -> 7.4.13.Final, Flyway 13.6.0 -> 13.11.1, PostgreSQL JDBC 42.7.13 -> 42.7.14, nimbus-jose-jwt 10.9.1 -> 10.10, Jackson BOMs 2.22.3 / 3.2.3 -> 2.22.4 / 3.2.4. The `tomcat.version` 11.0.25 override is removed because Boot 4.1.2 manages 11.0.27 (newest release, includes the CVE-2026-65905 / CVE-2026-65182 / CVE-2026-68525 fixes). CI: `upload-sarif` -> v4.39.0 everywhere (gitleaks was still on deprecated v2.25.6), `checkout` v6.0.3 -> v7.0.1 in secrets-scan, `upload-artifact` -> v7.0.2, `setup-buildx-action` -> v4.4.1, `build-push-action` -> v7.4.0, Python 3.14.7 -> 3.14.8, Trivy -> v0.76.0, osv-scanner -> v2.7.0, OpenGrep -> v1.31.0, semgrep-rules -> `17e31e11`. Releases younger than the 7-day cooldown (codeql-action v4.39.1, setup-python v7.1.0, Python 3.14.9, Trivy v0.76.1, OpenGrep v1.32.0) are intentionally not taken. Prereleases (Boot 4.2.0-RC1, Hibernate 8.0.0.Beta3, Jakarta Persistence 4.0.0-M7) and Java 25 stay out.

Consequences: No API, schema or config changes. Flyway 13.6 -> 13.11 is a minor bump of the programmatic API only. The Docker base images (`maven:3.9.16-amazoncorretto-21`, `amazoncorretto:21-alpine3.24`) are already the newest tags and the runtime base scans clean with Trivy.

Validation: `mvn -B -ntp verify` passed 75/75 tests on Temurin 21.0.13 + Maven 3.9.16. Trivy (SBOM and `fs`) and osv-scanner (SBOM and `pom.xml`) report 0 findings before and after. Hadolint v2.15.1 and OpenGrep v1.31.0 pass the container and app SAST gates against the new rules ref. `docker build` and the GitHub runner were not exercised locally (no Docker daemon).

Files affected: `pom.xml`, `ci/setup-tools.sh`, `.github/workflows/*.yml`, `AGENTS.md`, `docs/context/risk-register.md`

Date: 2026-10-23

### Decision: Save a studio run without executing it again

Status: Accepted
Expand Down
1 change: 0 additions & 1 deletion docs/context/risk-register.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
| Repository mirroring | Mirror workflow can publish refs to EBRAINS GitLab | `.github/workflows/ebrains.yml` | Review branch/tag triggers and token usage | Yes |
| Dependency updates | Framework/security/library upgrades can change runtime behavior | `pom.xml` | Explain need, run Maven checks, and consider Docker build | Yes |
| Token-heavy tool output | Broad file dumps, full logs, or unbounded diffs can exhaust agent context and hide relevant facts | Agent workflow instructions in `AGENTS.md` and `docs/context/conventions.md` | Use bounded searches and summaries; require approval before high-output commands | Yes |
| Tomcat pinned ahead of the Boot BOM | `pom.xml` pins Tomcat 11.0.25 over Spring Boot 4.1.1's 11.0.24; deleting the override re-exposes CVE-2026-65905, CVE-2026-65182 and CVE-2026-68525 | `pom.xml` | Keep until the Boot BOM manages >= 11.0.25, then drop the override and re-run the dependency scan | No |
23 changes: 9 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,31 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<postgresql.version>42.7.13</postgresql.version>
<!-- Security: Boot 4.1.1 manages Tomcat 11.0.24, which carries CVE-2026-65905,
CVE-2026-65182 and CVE-2026-68525 (DIGEST/FORM auth bypass). 11.0.25 is the
first fixed 11.0.x and is still the newest release. Drop this override when
the Boot BOM manages >= 11.0.25. -->
<tomcat.version>11.0.25</tomcat.version>
<postgresql.version>42.7.14</postgresql.version>
<jakarta.version>3.2.0</jakarta.version>
<hibernate.version>7.4.8.Final</hibernate.version>
<hibernate.version>7.4.13.Final</hibernate.version>
<!-- Flyway is used programmatically in PersistenceConfiguration (no Boot Flyway
auto-config on the classpath), so it floats ahead of the Boot BOM (12.4.0). -->
<flyway-core.version>13.6.0</flyway-core.version>
auto-config on the classpath), so it floats ahead of the Boot BOM (12.4.0 in Boot 4.1.2). -->
<flyway-core.version>13.11.1</flyway-core.version>
<gson.version>2.14.0</gson.version>
<commons-dbcp.version>2.14.0</commons-dbcp.version>
<springdoc-openapi-starter-webmvc-ui.version>3.1.1</springdoc-openapi-starter-webmvc-ui.version>
<lombok.version>1.18.48</lombok.version>
<snakeyaml.version>2.7</snakeyaml.version>
<nimbus-jose-jwt.version>10.9.1</nimbus-jose-jwt.version>
<nimbus-jose-jwt.version>10.10</nimbus-jose-jwt.version>
<!-- Security: jackson-databind <= 2.21.4 and 3.x < 3.1.5 are affected by
CVE-2026-59889 / GHSA-5gvw-p9qm-jgwh (@JsonView bypass on @JsonUnwrapped
deserialization). 2.22.0-2.22.2 and 3.2.0-3.2.2 are in turn affected by
GHSA-7hhh-6rmp-j9qf, GHSA-p6pp-m3f8-5c89, GHSA-cxp5-3px4-pw24 and
GHSA-wv8q-qhhj-9h54 (parser/databind DoS). 2.22.3 and 3.2.3 fix all of them. -->
<jackson-2-bom.version>2.22.3</jackson-2-bom.version>
<jackson-bom.version>3.2.3</jackson-bom.version>
GHSA-wv8q-qhhj-9h54 (parser/databind DoS). 2.22.3 and 3.2.3 fix all of them; 2.22.4 / 3.2.4 are the latest patches. -->
<jackson-2-bom.version>2.22.4</jackson-2-bom.version>
<jackson-bom.version>3.2.4</jackson-bom.version>
</properties>

<dependencies>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/hbp/mip/datamodel/DataModelDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public static class CommonDataElementDTO {
private String code;
private String label;
private String description;
private String sql_type;
private String is_categorical;
@Setter
private List<DataModelDTO.EnumerationDTO> enumerations;
private String minValue;
Expand Down
22 changes: 17 additions & 5 deletions src/main/java/hbp/mip/datamodel/DataModelService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.lang.reflect.Type;
import java.util.*;
import java.util.stream.Collectors;

@Service
public class DataModelService {
Expand Down Expand Up @@ -127,19 +128,30 @@ private List<DataModelDTO> getAggregatedDataModelDTOs(Logger logger) {
return dataModelDTOs;
}

private Map<String, List<String>> selectDatasetVariables(Map<String, Map<String, List<String>>> datasetVariablesByDataModel, DataModelDTO dataModel) {
static Map<String, List<String>> selectDatasetVariables(Map<String, Map<String, List<String>>> datasetVariablesByDataModel, DataModelDTO dataModel) {
if (datasetVariablesByDataModel == null || dataModel == null) {
return Collections.emptyMap();
}

String versionedKey = dataModel.code() + ":" + dataModel.version();
Map<String, List<String>> variables = datasetVariablesByDataModel.get(versionedKey);
if (variables != null) {
return variables;
if (variables == null) {
variables = datasetVariablesByDataModel.get(dataModel.code());
}
return keepKnownDatasetVariables(variables);
}

variables = datasetVariablesByDataModel.get(dataModel.code());
return variables != null ? variables : Collections.emptyMap();
/** Omits datasets whose variables are unknown (null or []): the UI reads a list as "only these
* variables exist" and a missing entry as "no information". */
static Map<String, List<String>> keepKnownDatasetVariables(Map<String, List<String>> datasetVariables) {
if (datasetVariables == null) {
return Collections.emptyMap();
}
return datasetVariables.entrySet().stream()
.filter(e -> e.getKey() != null && e.getValue() != null)
.map(e -> Map.entry(e.getKey(), e.getValue().stream().filter(Objects::nonNull).toList()))
.filter(e -> !e.getValue().isEmpty())
.collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue));
}

private List<DataModelDTO.EnumerationDTO> selectDatasetEnumerations(Map<String, List<DataModelDTO.EnumerationDTO>> datasetEnumerationsByDataModel, DataModelDTO dataModel) {
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/hbp/mip/utils/ClaimUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,11 @@ public List<DataModelDTO> getAuthorizedDataModels(Logger logger, Authentication
}

userDataModelDatasets.add(dataset);
if (originalDatasetVariables == null) {
continue;
// Unknown variables (null or []) are omitted, same rule as DataModelService.
List<String> variables = originalDatasetVariables == null ? null : originalDatasetVariables.get(dataset.code());
if (variables != null && !variables.isEmpty()) {
filteredDatasetVariables.put(dataset.code(), variables);
}

List<String> variables = originalDatasetVariables.get(dataset.code());
List<String> safeVariables = variables != null
? Collections.unmodifiableList(new ArrayList<>(variables))
: Collections.emptyList();
filteredDatasetVariables.put(dataset.code(), safeVariables);
}

if (userDataModelDatasets.isEmpty()) {
Expand Down
Loading
Loading