Repository navigation
Every team AWS read is made as the team's role - #782
Merged
Merged
Conversation
On a self-hosted install in the team's own AWS account, live::aws::assume swapped CoderHelmLogReader for the install's own Lambda role, which never gets the WAF reads. A run's WAF tools were refused as the worker's role, the refusal blamed the team's role and the run waited; the wait's re-check took on the reader itself, was allowed and restarted the run, which was refused again: a loop. - assume always takes on the team's role and returns a TeamSession, the only session WAF, alarm evidence, WAF log objects, metrics, log reads and the permission check accept. - log_findings::session_for (the re-check) is the account's connection taken on with assume: the same target and call as the run's tools. - A refusal of a principal that isn't the team's role names it and is CoderHelm's own failure, never the team's setup item. - A run a re-check restarted never waits again for what the re-check read (role_wait::ending_after): an error log, one line on the run, and it goes on with what it has. - Incident rk_team_reads_as_the_team_role.
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a self-hosted install that runs in the team's own AWS account, a WAF alarm run's WAF tools were refused
wafv2:ListWebACLs. CloudTrail showed the calls came from the worker's own Lambda role, not fromCoderHelmLogReader. The cause is inlive::aws::assume(services/common/src/live/aws.rs:558,install_targetandown_session). When the reader was in the install's account, it swapped the reader for the install's own role, and that role never gets the WAF reads. The refusal blamed the team's role, so the run waited for it. The wait's re-check (log_findings::session_for) took on the reader itself, was allowed, and restarted the run. The restarted run read with the worker's role again and was refused again, so it looped.Now every read of a team's AWS data is made as the team's role. The run and the re-check take on the role with the same call. A refusal names the principal AWS refused. A restarted run never waits twice for the same read.
Changes
live/aws.rs:assumealways takes on the connected role with the team's private ID. The install-account swap (install_target) is removed.assumeandassume_exactreturn a newTeamSession, which carries the role ARN. Nothing else can build one.refused_principalandrefused_other_principalfunctions.TeamSession: WAF alarm evidence, sampled requests, WAF log objects (alarm_evidence,waf_logs::read), CloudWatch metrics (metrics::Aws,probe), log reads (log_repo::live::Live,log_look::LiveLook) and the permission check's probes. The install's own credentials (own_session) can't be passed to any of them.log_findings::session_for(the re-check, alarm evidence and log reads) loads the account's connection withAwsAccount::from_item(..).target()and callsassume. That is the same target and the same call the run's tools use.live/permissions.rs: the check runs on the role the reads use, the install's own account included. The integrations page and the connect check no longer hide the update stack for the install's own account.alarm_evidence::failure_line,metrics::aws_error): when AWS refused a principal that isn't the team's role, the line names that principal and says it is CoderHelm's own failure. It also writes an error log and never counts as the team's "AWS role reads" item.role_wait:go_onrecords the reads that let it restart the run (ROLE_WENT_ON#<new run>).finish_without_codedecides withending_after. When the restarted run is refused one of those same reads, it endsOwnFailureand never waits again: an error log, one line on the run, then it plans again with what it has.docs/self-host/integrations.md: the install's own account is read as the team's role and shows Update in AWS like any other account. Knowledge bases stay on the install's role.rk_team_reads_as_the_team_role(doc and replay test).cxnow checks forending_after.Knowledge-base reads in the install's account keep using the install's own role, as
bedrock.mddocuments. They are not part of this change.Verification
cargo fmt --all --checkandrustfmt --edition 2021 --checkon the incident files: clean.cargo clippy -p common -p worker -p gateway --all-targets -- -D warnings: clean.cargo test -p common -p worker -p gateway: common 2827 passed, gateway 1083 passed, worker 2281 passed, integration tests passed.rk_team_reads_as_the_team_role(same-account install; the worker role is refused, the reader role is allowed):assumeon the same-account reader never returns the worker's keys. On main it returns them without calling STS.coderhelm-prod-ServiceRole-…, says it is CoderHelm's own failure, and is not counted against the team's role. The team role's own refusal is still the team's item.wafv2:ListWebACLsand then refused it again endsOwnFailure, not a second wait. A different read still waits, and a person's item still goes to the person.ending_after,failure_line,reader_targetandTeamSessiondon't exist there.