Repository navigation
feat(use-cases): TLS keys in an HSM over PKCS#11 - #42
Merged
Merged
Conversation
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.
What
A new use case,
use-cases/hsm-tls-keys: TLS private keys in an HSM, or any PKCS#11 token, that Synapse signs handshakes with. The key never leaves the device. It needs Synapse 0.8.9 or later.config.yamlwith aproxy.hsmblock andupstreams.yamlwithtls.terminatehosts. One certificate's.keyis apkcs11:URI and one is a software key, in the same directory.make-token.sh, run with Docker Compose, and aclient.shthat checks the served certificates. No hardware is needed.pkcs11provider,retry_interval_secs,on_failure, what needs a restart, and certbot with--csrfor HSM-backed certificates.scripts/check.shgives a set with anhsm:block a 0600 test PIN file throughPROXY_HSM_PIN_FILE. The set names/hsm/pin, which exists only in the container. Other sets run with the PIN env vars unset, so a caller's value cannot change their result. This needs a 0.8.9 build where--check-confighonoursPROXY_HSM_PIN_FILE.Tests
New controls in
scripts/test-check.sh(fixtures/hsm-pin):check.sh;PROXY_HSM_PIN_FILEdoes not reach a set withouthsm.check.sh, the last two fail.make test-checkpasses with a 0.8.9 release build.make test:use-cases/hsm-tls-keyspasses.use-cases/lb-passthroughfails, as it does onmainagainst a 0.8.9 build, because of its "passes through HTTP only" warnings. That is not from this PR, and it gets its own fix.make lintpasses.review
Code-reviewed: 78207b4 — 7 findings
Not re-reviewed: 6bf835b — should-fix batch, no must-fix