Skip to content

fix: ensure CSP credential OIDC client on install, pass IdP Config in AWS bootstrap, align workflow menu path - #245

Merged
MZC-CSC merged 5 commits into
m-cmp:mainfrom
MZC-CSC:develop
Nov 19, 2026
Merged

MZC-CSC merged 5 commits into
m-cmp:mainfrom
MZC-CSC:develop

Conversation

@MZC-CSC

@MZC-CSC MZC-CSC commented Nov 19, 2026

Copy link
Copy Markdown
Member

What

1. Ensure the CSP temporary-credential OIDC client on install (conf/docker/conf/mc-iam-manager/1_setup_auto.sh)

  • Add Step 6-1 ensure_oidc_client (idempotent, non-fatal).
    • If the client does not exist, create it: confidential, service accounts on, direct access grants on, standard flow off, secret from MC_IAM_MANAGER_KEYCLOAK_OIDC_CLIENT_SECRET, with an audience mapper that adds the client itself to the access token aud.
    • If it exists, keep its settings. Add only the audience mapper when it is missing, and warn when the secret differs.
  • On a clean install, mciam-oidc-Client was never created, so issuing CSP temporary credentials always failed with 401 invalid_client.

2. AWS CSP bootstrap passes the IdP Config to the CspRole (1_setup_auto.sh)

  • Step 3 (POST /api/roles/csp) now sends the IdP Config id created in Step 2 (cspIdpConfigId), so mc-iam-manager can store the role's IdP Config, account and idp_identifier (the Config's provider ARN).
  • Skip with a log, instead of creating a wrong account/Config, when MC_IAM_MANAGER_AWS_ACCOUNT_ID is not 12 digits or MC_IAM_MANAGER_PUBLIC_DOMAIN is empty or an internal name.
  • Look up accounts and Configs by exact name (the list name filter is a partial match).
  • Do not update existing items; only warn when they differ from .env (.env is for the initial setup).
  • Include the audience (MC_IAM_MANAGER_KEYCLOAK_OIDC_CLIENT_NAME) when creating the IdP Config.

3. Align the workflow menu path (conf/docker/conf/mc-web-console/api/conf/webconsole_menu_resources.yaml)

  • Change the mcworkflows path from /web/workflow/list to /web/workflows/workflow/list, matching m-cmp/mc-web-console (commit 65ac38fa).
  • mc-admin-cli deploys this bundled copy to seed the mc-iam-manager menu table, so the fix in mc-web-console alone does not reach admin-cli deployments. The old path only worked through a router redirect.

Notes

  • The admin-cli copy of 1_setup_auto.sh is what gets deployed, so it carries the same fix as mc-iam-manager (OIDC client ensure and CspRole IdP Config). The cspIdpConfigId handling lands in mc-iam-manager separately. Older mc-iam-manager versions ignore the extra field.
  • Menus are seeded once at install time. Existing environments need a menu re-seed (e.g. POST /api/setup/initial-menus2?force=true) to pick up the new path.

yh-noh and others added 5 commits November 10, 2026 14:05
클린 설치 후 Keycloak 에 mciam-oidc-Client 가 없어 CSP 임시자격증명 발급이
401 invalid_client 로 실패하던 문제 보정 (IAM-BUG-040, BAR-1941).
admin-cli 사본이 배포 정본이라 mc-iam-manager 원본과 같은 수정을 반영.

- Step 6-1 ensure_oidc_client 추가 (non-fatal, 멱등)
  - 없으면 생성: confidential, Service accounts ON, Direct access grants ON,
    Standard flow OFF, secret=MC_IAM_MANAGER_KEYCLOAK_OIDC_CLIENT_SECRET,
    audience mapper(access token aud 에 클라이언트 자신) 포함
  - 있으면 설정은 유지하고 audience mapper 만 없을 때 추가, secret 불일치는 경고
- Step 3 POST /api/roles/csp 에 Step 2 IdP Config id(cspIdpConfigId)를 넘긴다.
  IAM 이 CspRole 에 소속 Config·계정과 idp_identifier(Config 의 Provider ARN)를 채운다.
- MC_IAM_MANAGER_AWS_ACCOUNT_ID 가 12자리가 아니거나 MC_IAM_MANAGER_PUBLIC_DOMAIN 이
  비었거나 내부 이름이면 잘못된 계정·Config 를 만들지 않고 skip 로그를 남긴다.
- 계정·Config 조회는 이름이 정확히 같은 항목만 고른다(list 의 name 필터는 부분 일치).
- 이미 있으면 갱신하지 않고, .env 값과 다르면 경고만 남긴다(.env 는 최초 설정용).
- IdP Config 생성 시 audience(MC_IAM_MANAGER_KEYCLOAK_OIDC_CLIENT_NAME)를 함께 넣는다.

Refs: IAM-BUG-040, IAM-BUG-042
chore: workflow 메뉴 경로를 정식 경로로 변경
fix(iam): 설치 시 OIDC 클라이언트 보장, AWS 부트스트랩 소속 IdP Config 전달과 .env 검증
@MZC-CSC
MZC-CSC merged commit dd9f880 into m-cmp:main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants