Repository navigation
Fix dspace-customers 1083 finding 29: create the Shibboleth SP key when the container starts - #1693
Open
milanmajchrak wants to merge 2 commits into
Open
milanmajchrak wants to merge 2 commits into
milanmajchrak wants to merge 2 commits into
Conversation
The test image ran shib-keygen at build time, so every container shared one key pair stored in an image layer. The startup script now creates it on the first start and keeps an existing or mounted pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to generate per-container Shibboleth credentials at startup.
No open issues 🎉
What changed in this PR
Moves Shibboleth SP key generation from image build to first container startup, giving each local test container its own credentials instead of sharing an image-baked key.
Changes:
- Removes build-time SP key generation.
- Generates credentials at startup, preserves existing pairs, and rejects missing or empty credential files.
- Documents how to mount a fixed key pair.
| File | Description |
|---|---|
dspace/src/main/docker/README.md |
Documents startup-generated credentials and fixed-key mounts. |
dspace/src/main/docker/dspace-shibboleth/httpd-shibd-foreground.sh |
Generates and checks the credential pair before starting Shibboleth. |
dspace/src/main/docker/dspace-shibboleth/Dockerfile |
Removes the build-time shib-keygen step. |
Review effort: Balanced
The startup script now also runs make-ssl-cert, so the image contains no private key file. Existing files are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
dspace-customers issue 1083, finding 29.
Description
The
dspace-shibbolethtest image now creates the Shibboleth SP key pair and Apache's self-signed certificate when a container starts for the first time, not duringdocker build. The image itself contains no private key file.Instructions for Reviewers
List of changes in this PR:
Dockerfile: theshib-keygenstep is removed. Thessl-cert-snakeoilfiles that thessl-certpackage creates are deleted in the same step that installs it.httpd-shibd-foreground.sh: runsshib-keygen -b -o /etc/shibbolethandmake-ssl-cert generate-default-snakeoilbeforeshibdand Apache start. Both keep files that already exist, so a restart or a mounted pair keeps its key. If only one ofsp-key.pemandsp-cert.pemexists, the script stops with a clear message.README.md: two sentences on where the keys come from and how to keep a fixed SP key.The image is only used by
docker-compose-shibboleth.ymlfor local tests. No CI job builds or publishes it.How to test:
Result:
findprints nothing, the two containers have different keys, the restart keeps the key, andshibdandapache2run. A container started withsp-key.pemandsp-cert.pemmounted read-only keeps that pair.Codex review (gpt-6.2-sol, high), 4 rounds: 3 findings fixed. Two were left as is: package-generated Shibboleth keys (the
findabove shows there are none) and no automatic recovery after an interrupted first start (the script stops with a clear message).AI Disclosure (REQUIRED)
Were AI tools used in the creation of this PR?
Claude Code wrote the change and checked it in Docker with the commands above.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code