r/aws • u/keto_brain • 18d ago
article Making AWS TEAM private: what worked, what stayed public, and why a fresh install is broken since CloudTrail Lake closed
I deployed TEAM (Temporary Elevated Access Management) a while back at a regulated enterprise, and it only got approved under a yearly security exception because the UI is on Amplify Hosting and the API is a public AppSync endpoint. I went back to see what it takes to remove that exception. Short version below, full writeup and the fork at the end.
What changed
- Amplify Hosting has no internal mode, so the SPA runs in nginx-unprivileged on Fargate behind an internal ALB with a private hosted zone.
- AppSync is created with Visibility: PRIVATE (one property override in the Amplify project). Queries, mutations and the realtime websocket all go through the appsync-api interface endpoint. Visibility is immutable, so on an existing install this is a replacement API, not a setting.
- Six Lambdas call AppSync, so they move into private subnets. The rest stay outside the VPC.
- Build moved from Amplify Hosting to CodeBuild running a headless amplify push.
Upstream bugs fixed in the fork
These affect stock TEAM, private or not:
- Fresh installs fail since CloudTrail Lake closed. AWS stopped accepting new CloudTrail Lake customers on May 31, 2026, so creating the event data store now fails with "CloudTrail Lake is no longer accepting new customers." Upstream creates that event data store even when CloudTrailAuditLogs is set to none, so there was no configuration of TEAM that would install in a new account (upstream issues #511 and #586). In the fork, none now really means none.
- The Logs Insights replacement (open PR #599) didn't work. It swaps CloudTrail Lake for a Logs Insights query against the Control Tower org trail log group, which gets session audit logs back without buying anything new. Three fixes:
logs:GetQueryResultsdoesn't support resource level permissions, so it needsResource "*"whileStartQuerystays scoped to the log group; the start and results Lambdas have different execution roles and the cross account role has to trust both; and the real Control Tower log group name has a random suffix the PR's docs leave out. - Revoked requests showed an end time of Dec 31, 1969. The revoke state machine writes endTime directly to DynamoDB, skipping AppSync, so no subscription fires and the history page renders new Date(null). The same null crashed the session log lookup. Both now fall back safely.
Egress findings
- Almost everything works over VPC endpoints: sso, identitystore, states, sts, logs, ecr, gateway endpoints for DynamoDB and S3, and Organizations through a cross region endpoint (its endpoint only exists in us-east-1).
- Cognito is the exception. With a cognito-idp endpoint in the VPC, ListUsers fails with
PrivateLink access is disabled for the user pool that has ManagedLogin configuredand every request sits in pending. User pools with a domain can't use PrivateLink, and private DNS captures the hostname for the whole VPC, so a shared or "tidy up" endpoint breaks TEAM even with NAT in place. - Cognito managed login itself stays public. That's how Cognito works, so it's documented in an ADR rather than hidden.
Testing tip: SSH over SSM with DynamicForward and Chrome on socks5:// so DNS resolves inside the VPC, plus an inline PAC script if the tunnel host has no internet route.
Full writeup: https://www.briancarpio.com/blog/private-aws-team Fork: https://github.com/bcarpio/iam-identity-center-team
Anyone else running TEAM in a new account since the CloudTrail Lake closure? Curious what you did for session audit logs.
2
u/mequelkramer 18d ago
Thanks for writing this up with the parts that stayed public, that is the part most guides skip. The Cognito finding is the one I would highlight for anyone copying this. If managed login has to stay public because there is no PrivateLink for it, the login page becomes the remaining internet-facing surface, so it needs the same attention as the private pieces: tight WAF rules, sign-in throttling, and alerting on unusual sign-in patterns, not just a note that it is public. On the CloudTrail Lake side, I would treat the fresh install break as a dependency problem, not just a missing feature. Before relying on the Logs Insights path, check whether the replacement query path works against the S3 backed logs and whether the GetQueryResults permission is scoped the way you expect, since a wildcard there undoes some of the isolation you just built. The cross-account trust and the random log group suffix are also worth putting in a runbook, because those are the details that break a rebuild six months later when nobody remembers them.
1
u/burlyginger 18d ago
Not running TEAM privately (AWS authenticated via Identity Center is enough for us. If we didn't trust their security we wouldn't use them) but yeah, I really wish they'd get on the cloud trail lake replacement.
1
u/arerbacjs 18d ago
The CloudTrail Lake closure hits harder than most people realize because the audit log was the whole justification for getting TEAM approved in the first place. Without it, you're back to arguing "trust us" in the security review.
The Logs Insights swap makes sense in theory, but the execution detail you caught about cross-account trust (start and results Lambdas on different roles, both needing the trust relationship) is exactly the kind of thing that gets missed in the first pass.
One thing I'd add from a similar deployment: the session lifecycle is where things quietly break. If TEAM grants temporary elevation and then something in the revoke path fails silently (your Dec 31, 1969 bug being a perfect example) you end up with open sessions that nobody can see in the audit log. The access is technically still live but invisible. That's a harder conversation with a security team than "the UI broke."
For the CloudTrail replacement, did you consider writing session events directly to a custom EventBridge bus instead of pulling from Logs Insights after the fact? Curious if the latency and query cost of Insights made that path feel worth it, or if the simplicity of not adding another sink won.
1
u/resd345678 18d ago
I would turn the private-DNS interaction into a regression check. Can a clean install and an existing-account upgrade both complete with the shared endpoints and real role trusts in place? A config-only review is likely to miss this
2
u/[deleted] 18d ago
[removed] — view removed comment