✳ Field lesson CL1 / 14 min

Who may act in a cloud account

A cloud provider answers each request by reading every policy that applies. The answer starts as deny, and any explicit deny wins. Otherwise one allow is enough inside an account, unless a guardrail or boundary leaves the action out.

cloudiamleast-privilegepolicy-evaluationCISSP D5Security+ (SY0-701) D4Security+ (SY0-801) D4

Helpful first: What you still own in the cloud · Least privilege and layered defenses

Thirty days to Halcyon · Case 12: The long list · Episode 1 of 5

Monday, 09:00. Sloane Sterling, Head of Compliance, wants the ground-telemetry cloud account shown ready at Friday's 10:00 board. The posture tool lists 1,212 findings, and 41 of them are labelled critical.

Kael Cho, Staff Infrastructure Engineer, says most of them are noise. He picks the one he can explain. The node role telemetry-ingest-node carries a policy named ingest-readonly.

Vera Vance, your mentor, opens the halcyon-downlink bucket policy. It names the same role. "Two policies," she says. "What do they allow together?"

By the end you can

  • Work out whether a cloud request is allowed by combining identity-based and resource-based policies
  • Explain why an explicit deny overrides any allow, and why the default answer is deny
  • Choose a role with short-lived credentials over a long-lived access key for a workload

A request meets every policy that applies

Meridian's ground-telemetry account runs on AWS, so the names in this lesson are AWS names. Every call to a cloud service is a request. It names a principal, which is the identity making the call. It also names an action, a resource, and conditions such as the time or the source network.

Monday's finding is one such request. The principal is the node role telemetry-ingest-node. The action is s3:DeleteObject. The resource is an object under halcyon-downlink/incoming/.

The provider does not read one policy and stop. It gathers every policy that applies to the request. Here four matter: the role's identity policy ingest-readonly, the bucket policy on halcyon-downlink, the organization guardrail on the account, and any permission boundary on the role. Other kinds, such as session policies and resource control policies, can also limit a request. None applies to this one.

Then it makes one authorization decision. The starting answer is deny. If any policy denies this request, the answer is deny, and no allow can change it. If nothing denies, the request needs at least one allow. A guardrail or a boundary can still take that allow away, because those two kinds only limit.

PUT IT IN ORDER

Vera asks you to work out the delete call the way the provider does. Put the steps in order.

  1. Look for an explicit deny in any of those policies.
  2. Give the answer: allowed only if every check passed, denied otherwise.
  3. Gather every policy that applies to it: identity, bucket, guardrail, and boundary.
  4. Look for an allow in the identity policy or the bucket policy.
  5. If there is an allow, check that no guardrail or boundary leaves the action out.
  6. Name the principal, the action, and the resource in the request.

Show the answer
  1. Name the principal, the action, and the resource in the request.
  2. Gather every policy that applies to it: identity, bucket, guardrail, and boundary.
  3. Look for an explicit deny in any of those policies.
  4. Look for an allow in the identity policy or the bucket policy.
  5. If there is an allow, check that no guardrail or boundary leaves the action out.
  6. Give the answer: allowed only if every check passed, denied otherwise.

Nothing can be judged until the request and its policies are known. A deny ends the evaluation whatever else says, so it comes first. An allow counts only if no guardrail or boundary takes it away.

Some policies grant, others only limit

The four kinds of policy do different jobs. Two can grant: the identity policy attached to the role, and the resource policy attached to the bucket. Two can only limit. A service control policy is the organization guardrail on a whole account. A permission boundary caps one role. Neither ever grants anything.

Inside one account, one allow is enough for most services. Either the identity policy or the bucket policy can grant the delete. That is why the two policies on halcyon-downlink matter together. Take the allow out of ingest-readonly alone, and the bucket policy still grants the delete. Role trust policies and KMS key policies are exceptions: each must name the principal itself.

Any deny wins, and otherwise one allow is enough unless a guardrail or boundary takes it away. The delete call meets no deny and two allows, so it goes through.

Across accounts, both sides must agree. A role in ground-telemetry that reads a bucket in another company's account needs an allow in its own identity policy. The other account's bucket policy must also allow it.

Azure and Google Cloud reach their answers with different parts, but the same two habits hold. Access starts from nothing, and a deny there beats a matching allow.

The four kinds of policy that meet a request in ground-telemetry.
KindAttached toCan it grant?In this account
Identity policyA role or userYesingest-readonly on the node role
Resource policyA resource, such as a bucketYesThe halcyon-downlink bucket policy
Service control policyAn account in the organizationNo, it only limitsAllows all storage actions
Permission boundaryOne role or userNo, it only limitsNone on the node role

Roles hand out credentials that expire

The node role holds no password. A role is an identity that a workload takes on when it runs. Each time, the provider issues temporary credentials that expire by themselves. The cluster's nodes collect fresh ones from the instance metadata service, a local address that every cloud server can query.

An identity given to software rather than to a person is called a workload identity. The node role is the workload identity of the ingest nodes.

An access key is different. It belongs to a user, and it works until someone rotates or deletes it. A key copied into a script keeps working long after anyone remembers it. Keeping such secrets out of code is the job of secrets management. AWS's own guidance is to give workloads roles and temporary credentials instead.

The word role does not mean the same thing everywhere. In AWS a role is an identity. In Azure and Google Cloud a role is a set of permissions, granted to an identity. The table lines up the words.

The same ideas under three providers' names.
IdeaAWSAzureGoogle Cloud
Identity for a workloadIAM roleManaged identityService account
A set of permissionsPolicyRole definitionRole
Where a grant is madeIdentity or resource policyRole assignment at a scopeRole binding in an allow policy
A deny that beats an allowExplicit deny in any policyDeny assignment, mostly created by Azure itselfDeny policy, checked before allow policies

SORT IT OUT

Kael lists five credentials found in the ground-telemetry account. Sort each one.

  1. Credentials an ingest node collects from the instance metadata service.

  2. An access key on the user ci-deployer, created two years ago.

  3. Credentials a function receives from its execution role when it runs.

  4. A Google Cloud service account key file saved in a build repository.

  5. Credentials an engineer gets by signing in once and assuming a role for one session.

Show the answers
  1. Short-lived, issued to a role. The node role's credentials expire, and the node fetches new ones itself.
  2. Long-lived, rotated by someone. A user's access key works until a person rotates or deletes it.
  3. Short-lived, issued to a role. The function's role hands it temporary credentials for each environment it runs in.
  4. Long-lived, rotated by someone. A downloaded service account key stays valid until someone deletes it.
  5. Short-lived, issued to a role. Assuming a role issues credentials for that session only.

Read what a policy allows, not its name

The policy on the node role is named ingest-readonly. Its only statement allows s3:* on resource *. That is every storage action, on every bucket in the account. The name is a label someone typed when the policy was made. The provider never reads it.

So read the actions and the resources. Two AWS tools help. The IAM policy simulator evaluates a request against the policies you give it, without sending a real call. IAM Access Analyzer reports resources shared outside the account and permissions a role has not used. Azure and Google Cloud have their own equivalents.

A simulator checks your reading. It is not proof. It does not cover every policy kind, so test the real call as well.

Ingest needs two things: to write new objects to halcyon-downlink/incoming/ and to read them back. Any other storage permission on the node role is a finding, whatever the policy is called. The node's own needs, such as joining the cluster and pulling images, come from separate policies.

WORKED EXAMPLE

Three calls from telemetry-ingest-node

  1. Put an object. The role writes pass-118.bin to halcyon-downlink/incoming/. No policy denies it, and ingest-readonly allows s3:*. Allowed, which is what ingest needs.
  2. Delete it. The role deletes the same object. No policy denies it. ingest-readonly allows it, and so does the bucket policy. Allowed. This is the finding.
  3. Read across accounts. The role reads from kestrel-share, a bucket in the account of Kestrel Launch Services. ingest-readonly allows it, because its resource is every bucket. The kestrel-share bucket policy does not name Meridian. Denied, because a call across accounts needs an allow on both sides.
  4. Narrow and run again. Kael limits ingest-readonly to putting and getting objects under incoming/. He also removes the role from the bucket policy's delete statement. The simulator now allows the put and denies the delete.

Result: Before the fix, two of the three calls were allowed, and one of them was a delete nobody needed. The name ingest-readonly predicted neither.

SPOT THE PROBLEM

Six statements from the policies on the node role. Ingest writes new objects to halcyon-downlink/incoming/ and reads them back. Flag the two statements that grant more than that.

