Skip to content

Introduce idpCertFingerprintAllowList#5272

Draft
supersven wants to merge 6 commits into
developfrom
sventennie/idp-cert-allowlist
Draft

Introduce idpCertFingerprintAllowList#5272
supersven wants to merge 6 commits into
developfrom
sventennie/idp-cert-allowlist

Conversation

@supersven

@supersven supersven commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

If set, only IdP certs with allow listed fingerprints can be used.

  • needs docs

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

If set, only IdP certs with allow listed fingerprints can be used.
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional configuration (idpCertFingerprintAllowlist) to restrict which IdP descriptor signing certificates are accepted (by SHA-1 fingerprint), enforcing the check during IdP create/update and during SAML AuthnResponse processing.

Changes:

  • Introduce config parsing for an IdP cert fingerprint allowlist and wire it into Spar options/Helm config.
  • Enforce allowlist checks in Spar’s IdP create/update flows and in authresp.
  • Extend Data.X509.Extended with fingerprint utilities and add unit + integration tests covering allowlist behavior.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/spar/test/Test/Spar/Saml/IdPSpec.hs Adds unit tests for allowlist behavior across create/update/authresp and updates the Polysemy test harness to provide Input Opts.
services/spar/src/Spar/Options.hs Adds idpCertFingerprintAllowlist :: Maybe CertFingerprintAllowlist and JSON/YAML parsing for the allowlist entries.
services/spar/src/Spar/Error.hs Introduces SparIdPCertNotAllowed and maps it to HTTP 403 with label idp-cert-not-allowed.
services/spar/src/Spar/API.hs Enforces allowlist checks via assertCertsAllowlisted in create/update and SAML auth response handling.
services/spar/spar.integration.yaml Documents and sets the integration config key idpCertFingerprintAllowlist: [] (disabled).
services/spar/spar.cabal Adds new test-suite dependencies needed by the updated specs.
services/spar/default.nix Updates Nix derivation dependencies for Spar (but currently incomplete for test deps; see PR comments).
libs/saml2-web-sso/src/SAML2/WebSSO/Test/Arbitrary.hs Adds deterministic certificate generation helper (mkArbitrarySignedCert) for tests.
libs/extended/test/Test/Data/X509/ExtendedSpec.hs Expands tests for fingerprint parsing/rendering and SHA-1 computation.
libs/extended/src/Data/X509/Extended.hs Adds Fingerprint type and SHA-1 fingerprint compute/parse/render helpers; uses them in certDescription.
libs/extended/extended.cabal Adds test dependencies (QuickCheck, text) to support new tests.
libs/extended/default.nix Aligns Nix test dependencies with updated extended.cabal.
integration/test/Test/Spar/CertFingerprintAllowlist.hs Adds integration tests validating allowlist enforcement in create/update and successful finalize-login when allowlisted.
integration/integration.cabal Registers the new integration test module.
charts/wire-server/values.yaml Documents and exposes spar.config.idpCertFingerprintAllowlist Helm value.
charts/wire-server/templates/spar/configmap.yaml Renders idpCertFingerprintAllowlist into Spar’s configmap.
changelog.d/2-features/idp-cert-fingerprint-allowlist Documents the new configuration option (but currently uses a mismatched key casing; see PR comments).

Comment thread services/spar/default.nix
Comment on lines 206 to 210
aeson-qq
base
bytestring
bytestring-conversion
containers
Comment thread changelog.d/2-features/idp-cert-fingerprint-allowlist Outdated
supersven and others added 2 commits June 16, 2026 22:57
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment on lines +532 to +536
-- \| RFC 5280 §4.1.2.2 limits X.509 serial numbers to 20 octets (160 bits).
-- Use a 31-bit range so serials stay well within that bound even after
-- small offsets (e.g. baseSeed + n for up to n=3 certs).
genBaseSeed :: Gen Integer
genBaseSeed = choose (1, 2 ^ (31 :: Int))
@supersven supersven force-pushed the sventennie/idp-cert-allowlist branch from 6f83911 to 5f742bc Compare June 17, 2026 05:51
@supersven supersven force-pushed the sventennie/idp-cert-allowlist branch from 5f742bc to 7ef9263 Compare June 17, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants