OIDC Group/Role-Based Access Control and Membership Sync#3877
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
For the CLA, except if I’m missing something, if you check my committer email, it is covered under Michelin’s CLA. |
e070496 to
a6a9002
Compare
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces Google OIDC group synchronization and access control features to Timesketch, allowing group memberships and admin privileges to be synced directly from OIDC tokens. It includes configuration updates, helper functions for extracting groups from JWTs, and a refactored authentication flow with comprehensive tests. The review feedback highlights three key issues: a potential runtime error when modifying user.groups while iterating over it, a possible AttributeError in regex group extraction if an optional capture group is None, and a style guide violation where an f-string is used for logging instead of the preferred % formatting.
a6a9002 to
8a2f850
Compare
8a2f850 to
2fe1237
Compare
Issue: Closes #3876
What existing problem does this PR solve?
Previously, Timesketch OIDC authentication only supported user-level access control via allow-lists. This meant:
What new feature is being introduced with this PR?
This PR adds comprehensive OIDC group/role-based access control with automatic membership synchronization:
GOOGLE_OIDC_ALLOWED_GROUPSGOOGLE_OIDC_ADMIN_GROUPOverview of changes to existing functions
timesketch/lib/google_auth.py:get_groups_from_jwt()to extract and normalize group/role names from JWT claims with regex and separator supportget_oauth2_authorize_url()to make OIDC scopes configurabletimesketch/views/auth.py:google_openid_connect()callback to support group-based access control and automatic group synchronizationdata/timesketch.conf:Checks