PCI DSS (Payment Card Industry Data Security Standard)

Understanding compliance requirements and security controls for payment card data protection

What is PCI DSS?

PCI DSS (Payment Card Industry Data Security Standard) is a set of security standards designed to ensure that all companies that accept, process, store, or transmit credit card information maintain a secure environment to protect cardholder data.

Key Principles:
  • Protect Cardholder Data: Secure storage and transmission
  • Maintain Security: Regular monitoring and testing
  • Access Control: Restrict data access on need-to-know basis
  • Network Security: Build and maintain secure networks
Applies To:
  • Merchants accepting payment cards
  • Service providers handling card data
  • Financial institutions
  • Any organization storing, processing, or transmitting cardholder data

The 12 PCI DSS Requirements

ReqRequirementDescription
Build and Maintain a Secure Network
1Install and maintain firewall configurationProtect cardholder data with properly configured firewalls
2Do not use vendor-supplied defaultsChange default passwords and security parameters
Protect Cardholder Data
3Protect stored cardholder dataEncrypt stored data and minimize data retention
4Encrypt transmission of cardholder dataUse strong cryptography for data in transit
Maintain a Vulnerability Management Program
5Use and update anti-virus softwareDeploy and maintain anti-malware solutions
6Develop and maintain secure systemsApply security patches and secure development practices
Implement Strong Access Control Measures
7Restrict access by business need-to-knowLimit access to cardholder data by job function
8Assign unique ID to each person with computer accessImplement strong authentication and user management
9Restrict physical access to cardholder dataControl physical access to systems and media
Regularly Monitor and Test Networks
10Track and monitor access to network resourcesLog all access and maintain audit trails
11Regularly test security systems and processesConduct vulnerability scans and penetration testing
Maintain an Information Security Policy
12Maintain policy that addresses information securityEstablish and maintain security policies and procedures

PCI DSS Merchant Levels

Classification by Transaction Volume:
LevelAnnual TransactionsValidation Requirements
Level 1> 6 millionAnnual on-site assessment by QSA
Level 21-6 millionAnnual Self-Assessment Questionnaire
Level 320,000-1 million (e-commerce)Annual Self-Assessment Questionnaire
Level 4< 20,000 (e-commerce)
< 1 million (others)
Annual Self-Assessment Questionnaire
QSA: Qualified Security Assessor - certified professional who conducts PCI DSS assessments

Compliance Validation

Assessment Methods:
  • Self-Assessment Questionnaire (SAQ):
    • SAQ A: Card-not-present merchants
    • SAQ B: Imprint machines or standalone terminals
    • SAQ C: Payment applications connected to internet
    • SAQ D: All other merchants and service providers
  • Report on Compliance (ROC):
    • Detailed assessment by QSA
    • Required for Level 1 merchants
    • Comprehensive security evaluation
Additional Requirements:
  • Quarterly vulnerability scans
  • Attestation of Compliance (AOC)
  • Network segmentation validation

Cardholder Data Protection

Primary Account Number (PAN) Protection:

StateProtection RequiredMethods
StoredStrong encryptionAES-256, RSA-2048+
TransmittedStrong cryptographyTLS 1.2+, IPSec
DisplayedMaskingShow last 4 digits only

Prohibited Storage:

Never Store:
  • Full magnetic stripe data
  • Card verification codes (CVV/CVC)
  • Personal identification numbers (PINs)
  • PIN verification values
Data Retention:
  • Store only what's necessary for business
  • Implement data retention policies
  • Secure deletion when no longer needed
  • Document business justification

Network Security Controls

Firewall Requirements
  • Install firewalls at network perimeter
  • Configure firewall rules with deny-all default
  • Restrict connections between untrusted networks and cardholder data environment
  • Document and justify all allowed services
  • Review configurations semi-annually
Wireless Security
  • Change wireless vendor defaults
  • Use strong encryption (WPA2/WPA3)
  • Implement strong authentication
  • Regularly scan for rogue wireless access points
  • Document all authorized wireless access points
Network Segmentation
  • Isolate cardholder data environment
  • Implement network segmentation
  • Use VLANs and access control lists
  • Regular penetration testing
  • Validate segmentation effectiveness

Monitoring and Testing Requirements

Logging and Monitoring (Requirement 10):

