Skip to content

chore(amazonq): authenticate agentic-chat E2E tests via a dedicated OIDC role#2789

Open
laileni-aws wants to merge 2 commits into
aws:mainfrom
laileni-aws:feature/dexp-oidc-integ-test-auth
Open

chore(amazonq): authenticate agentic-chat E2E tests via a dedicated OIDC role#2789
laileni-aws wants to merge 2 commits into
aws:mainfrom
laileni-aws:feature/dexp-oidc-integ-test-auth

Conversation

@laileni-aws

@laileni-aws laileni-aws commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Re-point the q-agentic-chat-server integration tests (.github/workflows/integration-tests.yml) at a team-owned SSO bearer token, authenticated via a dedicated least-privilege GitHub-OIDC role, replacing the previous token-refresher role + lambda that has been removed.

Changes

  • Configure AWS Credentials now assumes the read-only OIDC role arn:aws:iam::550160095699:role/LanguageServersGitHubActionsReadRole (us-east-1), session name lsp-integ-ci.
  • Removed the Refresh Token step (aws lambda invoke ... TokenRefresherLambda): the token secret is refreshed out-of-band every ~5 min, and the new role intentionally has no lambda:InvokeFunction.
  • Get SSO Token now does a raw secretsmanager:GetSecretValue + jq extraction of the access token into TEST_SSO_TOKEN, and masks it with ::add-mask:: (public repo).
  • Tags traffic with AWS_SDK_UA_APP_ID=lsp-integ-ci so the token provider's dashboards can attribute/exclude CI traffic.

Security

  • OIDC trust is scoped to this repo with a tightened sub (branch refs, not :*) and aud=sts.amazonaws.com.
  • Least-privilege: secretsmanager:GetSecretValue on one secret + kms:Decrypt on its key. No write, no lambda.
  • Token masked in logs; only non-secret identifiers (account id, role ARN, secret name) appear, consistent with the prior setup.

Testing

integration-tests.yml runs post-merge via workflow_run (not a PR gate). Once unblocked, we'll trigger a post-merge run and confirm the OIDC assume succeeds, the token is masked, and q-agentic-chat-server passes across the OS matrix. For workflow_run events the OIDC sub ref will be verified against the trust policy on that first run.

…chat E2E tests

Short-term Flare fix: re-point the q-agentic-chat-server integration tests at the
DEXP-owned SSOTokenSecret in the gamma-IAD canary account, replacing the removed
Blueshift QnetTransformTokenRefresher.

- Configure AWS Credentials now assumes the least-privilege OIDC read role
  arn:aws:iam::550160095699:role/LanguageServersGitHubActionsReadRole (us-east-1).
- Remove the 'Refresh Token' lambda-invoke step; the canary SSORefreshTokenLambda
  refreshes SSOTokenSecret every ~5 min.
- Replace 'Get SSO Token' with a raw GetSecretValue + jq extraction of the
  canaryGammaIAD accessToken into TEST_SSO_TOKEN, masked via ::add-mask::.
- Tag traffic with AWS_SDK_UA_APP_ID=lsp-integ-ci for dashboard/BI segmentation.

DO NOT MERGE yet: depends on the OIDC role deploying (canary CR-290695975),
AppSec sign-off, and repo secrets TEST_SSO_START_URL + TEST_PROFILE_ARN.
@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.06%. Comparing base (abb1096) to head (6412c1c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2789      +/-   ##
==========================================
- Coverage   60.20%   60.06%   -0.15%     
==========================================
  Files         281      281              
  Lines       71191    71191              
  Branches     4575     4549      -26     
==========================================
- Hits        42861    42758     -103     
- Misses      28241    28345     +104     
+ Partials       89       88       -1     
Flag Coverage Δ
unittests 60.06% <ø> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@laileni-aws
laileni-aws marked this pull request as ready for review July 20, 2026 21:10
@laileni-aws
laileni-aws requested a review from a team as a code owner July 20, 2026 21:10
Point TEST_SSO_START_URL / TEST_PROFILE_ARN at new repo secrets
INTEG_TEST_SSO_START_URL / INTEG_TEST_PROFILE_ARN instead of the existing
TEST_SSO_START_URL / TEST_PROFILE_ARN (the env var names the test reads are
unchanged; only the secret source moves).

The old secrets still feed the current QnetTransform-based workflow, so
overwriting them would risk breaking the currently-passing tests and they are
unrecoverable once QnetTransform is torn down. New names keep old and new
isolated and preserve a clean rollback: reverting this PR restores the old
workflow + old secrets, which still work while QnetTransform is alive.
with:
role-to-assume: arn:aws:iam::964765661569:role/GitHubActionsTokenRefresherRole
role-session-name: language-servers-github
# DEXP-owned GitHub-OIDC read role in the gamma-IAD canary account (550160095699):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we should mention accounts on open source PRs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its fine we do mention this even before!

@laileni-aws
laileni-aws requested a review from ashishrp-aws July 22, 2026 00:45
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.

4 participants