mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
Floci dispatched the five operations that turn centralized root access on and off and nothing that uses it, so the feature was half emulated: AssumeRoot, the operation they exist for, answered UnsupportedOperation. The five took no caller check of their own either, so any account could enable or disable organization wide root features, and the record they wrote was scoped to the calling account, which left the management account's toggle invisible to a delegated administrator. All five answer for one organization now, so all five check the caller, and each refusal is a shape the reference models on them and on nothing else: no organization is OrganizationNotFound, one without All features is OrganizationNotInAllFeaturesMode, one without trusted access for IAM is ServiceAccessNotEnabled, and a caller that is neither the management account nor a delegated administrator is AccountNotManagementOrDelegatedAdministrator. The two enable operations add CallerIsNotManagementAccount, modeled on them alone, so a delegated administrator may read the features and turn them off but not on. The feature set belongs to the organization, so it is read and written in the management account's scope whoever asks, and the OrganizationId the model declares beside EnabledFeatures is answered now that the organization is known. Organizations answers all of this through a provider interface in the iam package, the way ScpProvider already does, so IAM still does not depend on it. AssumeRoot opens the session those features allow. It acts as the member account's root user, which no identity policy grants or denies, scoped by the TaskPolicyArn the request names: the five AWS managed policies the model names, under the root-task path, each denying everything it does not name, so the policy is the whole of the bound and is read beside the root's own allow-all rather than as a session policy with nothing to allow. A customer- managed policy can carry that path too and is refused, being the caller's own document rather than one of AWS's. The caller must be able to manage root access and have RootSessions enabled, the target must be a member account other than the management account, and the audit reads those policies allow name the member account's root user when they carry no UserName, which is what their own arn:aws:iam::*:root asks for. What is chosen rather than read is documented in docs/services/sts.md: the operation models only RegionDisabled and ExpiredToken, so every caller, target and feature refusal is AccessDenied 403 and a task policy outside the root-task path is a ValidationError, the shape MinimumSessionTokenSize also answers outside the 0 to 4096 the model declares for it, the size asked for being the size issued. The guide's refusal of root user credentials covers both credentials this emulator reads as the account root, one that resolves to a root ARN and the bare account-id key the enforcement filter calls floci's account-root principal, so a privileged session is opened by an IAM user or role of the management account as it is on AWS. The global endpoint is refused when the request arrives on that host, which is the only way a request says so.