We want to let OpenStack users (CSP customers) to have control over user federation without involving administrators.
https://github.com/gtema/keystone
Started as a "keystone" library in Rust.
Evolved into standalone Keystone implementation with APIv4 focus.
New authn and authz implemented there to be (ideally) fully compatible to python Keystone.
Can be deployed parallel to the python Keystone:
ProxyPass "/identity/v4" http://localhost:8080/v4 retry=0
ProxyPass "/identity/v3" "unix:/var/run/uwsgi/keystone-api.socket|uwsgi://uwsgi-uds-keystone-api/v3" retry=0
devstack-admin-passkey:
auth_type: v4passkey
auth:
auth_url: https://devstack.v6.rocks/identity
user_id: <USER_ID>
project_domain_name: Default
project_name: admin
region_name: RegionOne# Register the new passkey
osc identity4 user passkey register --current-user --description yubikey
# Authenticate with the passkey
osc auth show
# List all (visible) IDPs
osc --os-cloud devstack-admin identity4 federation identity-provider list
# List all (visible) mappings
osc --os-cloud devstack-admin identity4 federation mapping list
Reworked IDP - domain mapping enables new scenarios:
domain_id set on IdP level
typical usecase: customer's own Okta tenant.
domain_id set on the Mapping level
typical use-case: JWT login.
domain_id as the claim value
typical use-case: single Keycloak realm with users in groups (group = domain).
# Login with the private OKTA IDP
osc --os-cloud devstack-oidc-okta auth show
# Login with the shared Keycloak and scope
osc --os-cloud devstack-oidc-kc-shared identity4 federation identity-provider list
# Login with the JWT issued by KC with scope
osc --os-cloud devstack-jwt-kc1 --auth-helper-cmd ./kc_auth_helper.sh auth show
# Login with the mapping bound to the project
osc --os-cloud devstack-oidc-kc-jwt --auth-helper-cmd ./kc_auth_helper.sh auth show
No more hardcoded secrets for Zuul/GitHub/GitLab/etc!
osc --os-cloud devstack-admin identity4 federation mapping show 8f783428-3956-4478-a32c-f4f55afd252b
curl -X POST -H "Authorization: bearer <JWT>" -H "openstack-mapping: github" https://devstack.v6.rocks/identity/v4/federation/identity_providers/<IDP_ID>/jwt
name: GH federation
on:
pull_request:
# Grant permission for the job to request an OIDC token
permissions:
id-token: write
contents: read
jobs:
test-validator:
runs-on: ubuntu-latest
steps:
- name: test-validator
id: get_token
run: |
TOKEN_JSON=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=github-jwt")
TOKEN=$(echo $TOKEN_JSON | jq -r .value)
echo "token=$TOKEN" >> $GITHUB_OUTPUT
- name: Use the Token
run: |
curl -f "https://devstack.goncharov.v6.rocks/identity/v4/federation/identity_providers/9f8237fa457d4fe8b1ce4530b86a074c/jwt" \
-X POST -H "authorization: bearer ${{ steps.get_token.outputs.token }}" -H "openstack-mapping: github"A new Keystone token payload to further improve federated authn security.
# Login with JWT using the restricted mapping
osc --os-cloud devstack-jwt-kc-restricted --auth-helper-cmd ./kc_auth_helper_org2_user2.sh auth show
# List user role assignments
osc --os-cloud devstack-admin identity role-assignment list --user-id 0c6fb78d3acd476ea1b348d2b7ac6824
# Get the auth token
TOKEN=$(osc --os-cloud devstack-jwt-kc-restricted --auth-helper-cmd ./kc_auth_helper_org2_user2.sh auth login)
# Check the token renew
curl -i -X POST -H "Content-Type: application/json" -d '
{ "auth": {
"identity": {
"methods": ["token"],
"token": {
"id": "'$TOKEN'"
}
}
}
}' "https://devstack.goncharov.v6.rocks/identity/v4/auth/tokens" ; echo
Service Account is a "user" that does not have credentials.
Policy enforcement is done with Open Policy Agent.
Example: prevent server update/deletion with the tag "prod" without special role.
Policies can differ for different domains. Long-run - customer managed policy injects.
Thank you for showing interest!