Show the answers
  • Allow s3:* on halcyon-downlink/incoming/* A wildcard action. It includes delete and every other storage action on that prefix.
  • Allow s3:PutObject on * A wildcard resource. It lets the role write into every bucket in the account.

Lab / 6 records / 3 calls / 9 steps

The call that must fail

Vera runs a drill on a made-up practice account, drill-ops. Its batch job uses the role export-worker to read files under batch-input/ in the bucket drill-store. The bucket policy names no role, so only the role's own policies can allow a call. It is Monday, 13:00.

At 12:50 Kael rewrote the role's wide policy, worker-all. Vera has planted a bug in the job's file reader. Through the afternoon it tries calls the job never needs, and at 15:30 it tries one more. Each record arrives at its own time, and each move you make costs minutes.

Place each record by what it proves about the role. At each call, choose the move that gets Vera's 15:30 call refused without stopping the batch job yourself.

Read the lab as text, with every path

What the role can do at the start

  • Reads outside batch-input/: Allowed.

Systems

  • batch-job: Batch job, every two hours.
  • change-log: Change log.
  • drill-store: Drill storage bucket.

Proofs

  1. Needed call works: A call the job needs was made, and it went through.
  2. Forbidden call refused: A call the job must never make was tried, and it was denied.
  3. Forbidden call allowed: A call the job must never make was tried, and it went through.
  4. Claim only: It says what someone wrote or meant. No call was made.

Every best call: read refused

  1. Monday 13:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-41.csv from drill-store. Allowed. The 13:00 run finishes without an error. Proof: Needed call works. The job needs this read, and it went through. That proves the needed path still works after the rewrite. The old wildcard policy would have passed the same run.
  2. Monday 13:05, change-log (change log). Kael's change note: worker-all now allows s3:GetObject on drill-store/batch-input/* and nothing else. Finding marked ready to close. Proof: Claim only. The note says what Kael wrote into one policy. It makes no call, so it shows nothing about what the role can actually do.
  3. Call at Monday 13:05: Keep the finding open and list the calls the job must never make. The best call. A passing run shows the needed read works, and a wildcard passes it too. The proof is the other half: calls the job never makes, tried for real and denied. Writing them down first says what to try. It takes hold at Monday 13:30.
  4. Monday 14:00, drill-store (drill storage bucket). Request log: Vera's bug asks to delete batch-input/day-40.csv as export-worker. AccessDenied. Proof: Forbidden call refused. The job never deletes, and the delete was denied. That proves deletes fail for this role. It says nothing about any other forbidden call.
  5. Call at Monday 14:00: Have Kael read a contracts/ file as the role and act on the result. The best call. Kael's read goes through. The role also carries legacy-export, attached two years ago for a migration. It allows s3:GetObject on every object in drill-store. He detaches it, and the same read is denied. It takes hold at Monday 14:35.
  6. Monday 14:30, drill-store (drill storage bucket). Request log: Vera's bug asks to list the keys under contracts/ as export-worker. AccessDenied. It happened 5 minutes before it reached you. Proof: Forbidden call refused. Listing is a bucket action, and nothing on the role allows it on drill-store. A second refusal, and still only for the call that was tried.
  7. Monday 15:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-42.csv from drill-store. Allowed. The 15:00 run finishes without an error. Proof: Needed call works. The job's own read still works. Whatever was changed this afternoon, the job was not broken by it.
  8. Call at Monday 15:00: Save the forbidden calls as a check that runs after every change to the role. The best call. The next change to the role is the next chance to reopen a gap. A check that tries the forbidden calls each time finds it the same day. It takes hold at Monday 15:15.
  9. Monday 15:30, drill-store (drill storage bucket). Request log: Vera's bug asks for contracts/terms-07.pdf as export-worker. AccessDenied. Proof: Forbidden call refused. A read outside batch-input/ was tried and denied. The same read went through in Kael's test, before he detached legacy-export.
  10. Outcome: Read refused. At 15:30 Vera's bug asks for contracts/terms-07.pdf and is denied. The job still reads batch-input/. Every call Vera's bug tried this afternoon was denied. The finding stayed open after the 13:00 run, with a list of calls to try. The forbidden calls now run as a check after every change to export-worker.

A different second call, "Count the denied delete as proof that the role is narrow, and close the finding": contracts read

  1. Monday 13:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-41.csv from drill-store. Allowed. The 13:00 run finishes without an error. Proof: Needed call works. The job needs this read, and it went through. That proves the needed path still works after the rewrite. The old wildcard policy would have passed the same run.
  2. Monday 13:05, change-log (change log). Kael's change note: worker-all now allows s3:GetObject on drill-store/batch-input/* and nothing else. Finding marked ready to close. Proof: Claim only. The note says what Kael wrote into one policy. It makes no call, so it shows nothing about what the role can actually do.
  3. Call at Monday 13:05: Keep the finding open and list the calls the job must never make. The best call. A passing run shows the needed read works, and a wildcard passes it too. The proof is the other half: calls the job never makes, tried for real and denied. Writing them down first says what to try. It takes hold at Monday 13:30.
  4. Monday 14:00, drill-store (drill storage bucket). Request log: Vera's bug asks to delete batch-input/day-40.csv as export-worker. AccessDenied. Proof: Forbidden call refused. The job never deletes, and the delete was denied. That proves deletes fail for this role. It says nothing about any other forbidden call.
  5. Call at Monday 14:00: Count the denied delete as proof that the role is narrow, and close the finding. Not the best call. A denied delete proves deletes fail. A read is a different call, and every policy on the role answers it. Nobody has tried one. It takes hold at Monday 14:05.
  6. Monday 14:30, drill-store (drill storage bucket). Request log: Vera's bug asks to list the keys under contracts/ as export-worker. AccessDenied. Proof: Forbidden call refused. Listing is a bucket action, and nothing on the role allows it on drill-store. A second refusal, and still only for the call that was tried.
  7. Monday 15:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-42.csv from drill-store. Allowed. The 15:00 run finishes without an error. Proof: Needed call works. The job's own read still works. Whatever was changed this afternoon, the job was not broken by it.
  8. Call at Monday 15:00: Save the forbidden calls as a check that runs after every change to the role. The best call. The next change to the role is the next chance to reopen a gap. A check that tries the forbidden calls each time finds it the same day. It takes hold at Monday 15:15.
  9. Monday 15:30, drill-store (drill storage bucket). Request log: Vera's bug asks for contracts/terms-07.pdf as export-worker. Allowed. The file is read. Proof: Forbidden call allowed. A read outside batch-input/ went through. The rewritten worker-all does not allow it, so another policy on the role does.
  10. Outcome: Contracts read. At 15:30 Vera's bug reads contracts/terms-07.pdf as export-worker. The rewritten worker-all never allowed it. A second policy on the role, legacy-export, did, and no real read outside batch-input/ had been tried. The finding stayed open after the 13:00 run, with a list of calls to try. The finding was closed at 14:05 on the strength of one denied delete. The forbidden calls now run as a check after every change to export-worker.

A different first call, "Close it, and let Kael start on the next finding": contracts read

  1. Monday 13:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-41.csv from drill-store. Allowed. The 13:00 run finishes without an error. Proof: Needed call works. The job needs this read, and it went through. That proves the needed path still works after the rewrite. The old wildcard policy would have passed the same run.
  2. Monday 13:05, change-log (change log). Kael's change note: worker-all now allows s3:GetObject on drill-store/batch-input/* and nothing else. Finding marked ready to close. Proof: Claim only. The note says what Kael wrote into one policy. It makes no call, so it shows nothing about what the role can actually do.
  3. Call at Monday 13:05: Close it, and let Kael start on the next finding. Not the best call. One passing run proves the job can read. It proves nothing about what else the role can do, and nobody looks at the role again until after 15:30. It takes hold at Monday 16:00.
  4. Monday 14:00, drill-store (drill storage bucket). Request log: Vera's bug asks to delete batch-input/day-40.csv as export-worker. AccessDenied. It happened 2 hours before it reached you. Proof: Forbidden call refused. The job never deletes, and the delete was denied. That proves deletes fail for this role. It says nothing about any other forbidden call.
  5. Call at Monday 16:00: Have Kael read a contracts/ file as the role and act on the result. The best call. Kael's read goes through. The role also carries legacy-export, attached two years ago for a migration. It allows s3:GetObject on every object in drill-store. He detaches it, and the same read is denied. It takes hold at Monday 16:35.
  6. Monday 14:30, drill-store (drill storage bucket). Request log: Vera's bug asks to list the keys under contracts/ as export-worker. AccessDenied. It happened 2 hours 5 minutes before it reached you. Proof: Forbidden call refused. Listing is a bucket action, and nothing on the role allows it on drill-store. A second refusal, and still only for the call that was tried.
  7. Monday 15:00, batch-job (batch job, every two hours). Request log: export-worker gets batch-input/day-42.csv from drill-store. Allowed. The 15:00 run finishes without an error. It happened 1 hour 35 minutes before it reached you. Proof: Needed call works. The job's own read still works. Whatever was changed this afternoon, the job was not broken by it.
  8. Call at Monday 16:35: Save the forbidden calls as a check that runs after every change to the role. The best call. The next change to the role is the next chance to reopen a gap. A check that tries the forbidden calls each time finds it the same day. It takes hold at Monday 16:50.
  9. Monday 15:30, drill-store (drill storage bucket). Request log: Vera's bug asks for contracts/terms-07.pdf as export-worker. Allowed. The file is read. It happened 1 hour 20 minutes before it reached you. Proof: Forbidden call allowed. A read outside batch-input/ went through. The rewritten worker-all does not allow it, so another policy on the role does.
  10. Outcome: Contracts read. At 15:30 Vera's bug reads contracts/terms-07.pdf as export-worker. The rewritten worker-all never allowed it. A second policy on the role, legacy-export, did, and no real read outside batch-input/ had been tried. The finding was closed at 13:05 on the strength of one passing run. The forbidden calls now run as a check after every change to export-worker.

Every choice at each call

After the Monday 13:05 record: The 13:00 run passed on the rewritten worker-all, and Kael wants to close the finding. What do you ask for?

  • Keep the finding open and list the calls the job must never make (25 minutes, the best call). A passing run shows the needed read works, and a wildcard passes it too. The proof is the other half: calls the job never makes, tried for real and denied. Writing them down first says what to try. In the outcome: The finding stayed open after the 13:00 run, with a list of calls to try.
  • Close it, and let Kael start on the next finding (until Monday 16:00). One passing run proves the job can read. It proves nothing about what else the role can do, and nobody looks at the role again until after 15:30. In the outcome: The finding was closed at 13:05 on the strength of one passing run.
  • Paste the new worker-all into the policy simulator and test a read of contracts/ (10 minutes). The simulator says denied, and it is right about that one policy. A pasted policy simulated on its own leaves every other policy on the role out of the answer. In the outcome: The record cites a simulated read that checked one pasted policy.
  • Attach a policy that denies every storage call to export-worker (10 minutes). A deny wins over every allow, so nothing gets through, including the job's own read. The 15:00 run would fail.

After the Monday 14:00 record: Vera's 14:00 delete was denied, and the log names export-worker. Kael says a denied call proves the boundary holds. What do you do?

  • Have Kael read a contracts/ file as the role and act on the result (35 minutes, the best call). Kael's read goes through. The role also carries legacy-export, attached two years ago for a migration. It allows s3:GetObject on every object in drill-store. He detaches it, and the same read is denied.
  • Count the denied delete as proof that the role is narrow, and close the finding (5 minutes). A denied delete proves deletes fail. A read is a different call, and every policy on the role answers it. Nobody has tried one. In the outcome: The finding was closed at 14:05 on the strength of one denied delete.
  • Detach every policy from export-worker until the drill is over and the bug is removed (10 minutes). With no policy, the default answer is deny for every call. Vera's bug stops, and so does the job's read at 15:00.

After the Monday 15:00 record: The 15:00 run read its file. Kael asks what to keep from today's tests once the drill ends.

  • Save the forbidden calls as a check that runs after every change to the role (15 minutes, the best call). The next change to the role is the next chance to reopen a gap. A check that tries the forbidden calls each time finds it the same day. In the outcome: The forbidden calls now run as a check after every change to export-worker.
  • Keep the job's own read as the check, since that is the call the business needs (10 minutes). That check passes for a narrow role and for a wildcard one. It cannot tell them apart. In the outcome: The check after each change tries only the job's own read, which a wide role also passes.
  • Delete the test calls once the drill is over, so nobody runs them by mistake (2 minutes). Today's answers are right today. The next policy attached to the role gets no test at all. In the outcome: The test calls were deleted, so the next change to the role goes untested.

A drill runs on a script, and its times are assumptions. The account, the role, the bucket and the policies are made up. Here only the role's own policies apply: no guardrail, boundary or bucket policy allows or limits a call.

CHECK YOUR JUDGMENT

Kael adds a service control policy to ground-telemetry. It denies s3:DeleteObject on halcyon-downlink for every principal except one recovery role. The bucket policy still allows the node role to delete. The node role then tries a delete. What happens?

CASE FILE · CASE 12 · ENTRY 1 OF 5

Answer the closing question correctly to add this entry to your case file.

Two policies, one answer

The node role could delete any halcyon-downlink object, because the identity policy and the bucket policy each allowed it and nothing denied it.

Next episode: One role is too strong. Which of the other 1,211 findings join up with it?

Open the case file ↗

Review sheet: exam notes and quick reference

Find your next idea.

Tip: press / to open search. Escape closes this window.