The PCI Compliant Database. Christophe Pettus PostgreSQL Experts, Inc. PGConf Silicon Valley 2015



Similar documents
Achieving PCI Compliance with Postgres. Denish Patel Database Architect

Implementation Guide

74% 96 Action Items. Compliance

Achieving PCI-Compliance through Cyberoam

Credit Cards and Oracle E-Business Suite Security and PCI Compliance Issues

Payment Card Industry (PCI) Compliance. Management Guidelines

PCI DSS FAQ. The twelve requirements of the PCI DSS are defined as follows:

PCI DSS Requirements - Security Controls and Processes

SonicWALL PCI 1.1 Implementation Guide

Strategies To Effective PCI Scoping ISACA Columbus Chapter Presentation October 2008

2: Do not use vendor-supplied defaults for system passwords and other security parameters

Complying with PCI Data Security

APPENDIX G ASP/SaaS SECURITY ASSESSMENT CHECKLIST

PCI Requirements Coverage Summary Table

CONTENTS. PCI DSS Compliance Guide

Catapult PCI Compliance

Using the AppGate Network Segmentation Server TO ACHIEVE PCI COMPLIANCE

New PCI Standards Enhance Security of Cardholder Data

Oracle Hospitality OPERA Cloud Services Security Guide Release 1.20 Part Number: E April 2016

How Reflection Software Facilitates PCI DSS Compliance

How NETGEAR ProSecure UTM Helps Small Businesses Meet PCI Requirements

Payment Card Industry Self-Assessment Questionnaire

Section 3.9 PCI DSS Information Security Policy Issued: June 2016 Replaces: January 2015

Retour d'expérience PCI DSS

Did you know your security solution can help with PCI compliance too?

Kenna Platform Security. A technical overview of the comprehensive security measures Kenna uses to protect your data

Becoming PCI Compliant

PCI COMPLIANCE ON AWS: HOW TREND MICRO CAN HELP

PCI DSS Policies Outline. PCI DSS Policies. All Rights Reserved. ecfirst Page 1 of 7

PCI PA - DSS. Point BKX Implementation Guide. Version Atos Xenta, Atos Xenteo and Atos Yomani using the Point BKX Payment Core

GFI White Paper PCI-DSS compliance and GFI Software products

Key Steps to Meeting PCI DSS 2.0 Requirements Using Sensitive Data Discovery and Masking

Passing PCI Compliance How to Address the Application Security Mandates

Payment Card Industry (PCI) Data Security Standard. Summary of Changes from PCI DSS Version 2.0 to 3.0

PCI PA - DSS. Point XSA Implementation Guide. Atos Worldline Banksys XENTA SA. Version 1.00

PCI Compliance. by: David Koston

Enforcing PCI Data Security Standard Compliance

PDQ Guide for the PCI Data Security Standard Self-Assessment Questionnaire C (Version 1.1)

Credit Card Security

Credit Cards and Oracle: How to Comply with PCI DSS. Stephen Kost Integrigy Corporation Session #600

Teleran PCI Customer Case Study

PCI DSS requirements solution mapping

Visa U.S.A Cardholder Information Security Program (CISP) Payment Application Best Practices

PCI PA - DSS. Point ipos Implementation Guide. Version VeriFone Vx820 using the Point ipos Payment Core

SAQ D Compliance. Scott St. Aubin Senior Security Consultant QSA, CISM, CISSP

PCI Data Security and Classification Standards Summary

Achieving Compliance with the PCI Data Security Standard

PCI Compliance Top 10 Questions and Answers

Credit Card Acceptance Policy. Vice Chancellor of Business Affairs. History: Effective July 1, 2011 Updated February 2013

Why Is Compliance with PCI DSS Important?

Presented By: Bryan Miller CCIE, CISSP

Credit Card Processing Overview

ensure prompt restart of critical applications and business activities in a timely manner following an emergency or disaster

PCI Requirements Coverage Summary Table

PCI Compliance - A Realistic Approach. Harshul Joshi, CISM, CISA, CISSP Director, Information Technology CBIZ MHM hjoshi@cbiz.com

Using PowerBroker Identity Services to Comply with the PCI DSS Security Standard

Security. Tiffany Trent-Abram VP, Global Product Management. November 6 th, One Connection - A World of Opportunities

Administrative Improvements. Administrative Improvements. Scoping Guidance. Clarifications for Segmentation

The 12 Essentials of PCI Compliance How it Differs from HIPPA Compliance Understand & Implement Effective PCI Data Security Standard Compliance

