Skip to content

Phase 1, kafka, oauth, saml mdq validation.#486

Merged
masv3971 merged 20 commits into
mainfrom
masv/security/fixes
Jun 13, 2026
Merged

Phase 1, kafka, oauth, saml mdq validation.#486
masv3971 merged 20 commits into
mainfrom
masv/security/fixes

Conversation

@masv3971

Copy link
Copy Markdown
Member

No description provided.

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

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.

Comment thread pkg/oauth2/clients.go Outdated
Comment thread pkg/oauth2/client_assertion_verifier.go Outdated
Comment thread pkg/oauth2/client_assertion_verifier.go
Comment thread internal/apigw/apiv1/handlers_oauth.go
Comment thread pkg/messagebroker/kafka/security.go
Comment thread pkg/model/config.go
masv3971 and others added 5 commits June 12, 2026 16:54
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>

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 14 out of 14 changed files in this pull request and generated 7 comments.

Comment thread pkg/oauth2/clients.go Outdated
Comment thread pkg/oauth2/client_assertion_verifier.go
Comment thread pkg/oauth2/client_assertion_verifier.go Outdated
Comment thread internal/apigw/apiv1/handlers_oauth.go
Comment thread pkg/messagebroker/kafka/security.go Outdated
Comment thread pkg/oauth2/client_assertion_verifier_test.go
Comment thread pkg/oauth2/client_assertion_verifier.go Outdated

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 3 comments.

Comment thread pkg/oauth2/client_assertion_verifier.go
Comment thread internal/apigw/apiv1/handlers_oauth.go
Comment thread pkg/oauth2/client_assertion_verifier_test.go Outdated
masv3971 and others added 2 commits June 12, 2026 17:47
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 thread pkg/oauth2/client_assertion_verifier.go Outdated
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 3 comments.

Comment thread pkg/messagebroker/kafka/security.go
Comment thread pkg/oauth2/client_assertion_verifier.go Outdated
Comment thread pkg/oauth2/client_assertion_verifier_test.go
masv3971 and others added 2 commits June 12, 2026 18:10
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 2 comments.

Comment thread pkg/oauth2/client_assertion_verifier.go
Comment thread pkg/model/config.go Outdated
masv3971 and others added 2 commits June 12, 2026 18:19
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 thread pkg/oauth2/client_assertion_verifier.go
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 4 comments.

Comment thread pkg/cache/generic.go
Comment thread pkg/cache/generic.go
Comment thread pkg/cache/generic_memory.go Outdated
Comment thread pkg/cache/generic_mongo.go

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 18 out of 18 changed files in this pull request and generated 3 comments.

Comment thread pkg/oauth2/client_assertion_verifier.go
Comment thread internal/apigw/apiv1/handlers_oauth.go
Comment thread pkg/messagebroker/kafka/security.go
masv3971 and others added 2 commits June 13, 2026 14:44
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 19 out of 19 changed files in this pull request and generated 1 comment.

Comment thread pkg/oauth2/clients.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

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 19 out of 19 changed files in this pull request and generated no new comments.

@masv3971 masv3971 merged commit 65fe70f into main Jun 13, 2026
7 checks passed
@masv3971 masv3971 deleted the masv/security/fixes branch June 13, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants