Skip to main content

Overview

CrediBill implements production-grade security measures. This guide explains the security features and best practices for integrating with CrediBill.

Authentication & API Keys

API Key Types

CrediBill uses different API keys for different purposes:

API Key Security

Never commit API keys to version control:
Rotate keys regularly:
  1. Go to Settings → API Keys
  2. Click Regenerate next to key
  3. Update your app with new key
  4. Delete old key
  5. Monitor for failed requests
Key rotation schedule:
  • After accidental exposure: Immediately
  • Regular rotation: Quarterly
  • After employee departure: Immediately
  • After suspected compromise: Immediately

Using API Keys

Never expose secret keys:

Webhook Security

Signature Verification

All webhooks must be verified. This prevents attackers from forging webhook events.

Verification Implementation

Common Signature Verification Mistakes

Replay Attack Prevention

CrediBill includes built-in replay attack prevention through:
  1. Timestamp validation: Reject webhooks older than 5 minutes
  2. Event ID deduplication: Track processed event IDs
  3. Nonce tracking: Prevent reusing old webhooks
Implementation:

Credential Management

Encrypted Storage

All payment provider credentials are encrypted using AES-256-GCM:

Best Practices for Credentials

Never log credentials:
Don’t expose in responses:
Rotate credentials periodically:
  1. Go to provider dashboard
  2. Generate new API credentials
  3. Update in CrediBill settings
  4. Rotate out old credentials
  5. Delete old credentials from provider

Transaction Security

Race Condition Prevention

CrediBill prevents race conditions where multiple webhooks update the same transaction:

Idempotency

Every payment operation should be idempotent. Include an Idempotency-Key header on server-side requests.

Data Protection

Data Retention

CrediBill retains data according to:
  • Transaction records: 7 years (regulatory requirement)
  • Webhook logs: 90 days
  • Customer data: Until account deletion
  • Payment method tokens: Until removed by customer
Delete sensitive data:

PCI Compliance

CrediBill is PCI DSS compliant:
  • ✅ Never stores raw card numbers
  • ✅ Encrypted transmission (TLS 1.2+)
  • ✅ Secure credential storage (AES-256-GCM)
  • ✅ Access logging and monitoring
  • ✅ Regular penetration testing
Your responsibility:
  • ✅ Never accept raw card data on your server
  • ✅ Use CrediBill’s tokenization for cards
  • ✅ Don’t log or store card numbers
  • ✅ Use HTTPS for all communication
  • ✅ Validate SSL certificates

Network Security

TLS/HTTPS

All CrediBill endpoints require HTTPS. Verify TLS by making requests over https:// and ensuring your server enforces HTTPS for webhook endpoints.
Webhook endpoints must be HTTPS:

TLS Certificate Validation

Monitoring & Alerting

Security Events to Monitor

Audit Logging

Access Control

Role-Based Access

Implement role-based access control:

API Key Scoping

Incident Response

If Credentials Are Compromised

  1. Immediately revoke the exposed key/credential
  2. Generate new key/credential
  3. Update all applications with new credentials
  4. Review logs for unauthorized usage
  5. Monitor for suspicious activity
  6. Contact provider to revoke provider credentials if exposed
  7. Document the incident

If Payment Data Is Exposed

  1. Assess scope: Which data was exposed?
  2. Notify users: If PII/payment method exposed
  3. Contact CrediBill: Report the incident
  4. Enable monitoring: Watch for fraudulent activity
  5. Review logs: Understand how exposure occurred
  6. Implement fixes: Prevent recurrence

If Webhooks Are Being Spoofed

  1. Verify signature: Ensure proper verification
  2. Check logs: Look for pattern of invalid signatures
  3. Check IP source: See where invalid webhooks come from
  4. Block IP: Add to firewall if needed
  5. Rotate webhook secret: Generate new secret
  6. Update endpoint: If verification code has bug

Compliance

Supported Standards

CrediBill complies with:
  • PCI DSS 3.2.1: Payment Card Industry Data Security Standard
  • GDPR: General Data Protection Regulation (EU)
  • CCPA: California Consumer Privacy Act
  • HIPAA: Health Insurance Portability (if applicable)
  • SOC 2 Type II: Service Organization Control

Your Compliance Responsibilities

Privacy:
  • ✅ Collect customer data with consent
  • ✅ Provide privacy policy
  • ✅ Allow data deletion (GDPR right to be forgotten)
  • ✅ Handle data breaches
  • ✅ Keep PII secure
PCI:
  • ✅ Never store raw card numbers
  • ✅ Use tokenization for cards
  • ✅ Maintain HTTPS
  • ✅ Validate SSL certificates
  • ✅ Log and monitor access
Financial:
  • ✅ Maintain transaction records (7 years)
  • ✅ Keep audit logs
  • ✅ Reconcile with provider regularly
  • ✅ Report suspiciously large transactions
  • ✅ Comply with local regulations

Security Checklist

Before going to production:

Setup

  • All credentials in environment variables (not hardcoded)
  • API keys rotated (first time setup)
  • Webhook secret saved securely
  • HTTPS enabled on webhook endpoint
  • SSL certificate valid (not self-signed)

Code

  • Webhook signature verification implemented
  • Timing-safe comparison used
  • Timestamp validation implemented
  • Replay attack prevention in place
  • Idempotency keys used for payments
  • Error messages don’t expose credentials
  • Logging doesn’t log sensitive data

Monitoring

  • Invalid webhook attempts logged
  • Failed API auth attempts monitored
  • Security alerts configured
  • Audit logs enabled
  • Payment anomalies monitored

Operational

  • Key rotation plan documented
  • Incident response plan documented
  • Team training completed
  • Backup credentials stored securely
  • Regular security reviews scheduled

Resources