Josiah Wilkinson Internal Security Assessor. Nationwide

Achieving PCI Compliance Using F5 Products

SECURITY DOCUMENT. BetterTranslationTechnology

BAE Systems PCI Essentail. PCI Requirements Coverage Summary Table

CardControl. Credit Card Processing 101. Overview. Contents

Meeting PCI-DSS v1.2.1 Compliance Requirements. By Compliance Research Group

worldpay.com Understanding the 12 requirements of PCI DSS SaferPayments Be smart. Be compliant. Be protected.

TASK TDSP Web Portal Project Cyber Security Standards Best Practices

Project Title slide Project: PCI. Are You At Risk?

Visa Asia Pacific Account Information Security (AIS) Program Payment Application Best Practices (PABP)

PCI Compliance. Top 10 Questions & Answers

University of Sunderland Business Assurance PCI Security Policy

PCI Data Security Standards (DSS)

MAXIMUM DATA SECURITY with ideals TM Virtual Data Room

You Can Survive a PCI-DSS Assessment

FORT HAYS STATE UNIVERSITY CREDIT CARD SECURITY POLICY

Managed File Transfer and the PCI Data Security Standards

A Rackspace White Paper Spring 2010

With Globalscape EFT and the High-Security Module. The Case for Compliance

8/17/2010. Over 90% of all compromised merchants are PCI level 4 (small) merchants or merchants with less than 1 million transactions per year

MANAGED FILE TRANSFER: 10 STEPS TO PCI DSS COMPLIANCE

Best Practices for PCI DSS V3.0 Network Security Compliance

SECTION: SUBJECT: PCI-DSS General Guidelines and Procedures

Policies and Procedures

PCI Compliance Updates

ADMINISTRATIVE POLICY # (2014) Remote Access. Policy Number: ADMINISTRATIVE POLICY # (2014) Remote Access

FileCloud Security FAQ

Client Security Risk Assessment Questionnaire

Citrix Solutions for Complying with PCI-DSS ENSURING PROTECTION OF WEB APPLICATIONS AND PRIVACY OF CARDHOLDER INFORMATION

Worldpay s guide to the Payment Card Industry Data Security Standard (PCI DSS)

PCI DSS 3.0 Changes Bill Franklin Executive IT Auditor January 23, 2014

Using Automated, Detailed Configuration and Change Reporting to Achieve and Maintain PCI Compliance Part 4

paypoint implementation guide

Transcription:

The PCI Compliant Database. Christophe Pettus PostgreSQL Experts, Inc. PGConf Silicon Valley 2015

Greetings! Christophe Pettus Consultant with PostgreSQL Experts, Inc. thebuild.com personal blog. pgexperts.com company website. Twitter @Xof christophe.pettus@pgexperts.com

So, PCI? PCI is the Payment Card Industry Security Standards Council. Sets security standards for any system that processes payment cards. What we re really talking about is PCI-DSS, the Data Security Standard. Most recent version: 3.1, April 2015.

Why do I care? You like getting paid, don t you? Any site that touches payment card information needs to comply with PCI. All of it. No exceptions. No really, that exception you think you have? You don t.

What does it mean to comply? You know, that s a really good question. To comply means that you have passed an audit. Below a certain volume of transactions, you can self-audit. But you still must comply with every part of PCI, no matter what.

Who has to comply? Any site that ever processes a primary account number (PAN). That s that number on the front of your credit card. Even if you don t store it in a database, you still have to comply. Although it might be easier.

So, if I comply, I m safe, right? No. Passing the audit just means you get to play, not that you get to win. If you have a breach, having passed an audit provides no protection whatsoever for liability.

This talk. Today, let s talk about getting a PostgreSQL database PCI compliant. There s a lot more involved in getting fully PCI compliant. But PCI compliance is a good jumping-off point for general system security.

Read the Documentation. Be sure to get and read a copy of PCI-DSS. There s no way to go through all the ins and outs in one talk. This focuses on technical matters, as related to a database but the policies and procedures are also very important.

Caveat Lector. This is the absolute minimum you need to do for PCI compliance. By itself, it does not necessarily mean you will pass an audit. Think of this as the start of your security journey, not the end!

PCI Structure PCI-DSS 3.1 has six areas, with a total of twelve requirements. Each one of which has implications for a PostgreSQL system. Let s go through each requirement, he said! It ll be fun, he said!

