Security

plainfra access and revocation

What the plainfra read-only role can see in your AWS account, what it cannot, and how to remove it.

This is written for the person who approves the access rather than the person who installs it. Every claim below can be checked with a read-only command against your own account, and section 5 gives you those commands. Placeholders: ACCOUNT_ID (your 12-digit AWS account ID), EXTERNAL_ID (the value plainfra issues you), REGION (the region you deployed the stack in), OU_ID (the organisational unit the account sits in, or your organisation root ID if you have no organisational units, format r-xxxx).

The install creates exactly one resource: an IAM role named plainfra-ReadOnly. No buckets, no functions, no users, no other roles. Source of truth is the CloudFormation template itself, published at customer-role.yaml. Read it before you deploy it; we encourage that.

1. The off switch

Deleting the CloudFormation stack deletes the role. Run this in the account you want to remove, one command, no arguments to prepare:

aws cloudformation delete-stack --stack-name plainfra-ReadOnly --region REGION

For accounts installed through StackSets, remove the stack instance instead:

aws cloudformation delete-stack-instances --stack-set-name plainfra-readonly --deployment-targets OrganizationalUnitIds=OU_ID,Accounts=ACCOUNT_ID,AccountFilterType=INTERSECTION --regions REGION --no-retain-stacks --region REGION

The organisational unit and the account filter are both required here, even when you are removing a single account. A service-managed StackSet only accepts an organisational unit as its target, so passing Accounts= on its own is rejected with ValidationError: StackSets with SERVICE_MANAGED permission model can only have OrganizationalUnit as target. If your organisation is flat and has no organisational units, use the organisation root ID (format r-xxxx) as OU_ID, which is a valid target.

Either command returns immediately and the role is gone in about a minute. That is the complete removal: no residue, nothing to clean up afterwards, no coordination with plainfra required. You do not need to tell us, and you do not need our agreement.

Two things worth being straight about.

Disconnecting the account in the plainfra console does not revoke AWS access. It stops plainfra querying the account and frees the account ID for future reconnection, but the role and its trust policy stay exactly as they are, still assumable. plainfra simply stops calling sts:AssumeRole because it no longer has a reason to. If you want the access gone rather than unused, delete the stack. That is the only step that removes anything.

Cutting access without deleting the role takes two commands, not one. Blocking the trust policy stops new sessions being issued. It does not touch sessions that already exist, because AWS does not retroactively invalidate session tokens when a trust policy changes. Two bounds decide how long that gap lasts: role sessions are capped at one hour (MaxSessionDuration: 3600), and plainfra caches assumed-role credentials in a warm process for up to 45 minutes.

We have measured this rather than reasoned about it. With a deny-all trust policy applied to the role and a fresh sts:AssumeRole correctly refused within about eight seconds, a query against that same account still returned live data from cached credentials. If you use the trust-policy edit on its own as an incident stop, you have a window, and it can be tens of minutes long.

To stop access now, run both steps in this order.

First, block the trust policy:

aws iam update-assume-role-policy --role-name plainfra-ReadOnly --policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Principal":{"AWS":"*"},"Action":"sts:AssumeRole"}]}'

Then invalidate the sessions already issued, which is the step that closes the window. AWS provides this explicitly: an AWSRevokeOlderSessions inline policy denying everything issued before a given aws:TokenIssueTime. The IAM console exposes it as "Revoke active sessions" on the role, and the same policy can be attached with iam:PutRolePolicy (AWS documentation).

Neither step alone is sufficient. The first without the second leaves existing sessions working. The second without the first stops current sessions but lets a new one be issued straight away.

To restore access afterwards, put the original trust policy back:

aws iam update-assume-role-policy --role-name plainfra-ReadOnly --policy-document '{"Version":"2012-10-17","Statement":[{"Sid":"AllowPlainfraAssumeWithExternalId","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::121754142582:role/plainfra-lambda-execution"},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"sts:ExternalId":"EXTERNAL_ID"}}},{"Sid":"AllowPlainfraGatewayAssumeWithExternalId","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::121754142582:role/plainfra-mcp-execution"},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"sts:ExternalId":"EXTERNAL_ID"}}}]}'

That is the trust policy of a standard install, which names the two service roles listed in section 6. If the investigation service was enabled for your account, your role's original trust policy also names a third plainfra role, plainfra-investigation-gateway; before you overwrite anything, save the current policy with the get-role command in section 5 so you can put back exactly what was there.

If you revoked sessions as well, remove the AWSRevokeOlderSessions inline policy from the role, or it keeps denying.

