Skip to content

Commit d7ece64

Browse files
committed
aap: align OIDC admin path with access-aap-admin
1 parent 7955f9e commit d7ece64

5 files changed

Lines changed: 34 additions & 14 deletions

File tree

aws-metal-openshift-demo/docs/authentication-model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Today those IdM local groups are:
7979
| `access-linux-admin` | Linux/RHEL admin | Granted passwordless sudo by `admins-nopasswd-all` |
8080
| `access-virt-admin` | reserved virtualization role | group exists; no broad privilege binding documented as default |
8181
| `access-developer` | reserved non-admin role | group exists; no broad privilege binding documented as default |
82-
| `access-aap-admin` | reserved AAP policy target | group exists in IdM and AD-trust mapping; current clean-build AAP superuser binding still uses `access-openshift-admin` |
82+
| `access-aap-admin` | AAP admin | Grants AAP gateway superuser through the Keycloak authenticator map |
8383

8484
That means:
8585

@@ -141,7 +141,7 @@ In the validated clean-build path:
141141

142142
- AAP uses the Keycloak realm already deployed for cluster SSO
143143
- the AAP client ID is `aap`
144-
- the required admin group is `access-openshift-admin`
144+
- the required admin group is `access-aap-admin`
145145
- direct AAP LDAP is not the supported default path
146146

147147
### RHEL Hosts

aws-metal-openshift-demo/docs/manual-process.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,10 +1784,12 @@ ipa pwpolicy-mod access-linux-admin \
17841784
ipa user-add sysop --first=Sys --last=Op --shell=/bin/bash --password <<< '<lab-default-password>'
17851785
ipa user-add virtadm --first=Virt --last=Admin --shell=/bin/bash --password <<< '<lab-default-password>'
17861786
ipa user-add dev --first=Dev --last=User --shell=/bin/bash --password <<< '<lab-default-password>'
1787+
ipa user-add aapadmin --first=AAP --last=Admin --shell=/bin/bash --password <<< '<lab-default-password>'
17871788

17881789
ipa user-mod sysop --setattr=krbPasswordExpiration=20360313235039Z
17891790
ipa user-mod virtadm --setattr=krbPasswordExpiration=20360313235039Z
17901791
ipa user-mod dev --setattr=krbPasswordExpiration=20360313235039Z
1792+
ipa user-mod aapadmin --setattr=krbPasswordExpiration=20360313235039Z
17911793

17921794
ipa dnsrecord-add workshop.lan virt-01 --a-rec=172.16.0.1 2>/dev/null || \
17931795
ipa dnsrecord-mod workshop.lan virt-01 --a-rec=172.16.0.1
@@ -1832,6 +1834,7 @@ ipa group-add-member access-linux-admin --users=sysop
18321834
ipa group-add-member access-openshift-admin --users=sysop
18331835
ipa group-add-member access-virt-admin --users=virtadm
18341836
ipa group-add-member access-developer --users=dev
1837+
ipa group-add-member access-aap-admin --users=aapadmin
18351838

18361839
ipa sudorule-add admins-nopasswd-all \
18371840
--desc='Permit access-linux-admin group members to run any command on any host without authentication'
@@ -4548,7 +4551,7 @@ The validated clean-build path uses:
45484551
- Keycloak realm: `openshift`
45494552
- AAP client ID: `aap`
45504553
- AAP authenticator name: `Red Hat build of Keycloak`
4551-
- required AAP admin group: `access-openshift-admin`
4554+
- required AAP admin group: `access-aap-admin`
45524555
45534556
```bash
45544557
# Configure Keycloak SSO for AAP.
@@ -4667,12 +4670,12 @@ curl -sk -X POST https://${AAP_ROUTE}/api/gateway/v1/authenticator_maps/ \
46674670
-H 'Content-Type: application/json' \
46684671
-d @- <<JSON
46694672
{
4670-
"name": "access-openshift-admin AAP superuser",
4673+
"name": "access-aap-admin AAP superuser",
46714674
"map_type": "is_superuser",
46724675
"triggers": {
46734676
"groups": {
46744677
"has_or": [
4675-
"access-openshift-admin"
4678+
"access-aap-admin"
46764679
]
46774680
}
46784681
},
@@ -4694,8 +4697,8 @@ before the final browser-style login proof:
46944697
expected group claims
46954698
46964699
If the lab trust path is enabled, the validated user is
4697-
`ad-ocpadmin@corp.lan`. Without AD trust, use the native IdM admin-path user
4698-
instead.
4700+
`ad-aapadmin@corp.lan`. Without AD trust, use the native IdM AAP admin user
4701+
`aapadmin` instead.
46994702
47004703
```bash
47014704
# Validate the AAP SSO entry and token flow.
@@ -4706,13 +4709,17 @@ KEYCLOAK_ROUTE="$(oc -n keycloak get route workshop-keycloak -o jsonpath='{.spec
47064709
47074710
curl -sk "https://${AAP_ROUTE}/api/gateway/v1/ui_auth/" | jq .
47084711
4712+
AAP_VALIDATION_USER="ad-aapadmin@corp.lan"
4713+
# When AD trust is disabled, switch this to the native IdM AAP admin user instead.
4714+
# AAP_VALIDATION_USER="aapadmin"
4715+
47094716
curl --cacert /etc/ipa/ca.crt -sS \
47104717
-X POST "https://${KEYCLOAK_ROUTE}/realms/openshift/protocol/openid-connect/token" \
47114718
-H 'Content-Type: application/x-www-form-urlencoded' \
47124719
--data-urlencode 'client_id=aap' \
47134720
--data-urlencode 'client_secret=<lab-default-password>' \
47144721
--data-urlencode 'grant_type=password' \
4715-
--data-urlencode 'username=ad-ocpadmin@corp.lan' \
4722+
--data-urlencode "username=${AAP_VALIDATION_USER}" \
47164723
--data-urlencode 'password=<lab-default-password>' \
47174724
| jq .
47184725
EOF