Requirement 1: Firewalls. Install and maintain a firewall configuration to protect cardholder data. In general, this section requires that you only offer the absolute minimum level of service necessary.

Requirement 1: Firewalls. PostgreSQL server is running PostgreSQL, and just that. Only port 5432 is available. Port 5432 is restricted to only application servers that must talk to the database, by specific IP address.

Requirement 1: Firewalls. Use pg_hba.conf to restrict traffic to authorized IPs, with mandatory SSL connections. Use iptables (or your favorite) to additionally restrict incoming services.

Requirement 1: Firewalls. Do not allow direct logins via SSH to the database host. Require a hop through a specific bastion host. Restrict access to the bastion host by VPN; do not simply trust bare SSH (even on a nonstandard port).

Requirement 2: Security Policies. Do not use vendor-supplied defaults for system passwords and other security parameters. Well, doh, right?

Oh, look: a vendor-supplied default. Speedbird-8:~ postgres$ psql postgres psql (9.4.5) Type "help" for help. postgres=#

Requirement 2: Security Policies. There is no such thing as trust mode authentication. Forget it ever existed. Always require specific users, even superusers. Do not use the postgres Unix or database user. Require specific users. LDAP is your friend, here.

Requirement 2: Security Policies. For system administration, use specific users and sudo; never, ever allow root logins. Use a password manager. Always always always. For critical passwords, use split passwords with dual custody.

Requirement 2: Security Policies. Versions of TLS below 1.2 don t exist anymore. This includes your public-facing website! OK, you have until June 2016. Get on it.

Requirement 2: Security Policies. Always subscribe to the pgsql-announce list. Always immediately apply any securityrelated updates. Also subscribe to the appropriate security list for your platform. Keep up to date with patches, already!

Requirement 2: Security Policies. Make it someone s job. Make sure they do it. Never, ever allow a critical security patch to go unheeded. Ever ever ever.

Requirement 3: Data Security. Protect stored cardholder data. At last! What we re here for!

Requirement 3: Data Security. No problem! We ve layered luks on top of lvm on top of EBS, and we re all set! No. Full disk encryption is useless. Let me say that again.

FULL DISK ENCRYPTION IS USELESS.

FDE protects you against exactly one problem theft of the media. That s it. That is about 0.00000002% of the actual intrusions that you have to worry about. Easy rule: If psql can read it in cleartext, it s not secure.

Per-Column Encryption. Always encrypt specific columns, not entire database or disk. Better performance, higher security. Key management is a pain. Automatic restart in a high-security environment is essentially impossible. Assume a human will be in the loop.

Primary Account Number. Of course, the PAN must be encrypted. Algorithm must be a well-known secure one (AES is considered the standard). Never roll your own crypto. Keys cannot be baked into code or stored in repositories.

Masked Number. It s OK to retain the first six and last four of the PAN for display purposes. (Really, just keep the last four and card type.) You can also store a hash of the card number for indexing purposes, BUT:

Be careful with hashes! It s very easy to reverse some hashes if you have the masked number! Only store four digits, and use a very strong hash like SHA-512.

So, how about pgcrypto? pgcrypto is a /contrib module that contains cryptography functions. Why not use it to encrypt the PAN? I mean, it s just sitting there, right?

INSERT INTO super_secret_table(card) VALUES( pgp_sym_encrypt( 4111111111111111, mysuperpassword ));

Not so great. PostgreSQL s text logs could expose the PAN. That s another hop the data has to take in cleartext form. Always do the encryption in the application, not in the database.

CREATE TABLE cardinfo( id uuid primary key, masked_card char(4) not null, card_hash varchar(1024) not null, enc_pan bytea not null, enc_cvv bytea not null, expiration_date date not null );

What s wrong with this schema? Everything s OK except You cannot store the CVV. No, you cannot store it at all. Not even encrypted.

Well, OK, you can store it...... for as long as the authorization takes. OK, we ll just store it, process the authorization, and clear it out. No problem! So, about that PostgreSQL secondary...... with all of those WAL logs backed up?

No storage means no storage. Not in WAL segments. Not in backups. Not in text logs. Even in encrypted form. Ever. Just don t write it to the database.

Requirement 4: Encrypt Data in Flight. Encrypt transmission of cardholder data across open, public networks. Goodness gracious, I hope you are doing this. Generally, we re entering an TLSeverywhere world, so go with that. Remember, no SSL or TLS 1.0-1.1 anymore.

