1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-19 17:26:51 +00:00

feat: usage of CA certificate files within image/container

This commit is contained in:
Paul-Christian Volkmer 2024-02-01 16:44:41 +01:00
parent 17e04a3f89
commit 3cc34fb30b
5 changed files with 44 additions and 0 deletions

2
.gitignore vendored
View File

@ -5,6 +5,8 @@ build/
!**/src/main/**/build/ !**/src/main/**/build/
!**/src/test/**/build/ !**/src/test/**/build/
bindings/ca-certificates/*.pem
### STS ### ### STS ###
.apt_generated .apt_generated
.classpath .classpath

View File

@ -199,6 +199,35 @@ Diese Anwendung ist auch als Docker-Image verfügbar: https://github.com/CCC-MF/
./gradlew bootBuildImage ./gradlew bootBuildImage
``` ```
### Integration eines eigenen Root CA Zertifikats
Wird eine eigene Root CA verwendet, die nicht offiziell signiert ist, wird es zu Problemen beim SSL-Handshake kommen, wenn z.B. gPAS zur Generierung von Pseudonymen verwendet wird.
Hier bietet es sich an, das Root CA Zertifikat in das Image zu integrieren.
#### Integration beim Bauen des Images
Hier muss die Zeile `"BP_EMBED_CERTS" to "true"` in der Datei `build.gradle.kts` verwendet werden und darf nicht als Kommentar verwendet werden.
Die PEM-Datei mit dem/den Root CA Zertifikat(en) muss dabei im vorbereiteten Verzeichnis [`bindings/ca-certificates`](bindings/ca-certificates) enthalten sein.
#### Integration zur Laufzeit
Hier muss die Umgebungsvariable `SERVICE_BINDING_ROOT` z.B. auf den Wert `/bindings` gesetzt sein.
Zudem muss ein Verzeichnis `bindings/ca-certificates` - analog zum Verzeichnis [`bindings/ca-certificates`](bindings/ca-certificates) mit einer PEM-Datei als Docker-Volume eingebunden werden.
Beispiel für Docker-Compose:
```
...
environment:
SERVICE_BINDING_ROOT: /bindings
...
volumes:
- "/path/to/bindings/ca-certificates/:/bindings/ca-certificates/:ro"
...
```
## Deployment ## Deployment
*Ausführen als Docker Container:* *Ausführen als Docker Container:*

View File

@ -0,0 +1,5 @@
# Hinweis für Root CA Zertifikate
PEM-Datei(en) in diesem Verzeichnis ablegen.
Die Datei `type` gibt dabei an, dass hier CA Zertifikate zu finden sind.

View File

@ -0,0 +1 @@
ca-certificates

View File

@ -113,7 +113,14 @@ task<Test>("integrationTest") {
tasks.named<BootBuildImage>("bootBuildImage") { tasks.named<BootBuildImage>("bootBuildImage") {
imageName.set("ghcr.io/ccc-mf/etl-processor") imageName.set("ghcr.io/ccc-mf/etl-processor")
// Binding for CA Certs
bindings.set(listOf(
"$rootDir/bindings/ca-certificates/:/platform/bindings/ca-certificates"
))
environment.set(environment.get() + mapOf( environment.set(environment.get() + mapOf(
// Enable this line to embed CA Certs into image on build time
//"BP_EMBED_CERTS" to "true",
"BP_OCI_SOURCE" to "https://github.com/CCC-MF/etl-processor", "BP_OCI_SOURCE" to "https://github.com/CCC-MF/etl-processor",
"BP_OCI_LICENSES" to "AGPLv3", "BP_OCI_LICENSES" to "AGPLv3",
"BP_OCI_DESCRIPTION" to "ETL Processor for bwHC MTB files" "BP_OCI_DESCRIPTION" to "ETL Processor for bwHC MTB files"