aws-metal-openshift-demo/docs/orchestration-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ Execution model:
804804
- creates or updates the Keycloak `aap` client in the existing realm
805805
- creates or updates the Keycloak `groups` and `aap-audience` protocol mappers
806806
- creates the `Red Hat build of Keycloak` gateway authenticator
807-
- creates the `access-openshift-admin AAP superuser` authenticator map
807+
- creates the `access-aap-admin AAP superuser` authenticator map
808808
- removes the legacy direct-LDAP authenticator when present
809809
- validates AD-backed OIDC login after the gateway rollout when trust is
810810
enabled, otherwise validates the native IdM user path
@@ -813,7 +813,7 @@ Validated live result:
813813

814814
- route `https://aap.apps.ocp.workshop.lan`
815815
- login page shows `Red Hat build of Keycloak`
816-
- `ad-ocpadmin@corp.lan` authenticates through Keycloak/IdM on the live trust
816+
- `ad-aapadmin@corp.lan` authenticates through Keycloak/IdM on the live trust
817817
path
818818
- the resulting AAP user has `is_superuser: true`
819819
- a clean AAP teardown and redeploy was revalidated on the same OIDC path

aws-metal-openshift-demo/vars/day2/openshift_aap.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ openshift_aap:
1313
idm_ca_secret_name: workshop-aap-idm-ca
1414
route_host: aap.apps.ocp.workshop.lan
1515
bundle_cacert_secret: workshop-aap-idm-ca
16-
validation_username: sysop
16+
validation_username: aapadmin
1717
validation_password: "{{ lab_default_password | default('') }}"
1818
database:
1919
postgres_storage_class: ocs-storagecluster-ceph-rbd
@@ -45,7 +45,7 @@ openshift_aap:
4545
client_secret: "{{ lab_default_password | default('') }}"
4646
groups_claim: groups
4747
required_group_names:
48-
- access-openshift-admin
48+
- access-aap-admin
4949
protocol_mapper:
5050
name: groups
5151
claim_name: groups
@@ -55,9 +55,15 @@ openshift_aap:
5555
included_client_audience: aap
5656
validation_username: >-
5757
{{
58-
openshift_oidc_auth.validation.ad_test_user
58+
('ad-aapadmin@' ~ ad_server.domain_name)
5959
if (lab_configure_ad_trust | default(false) | bool)
60-
else openshift_oidc_auth.validation.native_test_user
60+
else (
61+
idm_server.identity_users
62+
| selectattr('groups', 'contains', 'access-aap-admin')
63+
| map(attribute='name')
64+
| first
65+
| default('')
66+
)
6167
}}
6268
validation_password: >-
6369
{{

aws-metal-openshift-demo/vars/guests/idm_vm.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,13 @@ idm_server:
254254
password: "{{ lab_default_password | default('') }}"
255255
groups:
256256
- access-developer
257+
- name: aapadmin
258+
first_name: AAP
259+
last_name: Admin
260+
shell: /bin/bash
261+
password: "{{ lab_default_password | default('') }}"
262+
groups:
263+
- access-aap-admin
257264
sudo_policy:
258265
enabled: true
259266
rule_name: admins-nopasswd-all

0 commit comments

Comments
 (0)