All of this leaves the CloudFormation stack in a drifted state, which is fine for an incident and wrong as a permanent removal. If you are finished with plainfra rather than pausing it, delete the stack instead. Deleting the role removes the thing sessions are issued against, so there is nothing left to revoke.

2. What the role can see

The role has two parts. The base is AWS's own managed policy, ReadOnlyAccess, attached to the role. It is made of Describe*, List* and Get* style calls across essentially every AWS service, and it grants no write, create, update or delete action. It does include a few calls that are not plain reads: they start a drift check, a report or a connection test, or run a managed AI service such as Comprehend, Rekognition or Polly on input the caller supplies. Over it sits one inline policy, PlainfraBoundary, which only denies, and which denies every one of those calls we have found. The one kind of call plainfra keeps that starts something is a CloudWatch Logs Insights query (logs:StartQuery and logs:StopQuery), which is how it reads logs. Section 3 lists what the boundary denies.

Because the base is a managed policy that AWS maintains, you read it from AWS rather than from our template: it is one command (section 5), and its contents change when AWS adds a service. The boundary is written so that a future revision of ReadOnlyAccess cannot quietly widen the role: it denies some actions that the current version does not even grant.

In practice plainfra can read how every service in the account is configured, what it costs (Cost Explorer is part of ReadOnlyAccess), your CloudTrail event history, your security findings (GuardDuty, Security Hub, AWS Config, Access Analyzer), and your CloudWatch log content. The next two sections say where the line is.

Billing console access (invoices, payment methods and account details through aws-portal:ViewBilling, aws-portal:ViewPaymentMethods and aws-portal:ViewAccount) is not part of ReadOnlyAccess. It is off by default and only present if whoever deployed the stack set AllowBillingConsoleRead=true, in which case a third policy, PlainfraBillingConsoleRead, is attached. Section 5 shows you how to check which setting was used.

3. What the role cannot see

The inline PlainfraBoundary policy sits on top of ReadOnlyAccess. In IAM, an explicit deny always wins, so these hold regardless of what the managed policy grants now or later. These are the statements, and they are the part worth checking yourself.

Data contents. Object and file contents (s3:GetObject, s3:GetObjectVersion, s3express:CreateSession, S3 table data, S3 on Outposts objects, EBS snapshot blocks, EFS mounts, Glacier job output), source code (CodeCommit files, diffs and review comments, and Lambda function and layer packages through lambda:GetFunction and lambda:GetLayerVersion), DynamoDB records (dynamodb:GetItem, BatchGetItem, Query, Scan, PartiQLSelect, stream reads, and the same reads through DAX), rows and documents in Keyspaces, SimpleDB, OpenSearch and QLDB, stream and query payloads (kinesis:GetRecords, athena:GetQueryResults, redshift-data:GetStatementResult), HealthLake records, Kendra search results, Transcribe transcripts, IoT Analytics dataset contents, queue messages (sqs:ReceiveMessage), and SQL through the data APIs (rds-data:ExecuteStatement, redshift-data:ExecuteStatement).

plainfra can see that a bucket exists, how big it is and how it is configured. It cannot read a file out of it. It can see a DynamoDB table's schema and item count. It cannot read a row. The same goes for your end users: cognito-idp:ListUsers, cognito-idp:AdminGetUser, identity pool identities, the messaging-audience reads, SES per-message insights, and the subscribers and push endpoints of your SNS topics (sns:ListSubscriptions, sns:GetEndpointAttributes) are denied. Topics themselves stay readable.

Secrets and credential issuers. secretsmanager:GetSecretValue and BatchGetSecretValue, ec2:GetPasswordData, kms:GenerateDataKey*, the Cognito calls that return an app client or identity provider secret (cognito-idp:DescribeUserPoolClient, cognito-idp:DescribeIdentityProvider), and the calls that mint credentials or tokens (sts:GetSessionToken, sts:GetFederationToken, ecr:GetAuthorizationToken, ssm:GetAccessToken, cognito-identity:GetCredentialsForIdentity, codepipeline:GetJobDetails and others). The values of API Gateway API keys are denied through apigateway:GET on the API key and usage plan key paths.

Decryption, except of logs. kms:Decrypt is denied for every caller, so SecureString parameters and objects encrypted with your own keys cannot be read. The one exception is a decryption made through CloudWatch Logs (kms:ViaService of logs.*.amazonaws.com), so that a log group encrypted with your own key can still be read.

Execution. lambda:InvokeFunction, lambda:InvokeFunctionUrl, ssm:SendCommand, ssm:StartSession, ecs:ExecuteCommand, states:StartExecution, and EC2 Instance Connect, plus the calls that invoke managed AI services. plainfra cannot run anything in your account.

