Skip to content

fix(loadgenerator): remove hardcoded credit card credentials#7

Open
mikecstone wants to merge 1 commit into
masterfrom
fix/locust-hardcoded-cc
Open

fix(loadgenerator): remove hardcoded credit card credentials#7
mikecstone wants to merge 1 commit into
masterfrom
fix/locust-hardcoded-cc

Conversation

@mikecstone

Copy link
Copy Markdown
Owner

Summary

  • Removes hardcoded credit card number (4432-8015-6152-0454), CVV (672), and expiry from locustfile.py
  • Replaces them with os.environ.get() calls that fall back to universally recognised test values
  • The script continues to work out of the box with no configuration required

Why

Hardcoded payment credentials in source code are flagged by secret scanning tools (GitHub Advanced Security, GitGuardian, etc.) and represent a real risk if the repo is ever made public or accessed by an unauthorised party. Even if the card is not real, a real-looking number, CVV, and future expiry date in source control is bad practice and will trip secret scanners.

4111-1111-1111-1111 is the industry-standard Visa test card number (Luhn-valid, recognised by Stripe, PayPal, Adyen, and most payment processors as a test value). 000 is a clearly fake CVV.

Environment variables (all optional)

Variable Default Description
LOAD_GEN_CC_NUMBER 4111-1111-1111-1111 Card number to use in checkout load test
LOAD_GEN_CC_EXPIRY_MONTH 1 Card expiry month
LOAD_GEN_CC_EXPIRY_YEAR 2030 Card expiry year
LOAD_GEN_CC_CVV 000 Card CVV

Test plan

  • Run load generator without any env vars set — confirm checkout requests succeed with default test values
  • Confirm no real-looking card numbers remain in the file (grep -r '4432' src/loadgenerator/ should return nothing)
  • Confirm secret scanning passes on the updated file

🤖 Generated with Claude Code

Replaces hardcoded card number, CVV, and expiry with os.environ.get()
calls that fall back to industry-standard test values (4111-1111-1111-1111
is the universally recognised Visa test card used by Stripe, PayPal, etc.).
Sensitive values can now be injected at runtime via environment variables
without ever touching source control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ox-security

ox-security Bot commented May 17, 2026

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

No issues found

Branch fix/locust-hardcoded-ccmaster

View scan in OX Security →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant