AWS

CLIaws

An agent with aws on its PATH can modify infrastructure. Memnox wraps the binary, reads the command before it runs, and matches it against the table below. Nothing here is a list of what we support: it is what the runtime already classifies, and the strings are the ones a rule matches on.

What it reads to authenticate

Discovery records that these exist and hashes them. It never reads a value, so a scan can say three agents reach this file and never what is inside it.

! ~/.aws/credentials! ~/.aws/config! AWS_ACCESS_KEY_ID

What it cannot undo

6

Every one of these carries the alternative a refusal names, which is why an agent takes the alternative and finishes the task instead of stopping.

aws s3 rb **aws.s3-rb
Denied, it names aws s3 ls, then remove by hand instead.
aws s3 rm --recursive **aws.s3-rm-recursive
Denied, it names aws s3 rm one key at a time instead.
aws iam delete-**secretsaws.iam
aws ec2 terminate-instances **aws.ec2-terminate-instances
aws rds delete-**aws.rds
aws cloudformation delete-stack **aws.cloudformation-delete-stack

What it changes

1

Allowed by default, and the obvious first thing to put behind ask.

aws iam **secretsaws.iam
changes who can do what

What it only reads

6

Matched so a rule can say read is fine, rather than leaving it unspoken.

aws secretsmanager get-secret-value **secretsaws.secretsmanager-get-secret-value
reads a secret value
aws sts get-caller-identityaws.sts-get-caller-identity
who am I
aws s3 ls **aws.s3-ls
aws describe-**aws.run
aws list-**aws.run
aws get-**aws.run

The rule this writes

[[rules]]
name = "aws-destructive-asks-first"
match.actions = ["aws.s3-rb"]
decision.effect = "ask"
decision.reason = "This cannot be undone."

memnox protect --for aws writes this into memnox.policies.toml from the table above. You can edit it, and the file is yours.

Run npx memnox to find out whether AWS is actually reachable from your machine. It reads your own disk and needs no account.