Why is IAM enforcement off by default when the test key already bypasses it? #7975
|
Floci accepts every request unless With enforcement on, the permissive "test mode" is still there: the
Questions:
I'm running with enforcement on, with Terraform managing Organizations, IAM Identity Center and EKS, and read-only and power-user roles behave as they would on AWS. |
Replies: 3 comments 1 reply
|
Good question, and the docs actually answer (1) explicitly — the rationale is backward compatibility, not performance or coverage:
( On (2), "make enforcement the default for real IAM identities": this is the interesting proposal, and the code already supports the distinction you want. The docs describe exactly the split:
That means the bypass path and the enforced path already coexist under one flag; "enforce for IAM identities, bypass for test keys" is a default-value change, not a new mechanism. The honest counter-argument (and I'd raise it before opening an issue) is that enforcement is not yet a faithful AWS model in two documented places, and flipping the default would turn those into surprise failures for anyone who starts using real IAM identities:
So a default flip is more defensible once (1) is closed than before. On (3), a startup warning: this is the cheapest useful improvement and I'd argue it's worth doing regardless of (2). Two specific gaps that make the warning more valuable than it sounds:
My suggestion for how to structure the change, if you want to push on (2):
That ordering gets you the behaviour you want in your own Terraform/IAM Identity Center setup today, without putting a default-flip blocker behind the unrelated MFA work. |
|
One thing about the default that's worth naming precisely, since it's the reason the test key works: The test key bypasses IAM because the enforcement layer fails open for it, not because IAM is unenforced. That's the dangerous shape: the test key is a path that exercises the same code with the check short-circuited, so If the default is deliberately off to keep the quickstart frictionless, the fix that keeps both properties is a loud startup warning when IAM is off and a non-test key is used, rather than flipping the default. |
|
Thanks @mrfelek for the clear write up, and @2SinceJuly for the careful answers. On (1), backward compatibility is the reason: flipping the default would turn every Lambda or assumed role session with too narrow a role into On (3), yes please: one WARN the first time a request signed by an IAM user key or a role session arrives while enforcement is off is the right shape, since it reaches exactly the people whose policies are not checked and stays quiet for the On (2), I'd revisit the default once the MFA condition keys are in the request context, since today a policy using the |
Thanks @mrfelek for the clear write up, and @2SinceJuly for the careful answers.
On (1), backward compatibility is the reason: flipping the default would turn every Lambda or assumed role session with too narrow a role into
AccessDeniedon upgrade, which is the risk @mrfelek names. So the default stays off for now.On (3), yes please: one WARN the first time a request signed by an IAM user key or a role session arrives while enforcement is off is the right shape, since it reaches exactly the people whose policies are not checked and stays quiet for the
testkey workflow.On (2), I'd revisit the default once the MFA condition keys are in the request context, since today a policy using the
a…