Expand description
What a container agent is given so its AWS SDK and CLI find the broker (spec §4): a config file with one
credential_process profile per grant, mounted read-only, and up to four environment variables. The file is the
same for every agent (who may have which grant is srv’s decision on each request, not the file’s), so there is one
folder, not one per agent: no agent name is ever a folder name.
Nothing here is a security boundary (an agent can unset the variables or write its own config): srv decides on every
request. The file is a convenience that makes aws, cdk and the SDKs ask the right place, and it holds names and
one command, never a secret.
Constants§
- CONTAINER_
AWS_ DIR - Where the config folder is mounted, read-only, in the container.
Functions§
- config_
dir - The host folder to mount, with the config freshly written, or
Nonewhen this host shares no AWS (or the folder can’t be written: the container then has no AWS, as before). - env_for
- The variables a container’s exec gets when
policyshares grants.AWS_PROFILEis the policy’s default grant, so a bareaws s3 lsuses it; without one, a profile is named per command. - exec_
env - The variables to add to a container exec’s environment: none when nothing is shared, and none when the config folder can’t be written, so they never point the SDK at a file the container doesn’t have.
- render_
into - Write the AWS config under
root(container-aws/config) if it differs from what is there, and return the folder. A new file replaces the old one in one step, so a container reading the mount never sees half of it.