Side effects. A statement of its own, DenySideEffects, denies the calls in ReadOnlyAccess that are not plain reads: Comprehend, Rekognition, Textract and Polly analysis of input the caller supplies (comprehend:Detect*, rekognition:Detect*, polly:SynthesizeSpeech and similar), CloudWatch query generation, CloudFormation drift detection (cloudformation:Detect*), IAM report generation (iam:Generate*), AWS Config snapshot delivery, Elastic Beanstalk log bundling, DMS and Transfer Family connection tests, CloudWatch Logs live tail, X-Ray trace retrieval, and the DevOps Guru and Service Quotas jobs that start a report.

4. The edges you should know about

Section 2 grants configuration, and logs. Some of that is sensitive in its own right, and you would find it yourself in about twenty minutes of reading the template, so here it is up front.

  • CloudWatch log content is readable. logs:GetLogEvents, logs:FilterLogEvents and logs:StartQuery are not denied, because logs are evidence. Application logs carry whatever your applications write to them, which can include request details, identifiers and, if a developer logged it, credentials. Credential-shaped text is masked in plainfra's application layer before it is stored or sent to a model. That is an application control, not a permission boundary, and you should weigh it as one. If you want log access narrowed to named log groups, we will scope it with you.
  • Plain Systems Manager parameter values are readable. Parameter Store values of type String and StringList are configuration, and ssm:GetParameter is not denied. SecureString values cannot be read, because decrypting them needs kms:Decrypt, which is denied outside CloudWatch Logs. Do not keep a secret in a plain String parameter.
  • Secrets Manager metadata is readable; values are not. Secret names, descriptions, tags and rotation settings come with ReadOnlyAccess. GetSecretValue is denied.
  • Your user list, credential hygiene, and every IAM policy, role and group are readable. ReadOnlyAccess includes the IAM reads: your users, the account-level summary counts, which users have an MFA device registered, the account password policy, the age and status of access keys, the text of every managed and inline policy, every role and group and their trust relationships, and the SAML and OIDC federation configuration. That covers who has no MFA and whose key has not been rotated. No action returns a credential: a federation entry carries only the identity provider's public signing certificate and client identifiers, never a secret. The honest cost: every role, policy and trust relationship in your account is, in effect, a map of how privilege can escalate from one principal to another, and this grant hands plainfra a readable copy of it. It is the same view your own IAM console shows, and it is what every cloud security posture tool reads, but it is still a map.
  • CloudTrail event history is readable. cloudtrail:LookupEvents returns management events: who did what, when, from which IP address. That is activity data about your staff, not just configuration.
  • ECS environment values, bootstrap scripts and stack templates are configuration, and are readable. Lambda environment variables are not: AWS decrypts them with the caller's own kms:Decrypt, which the boundary denies, so AWS leaves them out of the function's configuration. ECS task definition environment values, an EC2 instance's userData bootstrap script (through ec2:DescribeInstanceAttribute), the rest of an ECS task definition, and CloudFormation templates, parameters and outputs can all contain a credential someone typed in. No IAM deny can scope to a field inside a response, so this is handled in plainfra's code instead: values with a sensitive name, a known credential format or a random-looking value are withheld, credential-shaped text in command lines, scripts and templates is masked, and sensitively named docker labels and log driver options are removed before the response is stored or shown. Values that look benign are shown, because comparing a working service to a broken one is one of the most common diagnoses there is. That is an application control, not a permission boundary, and you should weigh it as one.
  • S3 configuration is readable. Bucket names, policies, ACLs, encryption settings, lifecycle rules and public-access settings. Not object contents.
  • All resource tags are readable. Tags commonly carry owner names, email addresses, cost centres and project codenames.
  • Security findings are readable. GuardDuty, Security Hub, AWS Config and Access Analyzer results, including open findings. This is the current state of your security posture, including its gaps.

If any of those is unacceptable for a given account, the EC2-only variant (customer-role-lite.yaml, published alongside the full template) grants one allow permission, ec2:Describe*, and nothing else. It carries its own PlainfraBoundary deny policy, a shorter list of the same kind as the one described in section 3, and it does not attach ReadOnlyAccess. It uses the same role name and trust policy, so moving from lite to full later is an in-place stack update rather than a fresh install.

5. Verifying all of this yourself

Every command here is read-only. Run them in the target account against your own role. None of them go through plainfra.

Confirm which policies are attached to the role:

aws iam list-attached-role-policies --role-name plainfra-ReadOnly