Use SSL for PostgreSQL. Require SSL connections to PostgreSQL. If you are using pgbouncer, use stunnel to get SSL. Ideally, use proper certificate management.

Requirement 5: Protect Against Malware. Protect all systems against malware and regularly update anti-virus software or programs. Specifically work machines accessing the database. This is generally how large-scale data thefts happen.

Requirement 6: Be a Grownup. Develop and maintain secure systems and applications. Document your system administration procedures. Do security code reviews and audits. Make sure your deployment procedures are solid.

Requirement 6.5.1: SQL Injection Attacks. Always use proper parameter substitution in your library! Never build SQL by text substitution unless it is absolutely necessary (for example, variable table names). All user input is hostile and wants to kill you all the time.

Requirement 7: Restrict Data by Need-to-Know. Restrict access to cardholder data by business need to know.

This means don t give every developer production system access. identify and qualify the system administrators who need global system access. scrub data that comes out of production for development testing.

Requirement 8: Passwords, yur doin it rong. Identify and authenticate access to system components.

User accounts must be associated with a particular human being, not a role. locked out after (no more than) six attempts. immediately revoked for terminated users.

All relevant system passwords must be complex (and this needs to be enforced, not just policy). changed every 90 days. encrypted in transmission. not the same as one of the last four on that account.

Two-Factor Authentication is now required! Two of these three: Password or passphrase. Physical device or smartphone app. Biometric device.

Sessions must be logged, including user activity during the session. terminated after being idle 15 minutes.

For PostgreSQL make sure each user has their own unique account. log all connections and disconnections. log all activity by directly-connecting users (as opposed to the application). do not permit logins as the postgres superuser.

Requirement 9: The Glass House. Restrict physical access to cardholder data. This means real security (access control, video, mantrap, biometrics) on your server room. Make sure your cloud provider provides this for the cloud they are providing to you!

Requirement 10: Log Everything. Track and monitor all access to network resources and cardholder data. Make sure everything is logged, and those logs are kept secure and cannot be tampered with. (rsyslog, anyone?) Make sure that the log record can be traced back to an individual person.

BUT! You cannot log primary account numbers or CVVs in cleartext. This is another good reason to encrypt in the application, not in the database.

Requirement 11: Trust, but Verify. Regularly test security systems and processes. Hire external penetration testing firms. Encourage developers to poke at security. Hire PCI audit companies that actually understand security, not just run pen test scripts.

This actually happened. We need you to disable your firewall. Um, why? Our penetration test script is failing because the firewall won t let it through. This sounds kind of like what a firewall is supposed to do, to me.

Requirement 12: Write That Down. Maintain a policy that addresses information security for all personnel. Make sure all security procedures are documented, policies set, and do proper risk assessment. You should be doing this for your database anyway.

Appendix B: The Bargaining Stage of Grief What if you simply can t comply? Appendix B allows you to write up a compensating control. In effect: We can t do exactly what the standard says, but we can do this, which is just as good.

Such as? For example, it may not be practical to manage root login using LDAP. In that case, you can block root login and use sudo instead. (This is an example in the PCI-DSS standard.)

This is not a Get-Out-of- Jail-Free Card. If you don t need an external auditor, it s between you, your conscience, and your Errors and Omissions insurance provider. External auditors have to sign off on compensating controls. Compensating controls need to be just as secure as the requirement they replace, in your particular environment.

By now, you are probably

We re doomed. Full and correct PCI compliance is a lot of work. There s a huge downside risk. If there s a breach, you could be liable for every single penny of loss suffered by the banks and consumers. Wait, you thought banks took risk? Ha.

There s Hope.

There s hope. If you don t have to touch PANs, you can avoid PCI. First steps were services like PayPal, but not suitable for many environments. We re finally getting a better solution: Tokenization.

Tokenization. Replaces the PAN with a token. The token is not considered a PAN, so PCI does not apply as long as you never store the PAN, even temporarily. Transfers the PCI headache onto the tokenization API vendor.

Big Tokenization Gotcha. Some interfaces do not return the token without an authorization attempt. So, you need to do the authorization immediately, because if you store the PAN back into the database (even for a short time) you re back to PCI-Compliance-Land.

Tokenization Gateways. Stripe. Cybersource. Mastercard runs their own. If you can integrate this into your system, it s much much better than dealing with PCI. So you can move on to worrying about

But that s a different talk.

Questions? Christophe Pettus @xof thebuild.com pgexperts.com

Thank you! Christophe Pettus @xof thebuild.com pgexperts.com