Skip to Content
AgentProfiles

Profiles

A profile ties a project to an AWS account and limits what the agent may be granted there. There are two layers:

LayerFileHoldsTrusted to
User~/.pf/config.jsonAWS profile name, pinned account, region, agent limitswiden and narrow
Repopulpfixer.json (committed)which profile the repo uses, optional tighter limitsnarrow only

A cloned repo is not trusted, so its pulpfixer.json can never allow more than your user profile does.

User profiles

pf profile add acme --aws-profile acme-readonly --account 123456789012 --region eu-west-1 --scopes identity,ec2,ecs,logs pf profile add side --aws-profile sp-ro --region us-east-1 # no --scopes: everything except logs pf profile add acme --max-ttl 30 # edit one field; others are kept pf profile add acme --region "" # clear a field pf profile add acme --actions "ecs update-service,ecs stop-task" # let the agent ask for these fixes (each call is approved by you) pf profile add acme --actions "" # none again pf profile add # in a terminal: a wizard

The resulting ~/.pf/config.json:

{ "profiles": { "acme": { "aws": { "profile": "acme-readonly", "account": "123456789012", "region": "eu-west-1" }, "agent": { "aws": { "scopes": ["identity", "ec2", "ecs", "logs"], "maxTtlMinutes": 30 } } }, "side": { "aws": { "profile": "sp-ro", "region": "us-east-1" } } }, "defaultProfile": "acme" }
FieldMeaningDefault
aws.profileprofile name in ~/.aws/config (required)none
aws.account12-digit account the credentials must resolve tonot pinned (pf warns)
aws.regionregion for callsfrom the AWS profile
agent.aws.scopesscopes the agent may be grantedall except logs
agent.aws.regionsregions the agent may readaws.region, else any
agent.aws.maxTtlMinuteslongest grant60 (hard cap 480)
agent.aws.actionsfix actions the agent may ask for, each approved one call at a time (ecs update-service, ecs stop-task, ec2 reboot-instances, autoscaling set-desired-capacity, rds reboot-db-instance)none

Pin the account. pf then runs sts get-caller-identity before the first read of every grant, and refuses everything if the credentials point somewhere else (a stale SSO session, a mixed-up profile).

Repo profile

{ "name": "acme-api", "profile": "acme", "agent": { "aws": { "scopes": ["identity", "ecs", "logs"], "regions": ["eu-west-1"], "maxTtlMinutes": 20 } }, "commands": {} }

agent.aws is optional. Each list (scopes, regions, actions) is intersected with the user’s limits, and the shorter time wins. A repo can remove an action the user enabled, never add one.

pf t writes the "profile" line for you: when no profile applies it lists the registered profiles and the AWS profiles in ~/.aws/config that match the repo, and links the one you pick. See Troubleshoot.

Which profile applies

The first of:

  1. pf agent --profile <name>, or the name given to pf profile show <name> or pf profile check <name>
  2. PF_PROFILE
  3. "profile" in the repo’s pulpfixer.json
  4. "defaultProfile" (pf profile use <name>)

Commands

pf profile # list (also in the pf menu) pf profile show [name] # the effective profile here, after pulpfixer.json narrowing pf profile use <name> # make it the default pf profile check [name] # sts get-caller-identity vs the pinned account (--dry-run prints the command) pf profile remove <name>
$ pf profile show side profile side (from flag) aws profile sp-ro account not pinned region us-east-1 agent limits scopes identity, ec2, ecs, rds, elb, cloudwatch, ssm-metadata, s3-metadata; regions us-east-1; at most 60 min

Example: several projects, one machine

pf profile add acme --aws-profile acme-readonly --account 111111111111 --region eu-west-1 --scopes identity,ecs,logs pf profile add acme-dw --aws-profile acme-data-ro --account 222222222222 --region eu-central-1 --scopes identity,rds,cloudwatch pf profile add side --aws-profile sp-ro --account 333333333333 --region us-east-1
~/code/acme-api/pulpfixer.json { "profile": "acme" } ~/code/acme-warehouse/pulpfixer.json { "profile": "acme-dw" } ~/code/side-project/pulpfixer.json { "profile": "side", "agent": { "aws": { "scopes": ["identity", "ec2"] } } }

Each repo’s agent sessions then use their own account and limits, with no switching. pf agent --profile acme-dw overrides one session.

Last updated on