-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security/oidc: Basic support for OIDC with Kafka and HTTP #14378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably benefit from a second set of eyes, but lgtm
src/v/security/tests/jwt_test.cc
Outdated
// Incorrect issuer | ||
{1695887942, | ||
R"({"iss": "wrong", "sub": "subject", "aud": "redpanda", "exp": 1695887942, "iat": 1695887942})", | ||
"http://docker-rp-1:8080/realms/demorealm", | ||
"redpanda", | ||
0s, | ||
oidc::errc::jwt_invalid, | ||
security::acl_principal{security::principal_type::user, "subject"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case repeated from above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case repeated from above?
No?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with @oleiman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with @oleiman
Me too, GitHub UI was being silly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/v/security/oidc_service.cc
Outdated
|
||
co_return co_await http::with_client( | ||
std::move(client), | ||
[req_hdr](auto& client) mutable -> ss::future<ss::sstring> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[req_hdr = std::move(req_hdr)]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/v/security/oidc_service.cc
Outdated
"invalid response from discovery_url: {}, errc: {}", | ||
response_body, | ||
metadata.error()); | ||
co_return; // errc::invalid_credentials; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the commented code intended as inline documentation or cruft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the commented code intended as inline documentation or cruft?
Looks old,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
src/v/security/request_auth.cc
Outdated
"Unauthorized", ss::http::reply::status_type::unauthorized); | ||
} | ||
const auto& superusers = _superusers(); | ||
auto found = std::find(superusers.begin(), superusers.end(), username); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should username be initialized somewhere on the oidc path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should username be initialized somewhere on the oidc path?
Good spot. Looks like I've dropped some tests in this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all different, and fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking nice so far!
39d70dc
to
d46bd8a
Compare
Changes in force-push
|
b603029
to
7348305
Compare
Changes in force-push
|
Changes in force-push
|
7348305
to
339f2be
Compare
Changes in force-push
|
new failures detected in https://buildkite.com/redpanda/redpanda/builds/39826#018b6935-4362-467c-9095-387837653e59: "rptest.tests.cluster_config_test.ClusterConfigTest.test_valid_settings" |
new failures detected in https://buildkite.com/redpanda/redpanda/builds/39826#018b6943-5fab-42b2-881a-1b6466ffeb6e: "rptest.tests.cluster_config_test.ClusterConfigTest.test_valid_settings" |
ducktape was retried in job https://buildkite.com/redpanda/redpanda/builds/39826#018b6943-5fa3-47f8-8177-f2a13bcc6b49 |
/ci-repeat 1 |
f69f183
to
e42869e
Compare
Changes in force-push
|
a hack that i've seen Tyler use recently is to push the non-rebased version with the conflict, then do something like leave a comment which helps convince github to not squash the change history, and then push the rebased version. then the link to the minimal diff is preserved. |
build-oss seems to still have some issues |
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
Signed-off-by: Ben Pope <[email protected]>
e42869e
to
16063c9
Compare
Looks like it's fixed, great stuff @BenPope |
ducktape was retried in job https://buildkite.com/redpanda/redpanda/builds/40085#018b8268-0291-4a32-896f-f9e65b4297a6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
} | ||
result<parsed_url> parse_url(std::string_view url_view) { | ||
parsed_url result; | ||
auto url = ada::parse<ada::url_aggregator>(url_view); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Add basic support for:
The principal mapped from the
sub
claim of the JWT.Docs
New cluster configuration options:
oidc_discovery_url
https://auth.prd.cloud.redpanda.com/.well-known/openid-configuration
oidc_token_audience
redpanda
oidc_clock_skew_tolerance
30s
http_authentication
BASIC
andOIDC
are allowed."["BASIC"]
sasl_mechanisms
SCRAM
,GSSAPI
, andOAUTHBEARER
are allowed."["SCRAM"]
Backports Required
Release Notes
Features