Your own cloud account: assess with a read-only identity
Unit 4 of 5 in Active Directory, cloud and cluster assessment.
You will be able to read a provider's testing policy, create a separate read-only assessor identity, inventory and sweep an account you own, see your own test in the audit log and fix findings as code.
Lesson
Permission now has two layers: the account owner and the provider
AWS's penetration testing policy says customers are welcome to carry out security assessments of their own AWS infrastructure without prior approval for a list of permitted services, and that customers are not permitted to assess AWS infrastructure or the AWS services themselves; a problem found in an AWS service goes to AWS Security. The policy also prohibits activities such as denial of service and simulated denial of service, port, protocol and request flooding, and DNS zone walking through Route 53, and says that security testing that includes command and control requires prior approval.
It also says any tool that has a denial-of-service capability must be able to disable it. The lesson for your plan is that the provider's policy sits on top of your own scope. Read the current policy on the day you test, because it changes, and write the account, regions and services in your scope file. This is education, not legal advice.
Assess through a separate, read-only role
The AWS managed policy SecurityAudit is described as granting access to read security configuration metadata, useful for software that audits the configuration of an account. A role is a good home for it because a role has no long-term key: the trust policy, a required resource-based policy attached to the role, names the principals that you trust to assume it. The lab writes a trust policy that requires multi-factor authentication, attaches SecurityAudit and sets a session name.
Separating the assessor identity from the administrator identity limits what a mistake or a leaked credential can do, and it makes your test easy to find afterwards, because the session name shows in the audit log. It also makes the identity itself a subject of the assessment: who can assume it, and what it can and cannot do.
Map the account before you grade it
CloudFox's README says the tool helps you gain situational awareness in unfamiliar cloud environments, and then says something worth remembering: it does not create alerts or findings and does not check compliance against a baseline or benchmark. It gives you the information needed to validate whether an attack path is possible. Benchmark tools answer which checks fail. A map answers what exists, who can reach it, and who is trusted.
So you read its tables as a map and write the findings yourself, with a fix beside each: wildcard permissions, risky role trusts, workloads running with administrator roles. The sweep lab adds a script that checks every region for kinds of resource shared with the world, and proves the script against a resource you opened on purpose in your own account, then closed.
What the account owner sees
AWS describes CloudTrail event history as a viewable, searchable, downloadable and immutable record of the past 90 days of management events in a region, available by default and queryable with the lookup-events command. It lists limits: event history shows management events only, not data events, and covers only 90 days, so an ongoing record needs a trail or an event data store.
Reading your own assessment there teaches the defender's side: the role-assumption call, the burst of read calls under your session name, and the denied calls that map what the role tried and could not do. A pattern like that is something a defender could write a detection for, and the lab asks you to write the idea down.
Fix as code, then prove it
Fixing a finding in the console leaves no record and invites drift. The capstone lab fixes it in Terraform: read the plan before applying, scan before and after, and keep both sets of evidence. Terraform's plan command has a detailed exit code option that returns 0 for a successful run with no changes, 1 for an error and 2 for a successful run with changes present, which turns a re-run into a drift check: if someone changes the resource by hand, the next plan exits 2.
Key points
- The provider's testing policy sits on top of your own scope; read it on the day, and assess only your own account.
- Assess through a separate role with a read-only policy, MFA in the trust policy and a session name you can find later.
- A map tool gives you what exists and who is trusted; the findings and fixes are yours to write.
- Event history shows management events for 90 days; your own test is visible there, which is what a defender sees.
Sources
- AWS: Penetration testing policy
- AWS Managed Policy Reference: SecurityAudit
- AWS IAM User Guide: Roles terms and concepts
- CloudFox README (Bishop Fox, GitHub)
- AWS CloudTrail User Guide: Working with CloudTrail event history
- Terraform CLI documentation: terraform plan
Lecture
Cloud shared responsibility: Which part of the security job is the provider's and which is yours, the line every cloud assessment is drawn on.
Practice in the labs
Do the whole cloud series on your own account: role, inventory, sweep, the log view and a fix as code. Free-tier accounts work; every lab says what to tear down.
- Create a read-only assessor role in your OWN AWS account and assume it with MFA: You create a role you assume with MFA for the rest of the series, with a session name that shows up in the audit log, and prove what it cannot do.
- Inventory your OWN AWS account with CloudFox and read who can reach what: You run CloudFox with the assessor role and turn its tables into written findings with fixes, treating it as a map and not a benchmark.
- Sweep your OWN AWS account, in every region, for resources shared with the world: You write a read-only script that checks every region for six kinds of world-shared resource and prove it against one you opened on purpose, then close it.
- Review every IAM role trust policy in an AWS account: who can assume what, and which trusts are too wide: You build a reviewer for role trust policies with seven rules, scored against an answer key on a synthetic account, and write the fix for each finding.
- Find your OWN assessment in CloudTrail: what the account owner sees: You read your own assessment out of the audit log by session name and write the detection idea a defender would build.
- Fix cloud findings in Terraform and prove it with a re-scan (your OWN account): You fix two scan findings as code, read the plan before applying, keep before and after evidence and see drift. It is an advanced lab; tear it down when done.
Also try, in the simulators
- Catch a cloud role listing storage from the outside (Detection Lab task): A real cloud breach involved a role used from outside the cloud network. You write the rule that would catch the listing, the defender's side of what you just assessed.
Knowledge check
- According to AWS's policy, what are customers not permitted to assess? Answer: AWS infrastructure or the AWS services themselves. The policy welcomes assessments of customers' own infrastructure for listed services, and says problems found in AWS services should be reported to AWS Security.
- Why assess through a role instead of a long-term access key? Answer: A role has no long-term key to leak, its trust policy can require MFA, and its session can be named and found in the log. The trust policy defines who may assume the role; a named session makes your test visible to the account owner afterwards.
- What does the CloudFox README say it does not do? Answer: Create alerts or findings, or check compliance against a baseline or benchmark. It is a map for manual testing: you write the findings yourself.
- You need a record of account activity older than 90 days, including data events. What do you need? Answer: A trail or an event data store, because event history covers only 90 days of management events. AWS lists both limits and says an ongoing record needs a trail or an event data store.
Back to the syllabus or see all classes.
Related
- Active Directory, cloud and cluster assessment
- Create a read-only assessor role in your OWN AWS account and assume it with MFA
- Inventory your OWN AWS account with CloudFox and read who can reach what
- Sweep your OWN AWS account, in every region, for resources shared with the world
- Review every IAM role trust policy in an AWS account: who can assume what, and which trusts are too wide
- Find your OWN assessment in CloudTrail: what the account owner sees
- Fix cloud findings in Terraform and prove it with a re-scan (your OWN account)
- All classes
- Free cyber labs