The goal is a check that proves the route works, fails loudly when it does not, and never prints the secret. That requires treating the credential as a runtime input, not as configuration that lives in the repository.
Inject secrets at runtime, never from the repository
Store the proxy endpoint and credential in the CI platform's secret store and expose them as environment variables to the job that needs them. The repository should contain the variable names and nothing else. Rotating a credential should not require a commit.
Use one credential per environment and, where the plan allows, per service. A staging job that accidentally points at production should fail on authentication or a bandwidth cap, not quietly spend real capacity. Name the secret after the system that uses it so ownership survives team changes.
Turn off shell tracing before reading a secret. A debug flag that prints the command line will print the credential, and CI logs are usually retained longer than anyone expects. If a tool must print its configuration, print the host and port and mask the rest.
- Credential lives in the platform secret store, not in a file in the repository.
- Separate secrets for development, CI, and production.
- No shell tracing while the secret is in scope.
- Rotate on a schedule and immediately after any exposure.
Prove access without printing the secret
A useful pre-flight check sends one request through the proxy to an echo endpoint, asserts that the response contains an exit address, and optionally checks the reported country. It does not print the proxy URL, and it does not echo the environment.
Keep the output short and machine-readable so a failure is obvious in the CI log. The example below reads the proxy URL from the environment and reports only a pass or fail; the credential never reaches standard output.
set -euo pipefail
response=$(curl -sS --max-time 20 \
-x "$GRAVIIX_PROXY_URL" \
-H "X-Graviix-Country: ${TARGET_COUNTRY}" \
https://httpbin.org/ip)
echo "$response" | jq -e ".origin" > /dev/null
echo "proxy pre-flight: ok"Fail closed, not open
If the pre-flight check fails, the job should stop. Falling back to a direct connection hides the misconfiguration, contaminates the dataset with requests from the runner's own address, and can consume the target's tolerance for your traffic without any proxy in place.
Make a direct connection an explicit opt-in for local development only. Production and CI should have no code path that silently bypasses the proxy when the route is unavailable. If a fallback is genuinely required, route it to a different proxy pool with its own budget, and record that the fallback happened.
A failed check is a good outcome: it costs seconds and prevents a run that would have to be repeated or explained later.
Keep artifacts clean
Proxy credentials can leak through paths that are easy to forget: verbose HTTP client debug output, HAR files exported from a browser, screenshots that show a settings panel, and crash reports that dump the environment. Treat every artifact produced by a CI run as potentially public to the team.
Sanitize HAR files and debug dumps before uploading, and keep retention short for anything that contains request headers. Never attach a full environment dump to a failing build. The proxy authentication guide covers how credentials are transmitted, which helps identify where they can appear.
Review the CI configuration when a job starts failing in a new way. A workflow file is code; a change that prints a command for debugging can undo months of careful handling in one line.
Test the check itself
A check that has never failed is not proven. Run it once with an intentionally wrong credential in a throwaway environment and confirm that the job stops with a clear message. Run it with the correct credential and confirm that the exit location matches the expected value.
Keep the check fast. One request against a neutral endpoint is enough for availability and authentication. Location assertions that require the real target belong in the job's own pre-flight, not in every CI run.
A CI checklist
The list is short, and each item prevents a class of incident that is expensive to clean up after the fact.
- Secrets injected at runtime and scoped per environment.
- Shell tracing disabled while credentials are in scope.
- One request through the proxy, with a pass or fail result only.
- Job stops when the check fails; no silent direct fallback.
- Artifacts and debug logs sanitized before upload.
- Credential rotation and revocation documented and rehearsed.
Ephemeral runners and IP allowlisting
Allowlisting a source address is convenient for a fixed office or a dedicated worker, and awkward for CI runners that receive a new address on every run. If the platform offers a stable egress address through a NAT gateway, an allowlist can work, but it has to be maintained like any other configuration and tested when the platform changes its ranges.
For ephemeral runners, credentials are usually the simpler control. Combine them with a bandwidth cap and a per-service credential so a leaked value has a bounded impact. Rotating a credential is possible within minutes; updating a partner allowlist can take days.
Document which method each environment uses. A pipeline that assumes allowlisting while the runner is actually ephemeral fails intermittently, and the failure often looks like a proxy outage rather than an access-control mismatch.
If both methods are available, prefer one per environment. Mixing them makes it possible to leave an old allowlist entry in place while the credential is also active, which widens the access surface for no operational benefit.
- Stable egress: allowlist is viable, but track platform range changes.
- Ephemeral runners: per-service credentials with caps and rotation.
- One method per environment, documented in the workflow file.
- Review allowlists and credential lists together each quarter.
If a credential is exposed
Revoke first, then investigate. A leaked proxy credential can consume bandwidth and distort usage records, and the longer it stays active, the harder the audit becomes. Rotate the value, update the secret store, restart the consumers, and confirm with the pre-flight check.
Deleting the commit or the log file does not remove the exposure. Treat the credential as compromised once it has appeared in a place that other people or systems can read, including repository history and CI artifacts.
Review usage for the period the credential was active and note anything unusual. Keep the note short and factual: when it was exposed, when it was revoked, what was rotated, and what was checked. The record is what makes the next rotation faster and prevents the same path from being reused.
Check the other places the value might have been copied: local environment files, screenshots in tickets, and shared browser profiles. Rotation that leaves a copy behind simply moves the problem to the next leak.
What the CI check should not do
The check should not become a miniature load test. A single request to a neutral endpoint is enough for authentication and reachability; hammering the target from every build adds cost and noise without improving confidence.
It should not print the proxy configuration, the full environment, or the raw command line. Those habits feel helpful during a debugging session and become permanent exposure once they are committed to a workflow file.
It should not create artifacts containing request headers unless they are sanitized. HAR files and screenshots are common leak paths, and a proxy URL with embedded credentials is exactly the kind of string that survives a quick glance.
Keeping the check small also makes it fast enough to run on every build, which is the point: a check that is skipped for speed cannot prevent the incident it was written for. The leak check guide covers the assertions that are worth keeping, and the authentication guide explains how the credential is sent on each protocol.
Key takeaways
- Treat proxy credentials as runtime secrets with per-environment scope.
- Verify the route with a quiet check and fail closed when it breaks.
- Sanitize every artifact that could contain headers or configuration.
Frequently asked questions
Can I store a test proxy credential in a private repository?
It is still a credential in version history, where it can outlive its purpose and be exposed by a clone, a backup, or a fork. Use the platform secret store, and rotate anything that has already been committed.
How do I debug proxy authentication in CI without printing the password?
Log the status code, the proxy host and port, and whether the credential was present, but never the value. Check encoding separately, and use a temporary credential for deeper debugging rather than exposing the production one.
Should CI fall back to a direct connection if the proxy fails?
No. A silent direct fallback hides the failure and sends requests from the runner's own address. Fail the job and investigate; make direct access an explicit local-development option only.
Need proxies for this workflow?
Graviix provides residential, mobile, datacenter, and static ISP proxies with country and city targeting, rotating or sticky sessions, and a documented HTTP API.