Event TypeLogging Required
User accessAll individual access to cardholder data
Administrator actionsAll actions by users with root/admin privileges
System accessAll access to audit trails and logs
AuthenticationAll authentication attempts (success/failure)
AuthorizationAll authorization failures

Testing Requirements (Requirement 11):

  • Vulnerability Scanning:
    • Quarterly internal and external scans
    • Scans after significant network changes
    • Use approved scanning vendor (ASV)
  • Penetration Testing:
    • Annual network and application testing
    • Testing after significant changes
    • Both external and internal testing
  • File Integrity Monitoring:
    • Monitor critical files and directories
    • Alert on unauthorized changes
    • Compare current state to known good state

Common Challenges

Technical Challenges:
  • Legacy Systems: Older systems difficult to secure
  • Network Complexity: Complex network architectures
  • Third-Party Integration: Vendor compliance verification
  • Key Management: Proper encryption key lifecycle
Business Challenges:
  • Cost: Implementation and maintenance expenses
  • Resources: Skilled security personnel shortage
  • Documentation: Maintaining compliance documentation
  • Scope Creep: Expanding cardholder data environment

Best Practices

Strategy:
  • Minimize Scope: Reduce cardholder data environment
  • Tokenization: Replace PANs with non-sensitive tokens
  • Point-to-Point Encryption: End-to-end data protection
  • Cloud Solutions: Use PCI-compliant payment processors
Implementation:
  • Risk Assessment: Regular security risk assessments
  • Staff Training: Regular security awareness training
  • Incident Response: Documented response procedures
  • Continuous Monitoring: Ongoing compliance validation

Security Implementation Examples

PAN Masking (Requirement 3)

JavaScript Example:
function maskPAN(pan) {
  // Show only last 4 digits
  if (pan && pan.length > 4) {
    const visibleDigits = pan.slice(-4);
    const maskedPortion = '*'.repeat(pan.length - 4);
    return maskedPortion + visibleDigits;
  }
  return '****';
}

// Usage
const cardNumber = "4111111111111111";
console.log(maskPAN(cardNumber)); // ************1111
Database Query Example:
-- Mask PAN in database queries
SELECT 
  customer_id,
  CONCAT(REPEAT('*', LENGTH(pan) - 4), RIGHT(pan, 4)) AS masked_pan,
  expiry_date
FROM payment_cards
WHERE customer_id = ?;

-- Result: ************1111

Strong Authentication Implementation (Requirement 8)

// Multi-factor authentication implementation
class PCI_Authentication {
  constructor() {
    this.maxFailedAttempts = 6;
    this.lockoutDuration = 30; // minutes
    this.passwordComplexity = {
      minLength: 12,
      requireUppercase: true,
      requireLowercase: true,
      requireNumbers: true,
      requireSpecialChars: true
    };
  }

  validatePasswordComplexity(password) {
    const { minLength, requireUppercase, requireLowercase, 
            requireNumbers, requireSpecialChars } = this.passwordComplexity;
    
    if (password.length < minLength) return false;
    if (requireUppercase && !/[A-Z]/.test(password)) return false;
    if (requireLowercase && !/[a-z]/.test(password)) return false;
    if (requireNumbers && !/d/.test(password)) return false;
    if (requireSpecialChars && !/[!@#$%^&*(),.?":{}|<>]/.test(password)) return false;
    
    return true;
  }

  enforceAccountLockout(userId, failedAttempts) {
    if (failedAttempts >= this.maxFailedAttempts) {
      // Lock account for specified duration
      const lockUntil = new Date(Date.now() + (this.lockoutDuration * 60 * 1000));
      this.lockAccount(userId, lockUntil);
      return { locked: true, lockUntil };
    }
    return { locked: false };
  }
}

Key Takeaways

Remember:
  • ✅ PCI DSS has 12 core requirements organized in 6 categories
  • ✅ Compliance level depends on transaction volume
  • ✅ Never store prohibited data (CVV, magnetic stripe, PINs)
  • ✅ Encrypt all cardholder data at rest and in transit
  • ✅ Regular testing and monitoring are mandatory
Best Practices:
  • 🔧 Minimize cardholder data environment scope
  • 📋 Implement comprehensive logging and monitoring
  • 🛡️ Use tokenization and P2PE when possible
  • 📊 Conduct regular risk assessments
  • 🔄 Maintain continuous compliance, not point-in-time