

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Managing Secrets
incomplete
2: Injecting Secrets at Runtime
incomplete
3: Protecting Secrets
incomplete
4: Build Artifacts and Deployment Hygiene
incomplete
5: Limiting Build Context
incomplete
6: Source Code and Config Leaks
incomplete
7: Public File Leaks
incomplete
8: Server-Side Request Forgery
incomplete
9: Defending Against SSRF
incomplete
10: Open Redirects
incomplete
11: Risks of Dependencies
incomplete
12: Auditing Dependencies
incomplete
13: Dependency Maintenance
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Moving a secret out of source code is only the first step. Local files that contain injected secrets also need to stay out of version control.
As a general rule, environment files should be ignored:
.env*
!.env.example
A committed .env.example conventionally documents the expected names with dummy values:
APP_ORIGIN=http://localhost:3030
PAWPAL_API_KEY=replace_with_your_pawpal_api_key
Developers can copy that template to .env and supply their own local values. In Go, a package such as godotenv can read the file during startup. Load .env first and then overlay the process environment so an explicitly injected value takes precedence.
Bearly Secure requires runtime configuration but does not safely load local environment files. Add a protected local configuration workflow and use a stable download-signing key.
openssl rand -hex 32
go run ./cmd/server
With Bearly Secure still running, run and submit the CLI tests from a separate terminal in the project root.