Environment Management
Environment isolation
Environments allow you to manage different sets of secrets for development, staging, production, and other contexts.
Accessing Environment Settings
- Log in to ByteHide Cloud
- Select your Secrets project
- Click on the Settings tab
- Navigate to the Environments section
Creating Environments
To create a new environment:
- Click the Add button
- Enter a name for the environment (e.g., "staging")
- Optionally connect a repository to this environment
- Click Save
Every project starts with a "production" environment by default.
Environment Naming Conventions
Follow these best practices for naming environments:
- Use lowercase names without spaces
- Stick to standard names when possible:
development
(for local development)testing
(for automated tests)staging
(for pre-production testing)production
(for live applications)
- For feature environments, use a prefix:
feature-login
,feature-payment
Connecting Repositories
You can link GitHub repositories to specific environments:
- In the Environments section, find the environment you want to connect
- Click the Connect Repository button
- Select a repository from the dropdown
- Choose a branch
- Click Select Repository
This enables automatic scanning of the repository for secrets.
For more information about GitHub integration, including how to connect repositories and configure scanning, see our GitHub Integration guide.
Managing Environment-Specific Secrets
Once you have multiple environments set up:
- Go to the Keys tab
- Add a secret or select an existing one
- Enter different values for each environment
You can see which environments have values for each secret using the indicators:
- Green check: Environment has a value
- Red circle: Environment is missing a value
Environment Security
You can configure different security settings per environment:
- In the Settings tab, navigate to the Security section
- Configure IP restrictions for specific environments
- Set up different notification rules
This allows you to have stricter security for production environments.
Environment Variables
When using the Secrets Manager SDK, specify which environment to use:
// Set via environment variable
// BYTEHIDE_SECRETS_ENVIRONMENT=production
// Or when initializing
ManagerSecrets.UnsecureInitialize(
token: "your-token",
environment: "production"
);
Copying Secrets Between Environments
To copy secrets from one environment to another:
- Go to the Keys tab
- Expand the secret you want to copy
- Click on the environment without a value
- Click the "Copy from" button
- Select the source environment
- Click Save
This is useful when promoting configurations from staging to production.
Deleting Environments
To delete an environment:
- In the Settings tab, go to the Environments section
- Find the environment you want to delete
- Click the "delete" icon
- Confirm the deletion
Deletion warning
Deleting an environment will delete all secrets stored in that environment. This action cannot be undone.
Environment Dashboard
Each environment has its own dashboard showing:
- Connected repositories
- Recent detections
- Secret coverage (percentage of secrets with values)
Access this by clicking on an environment name in the Environments section.
Best Practices
Environment Consistency
Maintain the same set of secret keys across all environments:
- If a secret exists in production, it should exist in all environments
- Use placeholder values for development if needed
- Document the purpose of each secret
Environment Isolation
Keep environment values completely separate:
- Never use production credentials in development environments
- Use different accounts/credentials for each environment
- Limit access to production environment values