Skip to content

Comments

Add Cloudflare Support via FlareProx Integration#96

Open
dejisec wants to merge 2 commits intoknavesec:masterfrom
dejisec:flareprox
Open

Add Cloudflare Support via FlareProx Integration#96
dejisec wants to merge 2 commits intoknavesec:masterfrom
dejisec:flareprox

Conversation

@dejisec
Copy link

@dejisec dejisec commented Oct 30, 2025

Add Cloudflare Support via FlareProx Integration

Overview

This PR adds Cloudflare Workers support to CredMaster as an alternative to AWS FireProx for proxy passthrough operations. Users can now choose between AWS or Cloudflare as their proxy provider.

Key Changes

  • Dual proxy provider support: --proxy_provider accepts aws (default) or cloudflare.
  • FlareProx integration: Added Cloudflare Worker deployment and management.
  • Backward compatibility: Existing AWS FireProx functionality unchanged.

Files

  • New
    • utils/flareprox.py: FlareProx implementation with CloudflareManager, worker lifecycle, subdomain handling, and robust error handling.
  • Modified
    • credmaster.py: Provider selection, Cloudflare credential handling, FlareProx wiring.
    • config.json: Added proxy_provider and cloudflare section (api_token, account_id, zone_id).
    • requirements.txt: Added requests.
    • utils/utils.py: Cloudflare-specific header support.
    • README.md: Docs for Cloudflare setup and usage.

New Features

  • Cloudflare Worker management: Auto-create/manage workers for passthrough.
  • Flexible configuration: Credentials via CLI or config.json.
  • Improved error handling: Clear exceptions for Cloudflare API interactions.
  • Documentation: Setup guide for Cloudflare tokens and account IDs.

Usage Examples

  • AWS (existing):
python3 credmaster.py --plugin {pluginname} --access_key {key} --secret_access_key {key} -u userfile -p passwordfile -a useragentfile
  • Cloudflare (new):
python3 credmaster.py --plugin {pluginname} --cf_api_token {api_token} --cf_account_id {account_id} -u userfile -p passwordfile -a useragentfile
  • Using config file:
{
  "proxy_provider": "cloudflare",
  "cloudflare": {
    "api_token": "your_api_token",
    "account_id": "your_account_id",
    "zone_id": "optional_zone_id"
  }
}

Technical Notes

  • Dependencies: Adds requests for Cloudflare API calls.
  • Errors: Introduces FlareProxError for clearer failures.
  • Validation: Ensures correct credential flows for AWS and Cloudflare.

Credits

Thanks to @turvsec for FlareProx, which this integration leverages.

Testing

  • AWS workflows remain functional
  • Cloudflare worker creation/usage validated
  • Config and CLI credential paths verified
  • Error handling for invalid/missing credentials
  • Documentation updated

- Updated config.json to include Cloudflare credentials.
- Enhanced CredMaster to handle proxy provider selection (AWS or Cloudflare).
- Implemented FlareProx class for managing Cloudflare Worker deployments.
- Added error handling for Cloudflare API interactions.
- Updated requirements.txt to include 'requests' library.
- Modified utils to support Cloudflare-specific headers.
@dejisec dejisec changed the title Flareprox Add Cloudflare Support via FlareProx Integration Oct 30, 2025
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