Step-up auth: Group-based OIDC Step-up Authentication
Problem / Motivation
Currently, GitLab provides uniform access controls across all groups within an instance. However, enterprise organizations often have varying security requirements:
- Some groups contain highly sensitive intellectual property requiring device-based authentication
- Different groups may need different authentication context classes (ACRs) based on their security classification
- Group owners need the flexibility to configure step-up authentication requirements independently
- Users should be prevented from accessing any resources within a protected group namespace without proper step-up authentication
Without group-level step-up authentication, organizations must either:
- Apply the highest security level instance-wide (reducing usability)
- Accept lower security for sensitive groups (increasing risk)
- Manage separate GitLab instances (increasing operational overhead)
Proposal / Solution
Implement group-based OIDC step-up authentication that allows group owners to:
- Enable/disable step-up authentication for their group
- Select the OIDC provider that should perform the step-up authentication
- Configure the required ACR level for group access
- Inherit protection from parent groups (if parent group requires step-up auth, all subgroups inherit this requirement)
Protection Scope
When step-up authentication is enabled for a group, users must be step-up authenticated to:
- Access the group's main page
- View group settings and configuration pages
- Access any projects within the group namespace
- Perform any actions within projects in the group (including merge requests, issues, etc.)
- Access subgroups and their resources
- View group-level CI/CD pipelines and jobs
- Etc.
Configuration Approach
Follow the same configuration approach with the gitlab.yml as proposed and implemented for step-up authentication for admin mode.
We simply propose to add a new scope namespace to the step-up auth config. The following collapsed section shows an example for how to configure an openid_connect provider to allow step-up authentication for groups.
Click to expand the example for step-up auth config for groups
production: &base
omniauth:
providers:
- { name: 'openid_connect',
label: 'Provider name',
args: {
name: 'openid_connect',
# ...
allow_authorize_params: ["claims"], # Match this to the parameters defined in `step_up_auth => namespace => params`
},
step_up_auth: {
admin_mode: {
id_token: {
required: {
acr: 'gold'
}
}
},
namespace: {
id_token: {
required: {
acr: 'silver'
},
included: {
amr: ['mfa', 'fpt']
},
},
params: {
claims: {
id_token: {
acr: {
essential: true,
values: ['silver']
}
}
}
}
},
}
}
Implementation Flow
Click to expand the flow chart
flowchart LR
1[1. User requests access to
protected group resource]
2{2. GitLab checks if group
requires step-up auth}
3{3. Check if user session
has required ACR for group}
4[4. Allow access to
group resource]
5[5. Redirect to OIDC provider
with required ACR for group]
6[6. Wait for OIDC provider
authentication and callback]
7[7. Store ACR in session
and redirect to original resource]
1 --> 2
2 -->|No step-up required| 4
2 -->|Step-up required| 3
3 -->|Valid ACR exists| 4
3 -->|ACR missing/insufficient| 5
5 --> 6
6 --> 7
7 --> 4
Related Issues and Merge Requests
- Original Issue: OIDC step-up auth: Allow higher trust levels for admin area and groups / projects => has been promoted to EPIC &16818
- Implementation step-up auth for admin mode: Implement step-up authentication for admin area
- Documentation for step-up authentication for admin mode: OIDC Authentication Documentation
- Group Model Changes: Add model attribute for required provider for group
Acceptance Criteria
-
Group owners can enable/disable step-up authentication for their groups => Step-up auth: Group protection (Model and UI se... (!199423 - merged) -
Group owners can select which OIDC provider handles step-up authentication => Step-up auth: Group protection (Model and UI se... (!199423 - merged) -
Group owners can configure required ACR levels for group access => Step-up auth: Group protection (Model and UI se... (!199423 - merged) -
OIDC backend supports namespace scope for step-up authentication => Step-up auth: Group protection (OIDC backend su... (!204102 - merged) -
Session management handles group-specific ACR requirements => Step-up auth: Group protection (OIDC backend su... (!204102 - merged) -
Configuration follows the same pattern as admin mode step-up authentication => Step-up auth: Group protection (Model and UI se... (!199423 - merged) -
Comprehensive documentation covers configuration scenarios => Step-up auth: Group protection (Model and UI se... (!199423 - merged) -
Users cannot access protected group resources without proper step-up authentication -
Subgroups inherit step-up requirements from parent groups => Step-up auth: Consider namespace setting inheri... (!199628 - merged) -
Admin users can bypass group step-up requirements when in admin mode -
Full end-to-end testing and feature completion
Implementation Plan
Benefits of MR Split Approach
- Incremental Delivery: Each phase can be merged independently with feature flag protection
- Focused Reviews: Reviewers can concentrate on specific aspects (UI, backend, enforcement)
- Reduced Risk: Problems are isolated to specific layers with clear rollback strategies
- Clear Dependencies: Linear progression without circular dependencies
- Early Value: Configuration UI available immediately, backend ready for testing
This implementation follows a 5-phase MR split approach to ensure incremental delivery and focused reviews:
✅ Phase 1: Group Settings and Model => Step-up auth: Group protection (Model and UI se... (!199423 - merged)
-
Database & Models: Added step_up_auth_required_oauth_providerfield tonamespace_settings -
Group Settings UI: Built interface for group owners to enable/disable step-up authentication and select OIDC providers -
Model Validations: Added validation for provider selection and helper methods -
Feature Flag: Configured omniauth_step_up_auth_for_namespacefeature flag -
Audit Events: Set up audit event tracking for step-up auth configuration changes -
Documentation: Updated OIDC documentation with namespace scope configuration examples -
Basic Testing: Feature tests for group settings UI and helper tests for provider selection
✅ Phase 2: OIDC Backend Extensions => Step-up auth: Group protection (OIDC backend su... (!204102 - merged)
-
OIDC Provider Integration: Extended existing OIDC step-up flow to handle namespace-scoped authentication -
Dual Scope Support: Enhanced authentication flow to support both admin_modeandnamespacescopes simultaneously -
Session Management: Implemented provider-specific and scope-specific session tracking -
OAuth Callback Handling: Updated callback controller to process namespace scope tokens -
Middleware Enhancement: Extended request phase middleware to handle namespace scope requests -
Comprehensive Testing: Unit tests for OIDC classes, controller tests for OAuth callbacks, and middleware tests
✅ Phase 3: UI Components & Auth Helper => Step-up auth: Group protection (frontend flow a... (!207665 - merged)
-
Auth Helper: Create helper methods for generating step-up authentication URLs -
Step-up Auth Controller: Implement dedicated controller for group step-up authentication flow -
UI Templates: Create user-facing templates for step-up authentication process -
Route Configuration: Add routes for group step-up authentication endpoints -
Internationalization: Add necessary translations for step-up auth UI -
Helper Testing: Unit tests for auth helper methods -
Request Testing: Request specs for step-up auth controller
🛠️ Phase 4: Controller Enforcement & Full Tests => Step-up auth: Group protection (final integrati... (!199800)
-
Access Control: Add before_actioncallbacks to enforce step-up authentication requirements in group controllers -
Enforcement Logic: Implement group-level ACR requirement checking and redirect logic to step-up auth flow -
Admin Bypass: Ensure admin bypass functionality works correctly for users in admin mode -
Integration Testing: End-to-end testing of the complete authentication flow -
Performance Validation: Ensure no regressions in group access performance -
Feature Testing: Comprehensive feature tests covering all step-up authentication scenarios -
Helper Testing: Unit tests for auth helper methods -
Request Testing: Request specs for step-up auth controller -
Route Configuration: Add routes for group step-up authentication endpoints
🔄 Phase 5: Future Enhancements (OPTIONAL)
-
Subgroup Inheritance: Implement step-up requirement inheritance from parent groups => Step-up auth: Consider namespace setting inheri... (!199628 - merged) -
Enhanced UI Flow: Improved user experience during step-up auth flow with better error handling -
API Integration: Create dedicated API endpoints for managing group step-up authentication settings => Step-up auth: Add REST API endpoint for group p... (!203429 - merged) / Step-up auth: Add GraphQL API endpoint for grou... (!204475 - merged) -
Advanced Configuration: Instance-level policies that can override group-level step-up settings
Open Questions
- Should there be instance-level policies that can override group-level step-up settings?
- How should step-up authentication interact with existing group access tokens and deploy keys?
- What should be the inheritance behavior when parent and child groups have different step-up requirements?