Phase 1, kafka, oauth, saml mdq validation.#486
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR advances “Phase 1” hardening across OAuth, Kafka, and SAML by adding private_key_jwt client assertion verification support, introducing Kafka SASL/mTLS configuration knobs, and enforcing safer SAML metadata handling, while also reducing sensitive log output.
Changes:
- Add RFC 7523 client_assertion verification (JWKS fetch + JWT validation) and wire it into the token endpoint flow.
- Extend configuration to support Kafka SASL + mTLS and tighten TLS config validation semantics.
- Enforce signature requirements for MDQ/URL SAML metadata (with an explicit insecure override) and reduce sensitive logging.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/oauth2/clients.go | Adds jwks_uri to client config to support private_key_jwt verification. |
| pkg/oauth2/client_assertion_verifier.go | New verifier implementation for RFC 7523 client assertions using JWKS + JWT validation. |
| pkg/oauth2/client_assertion_verifier_test.go | Unit tests covering verifier success/failure cases. |
| pkg/model/config.go | Adds MTLS + Kafka SASL settings; adjusts TLS required-when-enabled semantics; adds SAML unsigned-metadata override flag. |
| pkg/messagebroker/kafka/security.go | New helper applying SASL/TLS/mTLS settings to Sarama config. |
| pkg/messagebroker/kafka/scram.go | SCRAM client implementation for Sarama via xdg-go/scram. |
| pkg/messagebroker/kafka/scram_test.go | Tests for SCRAM helpers/client behavior. |
| pkg/messagebroker/kafka/producer.go | Uses shared security config application for producer. |
| pkg/messagebroker/kafka/consumer.go | Uses shared security config application for consumer. |
| internal/verifier/apiv1/handlers_verification.go | Reduces sensitive debug logging (no longer logs full request/JWT/VP response). |
| internal/apigw/auth_providers/samlsp/service.go | Enforces metadata signature verification for MDQ/URL sources unless explicitly overridden; adds warnings for insecure paths. |
| internal/apigw/apiv1/handlers_oauth.go | Replaces “unverified assertion” TODO path with RFC 7523 verification when unverified mode is off. |
| .vscode/settings.json | Adds spellchecker allowlist entries for new terms. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
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.



No description provided.