Guide
Secure Proxy Credentials: Storage, Rotation and Access
Use this secure proxy credential guide to protect proxy access, reduce leaks, control team permissions, and keep data operations running safely at scale.

Proxy credentials are spending authority. Anyone holding them can consume your bandwidth, and because proxy billing is usage-based, a leaked credential is a direct financial liability that runs until someone notices. They are also access authority — whatever your proxies can reach, the holder can reach, from IPs attributed to your account.
Most teams treat them as configuration rather than as secrets. This covers storing, scoping, rotating, and revoking them properly, and what to do when one gets out.
What a Leaked Credential Actually Costs
Worth being concrete, because the risk is routinely underestimated.
Bandwidth theft. Usage-based billing means a leaked credential bills to you until revoked. Automated scanners find exposed credentials in public repositories within minutes, and proxy credentials are a known target precisely because they monetize immediately.
Reputation damage to your IP pool. Someone else's abusive traffic runs through addresses associated with your account. Those addresses accumulate blocks on targets you care about, and your success rate degrades for reasons that look like provider quality problems.
Attribution. Traffic from the leaked credential is attributed to your organization. Whatever it was used for arrives at your door.
Access to geographic targeting you pay for. Premium markets and precision targeting you purchased become free for whoever holds the string.
The exposure runs from the moment of the leak until revocation, and the median time-to-discovery for credentials in source control is measured in weeks, not hours.
Never in Source Control
The single most common leak path. A proxy URL contains the password inline, which makes it trivially easy to paste into a config file and commit.
# Never
PROXY = "http://user12345:SecretPass@gateway.flameproxies.com:8080"Environment variables at minimum:
import os
PROXY_USER = os.environ["PROXY_USER"]
PROXY_PASS = os.environ["PROXY_PASS"]Note the bracket access rather than .get() with a default — you want a loud failure at startup if the variable is missing, not a silent fallback that produces confusing authentication errors later.
A secrets manager is better still for anything production: AWS Secrets Manager, GCP Secret Manager, Vault, Doppler. These give you access auditing, rotation hooks, and the ability to revoke access to the secret without redeploying.
Add protection at the commit boundary. Pre-commit hooks that scan for credential patterns catch the mistake before it becomes permanent:
pip install detect-secrets
detect-secrets scan --baseline .secrets.baselineEnable your platform's secret scanning as a backstop — it catches what the hook misses.
Remember that git history is forever. Deleting a committed credential in a later commit does not remove it. Anyone with repository access can read it from history. A credential that was ever committed must be rotated, not just deleted.
Keep Them Out of Logs
The second most common leak path, and more insidious because it is accidental.
Proxy URLs appear in exception traces, request debug output, HTTP client logging, and crash reports. Those destinations are frequently less protected than your source code — shipped to third-party log aggregators, retained for months, readable by anyone with dashboard access.
import re
CRED_PATTERN = re.compile(r"://([^:/@\s]+):([^@\s]+)@")
def redact(text):
return CRED_PATTERN.sub("://***:***@", str(text))
# Use everywhere a proxy URL might surface
logger.error("Request failed: %s", redact(exc))Apply it in your logging formatter rather than at each call site, so it cannot be forgotten:
class RedactingFormatter(logging.Formatter):
def format(self, record):
return redact(super().format(record))Also check: HTTP client debug modes (http.client.HTTPConnection.debuglevel), CI job output, container logs, and APM traces. Each has leaked credentials for somebody.
Scope Credentials Narrowly
A single credential shared across everything means one leak exposes everything, and you cannot revoke without taking down every workload.
Issue separate credentials per boundary:
| Boundary | Why |
|---|---|
| Per environment | Dev leaks do not expose production |
| Per project or team | Limits blast radius; enables attribution |
| Per deployment | Revoke one service without affecting others |
| Per external party | Contractors and vendors get revocable access |
The attribution benefit is as valuable as the security one. Separate credentials mean usage reporting tells you which project consumed what, which is what makes bandwidth budgets enforceable at all.
Never share credentials with contractors or vendors directly. Issue them their own, scoped to what they need, with a planned expiry. When the engagement ends, revoke that credential and nothing else changes.
Rotate on a Schedule and on Events
Scheduled rotation limits the window an undetected leak stays useful. Quarterly is a reasonable default for most teams; monthly for high-value access.
Event-driven rotation is mandatory, not optional:
- Anyone with credential access leaves the team
- A credential appears in a commit, log, screenshot, or support ticket
- A contractor engagement ends
- Unexplained bandwidth consumption appears
- A machine that held credentials is compromised or decommissioned
- A credential was shared over chat or email
That last one deserves emphasis. Credentials pasted into Slack or email are in message history, search indexes, backups, and possibly a third party's retention system indefinitely. Treat any credential sent that way as leaked and rotate it.
Make rotation non-disruptive. Rotation that requires downtime does not happen. Design for overlap: issue the new credential, deploy it, verify traffic has moved, then revoke the old one. If your provider supports multiple active credentials, this is straightforward — and if your code reads credentials from a secrets manager at startup, it is a config change rather than a release.
Offboarding
When someone leaves, credential access is routinely missed because it lives outside the usual identity systems.
A checklist worth having:
- Revoke their access to the secrets manager
- Rotate any credential they could read
- Remove their provider dashboard account
- Remove any personal device IPs from allowlists
- Check whether they held credentials in a personal password manager
- Review recent usage for anything anomalous
The second item is the one teams skip. Removing someone's access to the secrets manager does not help if they already copied the value — which, over a long tenure, they almost certainly did at some point for local debugging.
Allowlists as Defense in Depth
Where your infrastructure has stable egress addresses, combining IP allowlisting with credentials is the strongest configuration available. A credential leaked from an unlisted address is useless.
This does not work for autoscaling or serverless deployments, where egress addresses change. But for the portion of your infrastructure that is static — scheduled jobs, dedicated collection servers, CI runners behind a NAT gateway — it converts a credential leak from an incident into a non-event.
A reasonable hybrid: allowlist-plus-credentials for fixed infrastructure, credentials-only for dynamic workloads, with the dynamic credentials scoped and rotated more aggressively because they carry more risk.
Detect Misuse Early
You will not always prevent a leak. Detecting one quickly limits the damage.
Alert on bandwidth rate of change. Consumption running well above baseline is the clearest signal of unauthorized use. Rate-of-change alerting catches it hours earlier than cumulative budget thresholds — which is the difference between a small overage and a large one.
Watch for usage outside expected patterns. Traffic during hours your jobs do not run, from geographies you do not target, or against markets you do not use.
Review per-credential usage. Scoped credentials make anomalies visible. A dev credential consuming production-scale bandwidth is unambiguous.
Monitor failed authentication attempts where your provider exposes them. A spike suggests someone is probing with a partially-known credential.
Set hard bandwidth caps per credential where supported. A ceiling bounds the worst case regardless of how long detection takes.
If a Credential Leaks
- Rotate immediately. Before investigating, before writing anything up. Every minute of delay is billable.
- Revoke the old credential explicitly — do not assume issuing a new one disables the old.
- Review usage since the earliest possible exposure. Quantify what was consumed and from where.
- Contact your provider if you see significant unauthorized usage. Many will work with you on charges from a documented compromise, and they can identify traffic patterns you cannot see.
- Close the leak path. Purge from git history if committed, adjust log redaction if logged, fix the process if it was human.
- Check for lateral exposure. A compromised machine or repository holding proxy credentials very likely held others.
Checklist
- No credentials in source control, ever
- Secrets manager for production; environment variables at minimum
- Pre-commit secret scanning plus platform scanning as backstop
- Any ever-committed credential rotated, not just deleted
- Redaction applied in the logging formatter, not per call site
- Separate credentials per environment, project, and external party
- Scheduled rotation, plus event-driven rotation defined
- Rotation process verified to work without downtime
- Offboarding includes credential rotation, not just access removal
- Allowlisting combined with credentials on static infrastructure
- Bandwidth rate-of-change alerting configured
- Per-credential usage reviewed periodically
- Incident procedure written before you need it
FlameProxies supports both username/password credentials and IP allowlisting, usable together, with programmatic usage reporting that makes per-credential attribution and anomaly detection practical. Non-expiring bandwidth balances also mean an unused credential is not quietly burning a monthly allocation you forgot to reclaim.