Sandbox security
A sandbox is a live copy of your app that Cofactor builds for your tests, also called a test environment. This page answers the security questions teams ask about sandboxes. For setup, see [Environments](/environments).
Who can use my sandbox?
Only your organization. Each claim creates its own sandbox, and Cofactor records which organization owns it. Your members and API keys can list it, run commands in it and destroy it. Other organizations can't.
How are my secrets handled?
You set a secret from standard input, so it never appears in a command line or shell history.
printf %s "$KEY" | cofactor sandbox secret set NAME --application "Acme Web"
Cofactor encrypts the value with your organization's key and never shows it again. Your services read it as an environment variable. The output of cofactor sandbox exec is scrubbed of the sandbox's secrets.
Use test keys and test accounts in a sandbox, not production secrets. Cofactor generates each test login's password when it builds a snapshot, so no password lives in your repository. See Seed data and logins.
How long does a sandbox live?
A claimed sandbox lasts 2 hours, and each sync adds 2 hours, up to 8 hours after the claim. Run cofactor sandbox destroy <sandbox id> to remove one sooner. See Environments for every lifetime, including previews.
What happens to my code?
Cofactor reads your code in one of two ways.
- From GitHub. You install the Cofactor GitHub App on the repositories you choose. Cofactor builds your app from them. See GitHub.
- From a pushed image. You build the image yourself and Cofactor gets no repository access. See Build from a pushed image.
Either way, Cofactor builds a snapshot of your app, and each claim starts from it, which is why claims are fast.
How do I report abuse?
To report phishing, malware or other abuse on a Cofactor sandbox or preview URL, email abuse@runcofactor.com with the URL and what you saw. To report a security issue in Cofactor, email hello@runcofactor.com.