Skip to content

Commit 41ce9b2

Browse files
authored
General: Show dependencies and vulnerabilities in an admin page (#11982)
1 parent 56dba21 commit 41ce9b2

72 files changed

Lines changed: 6045 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ data-exports/
204204
/src/main/webapp/app/core/environments/environment.*.ts
205205
/src/main/webapp/i18n/*.json
206206

207+
######################
208+
# TypeScript output (should go to build/, but gitignore as safeguard)
209+
######################
210+
/src/main/webapp/**/*.js
211+
/src/main/webapp/**/*.js.map
212+
207213
######################
208214
# Artemis resources
209215
######################

SECURITY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,22 @@ Transport security:
116116

117117
Artemis actively protects against supply chain risks:
118118

119+
- The Artemis development team carefully reviews new dependencies before including them in the project to avoid introducing vulnerabilities in the first place
119120
- Automated dependency vulnerability scanning using **Mend (formerly WhiteSource)**
120121
- Regular updates to the latest stable versions of:
121122
- **Spring Boot**
122123
- **Angular**
123124
- Prompt application of security patches
124125
- Avoidance of unmaintained or low-trust dependencies
125126

127+
**Vulnerability Monitoring and SBOM Support:**
128+
129+
Artemis provides built-in tools to help administrators monitor and manage dependency security:
130+
131+
- **Software Dependencies Page:** Administrators can view and check for known vulnerabilities directly in the application via the Admin area, allowing for quick assessment of the current security posture
132+
- **Software Bill of Materials (SBOM):** A downloadable SBOM is available for advanced security analysis in external systems, enabling integration with enterprise vulnerability management tools
133+
- **Automated Weekly Security Scan:** Artemis performs regular security analysis of all dependencies and proactively notifies administrators via email when issues are detected, ensuring timely awareness of potential vulnerabilities
134+
126135

127136

128137
### Monitoring, Incident Response, and Security Operations

build.gradle

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ plugins {
2929
id "org.springdoc.openapi-gradle-plugin" version "1.9.0"
3030
id "org.openapi.generator" version "7.18.0"
3131
id "com.google.osdetector" version "1.7.3"
32+
id "org.cyclonedx.bom" version "3.1.0"
3233
}
3334

3435
group = "de.tum.cit.aet.artemis"
@@ -53,6 +54,7 @@ node {
5354

5455
apply from: "gradle/liquibase.gradle"
5556
apply from: "gradle/spotless.gradle"
57+
apply from: "gradle/sbom.gradle"
5658

5759
if (project.hasProperty("prod")) {
5860
apply from: "gradle/profile_prod.gradle"
@@ -157,6 +159,15 @@ configurations.configureEach {
157159
// required by JPlag, but not used in this project
158160
exclude group: "xalan", module: "serializer"
159161

162+
// we use jackson and want to exclude gson to avoid conflicts and security vulnerabilities
163+
exclude group: "com.google.code.gson", module: "gson"
164+
165+
// we do not really use kotlin libraries, exclude to avoid conflicts and security vulnerabilities
166+
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib"
167+
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
168+
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk8"
169+
exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-common"
170+
160171
exclude group: "org.springframework.boot", module: "spring-boot-starter-cache"
161172
exclude group: "net.logstash.logback", module: "logstash-logback-encoder"
162173

@@ -304,7 +315,7 @@ dependencies {
304315
// Support YML serialization and deserialization
305316
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${fasterxml_version}"
306317

307-
// Avoid outdated version of netty to prevent security issues
318+
// Avoid outdated version of json-smart to prevent security issues, we only use this as transitive dependency for third party dependencies
308319
implementation("net.minidev:json-smart") { version {strictly "2.6.0" } }
309320

310321

@@ -330,9 +341,6 @@ dependencies {
330341
implementation "org.apache.commons:commons-lang3:${commons_lang3_version}"
331342
implementation "org.apache.commons:commons-collections4:4.5.0"
332343

333-
// required by eureka, but actually superseded by commons-lang3 above
334-
implementation "commons-lang:commons-lang:2.6"
335-
336344
implementation("org.liquibase:liquibase-core:${liquibase_version}") {
337345
exclude group: "com.opencsv", module: "opencsv"
338346
}
@@ -371,7 +379,6 @@ dependencies {
371379
implementation "com.webauthn4j:webauthn4j-spring-security-core:0.11.2.RELEASE"
372380
implementation "com.webauthn4j:webauthn4j-core:0.30.2.RELEASE"
373381

374-
// implementation "org.springframework.security:spring-security-data"
375382
implementation "org.springframework.security:spring-security-messaging"
376383
implementation "org.springframework.security:spring-security-ldap"
377384
// use newest version of nimbus-jose-jwt to avoid security issues through outdated dependencies
@@ -396,6 +403,7 @@ dependencies {
396403
implementation "org.bouncycastle:bcpkix-jdk18on:1.83"
397404
implementation "org.bouncycastle:bcprov-jdk18on:1.83"
398405

406+
// required for database connections
399407
implementation "com.mysql:mysql-connector-j:${mysql_version}"
400408
implementation "org.postgresql:postgresql:42.7.9"
401409

@@ -416,11 +424,6 @@ dependencies {
416424

417425
// use newest version of guava to avoid security issues through outdated dependencies
418426
implementation "com.google.guava:guava:33.5.0-jre"
419-
implementation "com.sun.activation:jakarta.activation:2.0.1"
420-
421-
// use newest version of gson to avoid security issues through outdated dependencies
422-
// NOTE: gson itself is not allowed in the Artemis code (based on architecture tests), but is used by dependencies (e.g. spring cloud eureka netflix)
423-
implementation "com.google.code.gson:gson:2.13.2"
424427

425428
// explicitly only use this at runtime (required by liquibase, because developers should prefer org.apache.commons:csv
426429
runtimeOnly "com.opencsv:opencsv:5.12.0"
@@ -579,3 +582,4 @@ tasks.named("dependencyUpdates").configure {
579582
// 13) Find unused dependencies ./gradlew lintGradle -x webapp
580583
// 14) Generate OpenAPI client services & DTOs: ./gradlew openApiGenerate -x webapp (only relevant for tutorial groups and hyperion at the moment)
581584
// 15) Generate OpenAPI spec: ./gradlew generateApiDocs -x webapp (only relevant for tutorial groups and hyperion at the moment)
585+
// 16) Generate SBOM (Software Bill of Materials): ./gradlew cyclonedxBom -x webapp

docker/broker-registry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
services:
66
jhipster-registry:
77
container_name: artemis-jhipster-registry
8-
image: docker.io/jhipster/jhipster-registry:v7.4.0
8+
image: docker.io/jhipster/jhipster-registry:v7.5.0
99
pull_policy: missing
1010
volumes:
1111
- ./registry:/central-config

gradle/sbom.gradle

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// CycloneDX SBOM Configuration
2+
// Plugin "org.cyclonedx.bom" must be declared in build.gradle plugins block
3+
4+
// CycloneDX SBOM Configuration (v3.x API)
5+
tasks.cyclonedxDirectBom {
6+
includeConfigs = ["runtimeClasspath"]
7+
skipConfigs = ["testCompileClasspath", "testRuntimeClasspath", "checkstyle", "mockitoAgent", "liquibaseRuntime"]
8+
projectType = "application"
9+
includeBomSerialNumber = true
10+
includeLicenseText = false
11+
// Output configuration for v3.x - use file properties instead of destination/outputName/outputFormat
12+
jsonOutput = file("build/reports/sbom/server-sbom.json")
13+
// Disable XML output
14+
xmlOutput.unsetConvention()
15+
}
16+
17+
// Task to generate client SBOM using @cyclonedx/cyclonedx-npm
18+
tasks.register("generateClientSbom", NpmTask) {
19+
dependsOn "npm_install"
20+
args = ["run", "sbom:generate"]
21+
description = "Generate CycloneDX SBOM for client-side npm dependencies"
22+
group = "reporting"
23+
}
24+
25+
// Task to generate both server and client SBOMs
26+
tasks.register("generateAllSbom") {
27+
dependsOn "cyclonedxBom", "generateClientSbom"
28+
description = "Generate CycloneDX SBOMs for both server and client dependencies"
29+
group = "reporting"
30+
}
31+
32+
// Copy SBOMs to resources for runtime access (if they exist)
33+
// This task copies pre-generated SBOMs without forcing regeneration
34+
tasks.register("copySbomsToResources") {
35+
description = "Copy SBOM files to resources if they exist"
36+
group = "build"
37+
38+
// If cyclonedxBom runs, it must run before this task
39+
mustRunAfter "cyclonedxBom"
40+
41+
doLast {
42+
def sbomDir = file("build/resources/main/sbom")
43+
sbomDir.mkdirs()
44+
45+
def serverSbom = file("build/reports/sbom/server-sbom.json")
46+
if (serverSbom.exists()) {
47+
copy {
48+
from serverSbom
49+
into sbomDir
50+
}
51+
logger.lifecycle("Copied server SBOM to resources")
52+
}
53+
54+
def clientSbom = file("build/reports/client-sbom.json")
55+
if (clientSbom.exists()) {
56+
copy {
57+
from clientSbom
58+
into sbomDir
59+
}
60+
logger.lifecycle("Copied client SBOM to resources")
61+
}
62+
}
63+
}
64+
65+
// Ensure copySbomsToResources runs after processResources
66+
tasks.named("processResources") {
67+
finalizedBy "copySbomsToResources"
68+
}
69+
70+
// For production builds, generate both server and client SBOMs before copying
71+
if (project.hasProperty("prod")) {
72+
tasks.named("copySbomsToResources") {
73+
dependsOn "cyclonedxBom", "generateClientSbom"
74+
}
75+
}

0 commit comments

Comments
 (0)