Skip to content

Broker a token for another service

Add the secret, and allow its host: a secret opens nothing by itself.

Terminal window
openmoat allow --site api.stripe.com
openmoat secret add stripe --host api.stripe.com --env STRIPE_API_KEY

The value goes in the Authorization header unless you pass --header <name>. Start the agent from a shell that has STRIPE_API_KEY set, as for GitHub.

Make sure the agent cannot read the source

Section titled “Make sure the agent cannot read the source”

A brokered value the agent can read anyway protects nothing, so openmoat secret add checks where the value comes from. When no rule denies it yet, it adds one, secret-<id>, in the same diff you approve:

Source Already denied? What openmoat secret add does
--env NAME ending in _KEY, _TOKEN, _SECRET, _PASSWORD, or starting with AWS_, and the other names in .env and variables yes, env-secrets nothing more
--env NAME with another name (STRIPE_LIVE) no adds secret-<id> with an env.read deny of it
--file PATH under ~/.ssh, ~/.aws, ~/.config/gh and the other secret folders yes, secrets-paths nothing more
--file PATH anywhere else (~/.config/example/token) no adds secret-<id> with an fs.read deny of it

The diff shows the rule, and the line The deny rule secret-<id> keeps the agent from reading the value at its source.

Which agents get the value put in, over HTTPS and plain HTTP: Where it works today.