That should return one policy, ReadOnlyAccess (arn:aws:iam::aws:policy/ReadOnlyAccess). For the lite role the list is empty. Then list the inline policies actually present:

aws iam list-role-policies --role-name plainfra-ReadOnly

Expect PlainfraBoundary, plus PlainfraBillingConsoleRead only if billing console access was enabled at deploy time (the lite role also lists PlainfraEc2DescribeOnly). Read the boundary in full:

aws iam get-role-policy --role-name plainfra-ReadOnly --policy-name PlainfraBoundary

Read the managed policy AWS maintains, at the version currently in force:

aws iam get-policy-version --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --version-id $(aws iam get-policy --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --query Policy.DefaultVersionId --output text)

Check who can assume the role and under what condition:

aws iam get-role --role-name plainfra-ReadOnly --query 'Role.AssumeRolePolicyDocument'

Test the denies directly rather than reading them. IAM policy simulation evaluates the real policy set and tells you the effective decision per action:

aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::ACCOUNT_ID:role/plainfra-ReadOnly --action-names s3:GetObject secretsmanager:GetSecretValue dynamodb:GetItem sqs:ReceiveMessage lambda:InvokeFunction lambda:GetFunction sns:ListSubscriptions kms:Decrypt ec2:GetPasswordData --output table

Every one of those should come back explicitDeny. Add any action you want to satisfy yourself about. For contrast, logs:FilterLogEvents and ssm:GetParameter should come back allowed, because logs and plain parameters are readable by design.

Confirm which parameters the stack was actually deployed with, including whether billing console read was turned on. The command depends on how the role was installed, because a StackSet does not name its stacks the way a direct install does.

If the role was installed directly into this account, with CloudShell or the console quick-create, the stack is named plainfra-ReadOnly:

aws cloudformation describe-stacks --stack-name plainfra-ReadOnly --region REGION --query 'Stacks[0].Parameters'

If it was installed across your organisation with StackSets, that command fails with ValidationError: Stack with id plainfra-ReadOnly does not exist even though the role is present and healthy, because the stack is named StackSet-plainfra-readonly-<uuid>. Ask the StackSet for this account's stack instead, from the management or delegated administrator account:

aws cloudformation describe-stack-instance --stack-set-name plainfra-readonly --stack-instance-account ACCOUNT_ID --stack-instance-region REGION --region REGION

That returns the instance's StackId along with the parameter values in effect for this account. If you want the full stack view, run describe-stacks --stack-name against the returned StackId.

A failure here is a naming mismatch, not a security finding. Confirm the role itself with get-role and list-role-policies above before concluding anything is wrong.

After access has been in place for a while, audit what we actually called. Every plainfra session assumes the role with a session name prefixed plainfra-, and the specific names describe the purpose: plainfra-session for chat and reports, plainfra-collector for scheduled scans, plainfra-verify and plainfra-verify-account for connection checks, plainfra-upgrade-probe for a lite-to-full upgrade check, plainfra-v3-gateway for the investigation service. Those names appear in CloudTrail against every call:

aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceName,AttributeValue=plainfra-ReadOnly --max-results 50 --region REGION

This is the check that matters most, because it is the only one that tells you what happened rather than what was permitted.

6. What you are actually trusting

Two things, and it is worth naming both.

The trust policy points at named roles inside plainfra's AWS account, not at the account as a whole. A standard install names two: arn:aws:iam::121754142582:role/plainfra-lambda-execution, the service role behind plainfra's chat and reports, and arn:aws:iam::121754142582:role/plainfra-mcp-execution, the role behind the MCP gateway. When the investigation service is enabled for your account, the role also names the investigation service's own role, plainfra-investigation-gateway. All are owned by Triont. Only those roles can assume your role, so a different principal in plainfra's account, even one permitted to call sts:AssumeRole generally, is not trusted here. An earlier version of this role trusted the whole account (:root); naming the roles that actually assume it narrows the trust boundary to those services. You can confirm the exact principals at any time with the get-role command in section 5.

The External ID is the second factor, and it is one value per customer. The trust policy requires a matching sts:ExternalId, so knowing the role ARN alone is not enough to assume it. plainfra issues one External ID per customer and reuses it across every AWS account you connect, which is what allows a single StackSet parameter set to deploy everywhere. The consequence is that one value protects all your connected accounts. It is shown to you in the plainfra console when you add an account. Treat it as a credential.

Both of these are bounded by section 3: even a successful assumption cannot read your data contents or your secrets, cannot execute anything, and cannot change anything. It can read your logs, as section 4 says.

Questions on any of this: support@plainfra.com, or ask Tim directly.