Encrypted PostgreSQL



Similar documents
Secure PostgreSQL Deployments

A PostgreSQL Security Primer

SSL Protect your users, start with yourself

Using etoken for SSL Web Authentication. SSL V3.0 Overview

Securing PostgreSQL From External Attack

Savitribai Phule Pune University

[SMO-SFO-ICO-PE-046-GU-

TLS and SRTP for Skype Connect. Technical Datasheet

Information Security

Digital Certificates (Public Key Infrastructure) Reshma Afshar Indiana State University

User Guide Supplement. S/MIME Support Package for BlackBerry Smartphones BlackBerry Pearl 8100 Series

Internet Mail Client Control Library SSL Supplement

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

Author: Kai Engert, kaie at redhat dot com or kaie at kuix dot de For updates to this document, please check

Deploying PostgreSQL in a Windows Enterprise

ERserver. iseries. Secure Sockets Layer (SSL)

Den Gode Webservice - Security Analysis

12/8/2015. Review. Final Exam. Network Basics. Network Basics. Network Basics. Network Basics. 12/10/2015 Thursday 5:30~6:30pm Science S-3-028

Secure Socket Layer. Introduction Overview of SSL What SSL is Useful For

Best Practice Guide (SSL Implementation) for Mobile App Development 最 佳 行 事 指 引. Jointly published by. Publication version 1.

Security Protocols/Standards

BEA Weblogic Guide to Installing Root Certificates, Generating CSR and Installing SSL Certificate

Server Certificate Practices in eduroam

Understanding digital certificates

How To Encrypt Data With Encryption

An Overview of the Secure Sockets Layer (SSL)

CS 758: Cryptography / Network Security

High Security Online Backup. A Cyphertite White Paper February, Cloud-Based Backup Storage Threat Models

SSL/TLS: The Ugly Truth

Lecture 9 - Network Security TDTS (ht1)

Is Your SSL Website and Mobile App Really Secure?

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

This section includes troubleshooting topics about certificates.

Security. Learning Objectives. This module will help you...

DVS DCI Signing Certificate Tool

You re FREE Guide SSL. (Secure Sockets Layer) webvisions

Symmetric and Public-key Crypto Due April , 11:59PM

Chapter 8. Network Security

Network Security - ISA 656 Security

Securing VMware View Communication Channels with SSL Certificates TECHNICAL WHITE PAPER

(n)code Solutions CA A DIVISION OF GUJARAT NARMADA VALLEY FERTILIZERS COMPANY LIMITED P ROCEDURE F OR D OWNLOADING

Secure Web Appliance. SSL Intercept

Chapter 8 Security. IC322 Fall Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

SBClient SSL. Ehab AbuShmais

Network Security. Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT)

Certificate Management. PAN-OS Administrator s Guide. Version 7.0

ERserver. iseries. Securing applications with SSL

(n)code Solutions CA A DIVISION OF GUJARAT NARMADA VALLEY FERTILIZERS COMPANY LIMITED P ROCEDURE F OR D OWNLOADING

WIRELESS LAN SECURITY FUNDAMENTALS

9.92 Using HTTPS for building secure web applications v 1.0

SSL SSL VPN

Security in IPv6. Basic Security Requirements and Techniques. Confidentiality. Integrity

Module 8. Network Security. Version 2 CSE IIT, Kharagpur

IT Networks & Security CERT Luncheon Series: Cryptography

Set up Outlook for your new student e mail with IMAP/POP3 settings

HTTPS: Transport-Layer Security (TLS), aka Secure Sockets Layer (SSL)

SSL Certificate Based VPN

why PKI and digital signatures suck

CSC Network Security. User Authentication Basics. Authentication and Identity. What is identity? Authentication: verify a user s identity

1.2 Using the GPG Gen key Command

CS 356 Lecture 27 Internet Security Protocols. Spring 2013

Public Key Infrastructure

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Salesforce1 Mobile Security Guide

NETWORK ADMINISTRATION AND SECURITY

Djigzo S/MIME setup guide

Security Yokogawa Users Group Conference & Exhibition Copyright Yokogawa Electric Corporation Sept. 9-11, 2014 Houston, TX - 1 -

CSCE 465 Computer & Network Security

Kerberos. Login via Password. Keys in Kerberos

10.2 World Wide Web Security S-HTTP (secure hypertext transfer protocol) SEA (security extension architecture)

SSL Configuration on Weblogic Oracle FLEXCUBE Universal Banking Release [August] [2014]

Chapter 17. Transport-Level Security

The Secure Sockets Layer (SSL)

Security Digital Certificate Manager

Certificate Management

True False questions (25 points + 5 points extra credit)

Communication Systems 16 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2009

Managing the SSL Certificate for the ESRS HTTPS Listener Service Technical Notes P/N REV A01 January 14, 2011

Astaro Security Gateway V8. Remote Access via SSL Configuring ASG and Client

OpenADR 2.0 Security. Jim Zuber, CTO QualityLogic, Inc.

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

CS155. Cryptography Overview

CS255 Programming Project 2

Asymmetric cryptosystems fundamental problem: authentication of public keys

Security Digital Certificate Manager

Configuring a VPN between a Sidewinder G2 and a NetScreen

Configuration Guide for RFMS 3.0 Initial Configuration. WiNG 5 How-To Guide. Digital Certificates. July 2011 Revision 1.0

Generating a Certificate Signing Request (CSR) from LoadMaster

Cryptography and Network Security Sicurezza delle reti e dei sistemi informatici SSL/TSL

Chapter 7: Network security

Novell ichain Guide to Installing Root Certificates, Generating CSR and Installing SSL Certificate

Extended SSL Certificates

CS Computer Security Third topic: Crypto Support Sys

Chapter 7 Managing Users, Authentication, and Certificates

Decryption. Palo Alto Networks. PAN-OS Administrator s Guide Version 6.0. Copyright Palo Alto Networks

Is your data safe out there? -A white Paper on Online Security

LDAP over SSL Page 1 of 6.

TELNET CLIENT 5.0 SSL/TLS SUPPORT

Communication Systems SSL

Transcription:

Encrypted PostgreSQL PGCon 2009 Ottawa, Canada Magnus Hagander Redpill Linpro AB

Decide what your threat is Everything comes at a cost Performance or maintainability Encryption for the sake of encryption? Compliance/regulations?

Encryption at different layers Application Database Storage Application data encryption Pgcrypto encryption functions Full harddrive/filesystem encryption

Encryption at different layers Application Application data encryption SSL or VPN Database Storage Pgcrypto encryption functions Full harddrive/filesystem encryption

Application data encryption Independent of the database Implemented in the application layer No, we won't talk about the myriad of options here

Harddrive/filesystem encryption Independent of the database Filesystem och block device level Needs to keep fsync behaviour! Keeps all database functionality Where to store the key?

Pgcrypto Encryption as database functions Client independent Don't forget to encrypt the connection!

Pgcrypto - challenges Encryption is easy Relatively speaking As long as you don't invent your own! Key management is not

Pgcrypto overview Raw encryption PGP compatible encryption Hashing

pgcrypto: raw encryption SELECT encrypt(data, key, type) SELECT decrypt(data, key, type) SELECT encrypt_iv(data, key, iv, type) Type: bf-cbc, aes-cbc,... (ecb supported, but..) Operates on bytea, returns bytea gen_random_bytes() can be used to create key

pgcrypto: PGP encryption pgp_sym_encrypt(data, password[, opt]) pgp_sym_decrypt(data, password[, opt]) Operates on text in plaintext, bytea in ciphertext armor(), dearmor() Takes gpg style options like ciper-algo=aes256

pgcrypto: PGP encryption pgp_sym_encrypt(data, password[, opt]) pgp_sym_decrypt(data, password[, opt]) Public key encryption also supported, but no key generation Will detect wrong key/corrupt data

pgcrypto: Hashing SELECT digest(txt, type) Returns bytea, use encode() to get hex Md5, sha1, sha<more> SELECT encode( digest('lolcats!', 'sha256'), 'base64')

pgcrypto: Hashing SELECT crypt('secret', gen_salt('bf')) Stores salt as part of hash Autodetects algorithm md5, bf, etc SELECT hash=crypt('secret', hash)

Key management Where to store the key How to protect the key How to access the key How to do key recovery

Searching encrypted data Sorry, can't really be done by index Match encrypted data for raw encrypted without padding But this decreases security And does «is equal» matching only Index on expression But why did you encrypt in the first place?

SSL

SSL secured connections Encryption Man-in-the-middle protection Authentication

SSL secured connections Enabled on the server (ssl=yes) Optionally required through pg_hba Optionally required in libpq

SSL secured connections Need to protect data in both directions For example username/password Must know before connection is started Unknown equals unprotected

SSL encryption SSL always requires a server certificate Can be self-signed Does not need to be known by client

Certificate chains Issuer Root certificate Issuer Intermediate certificate Issuer Server certificate

Issuer Certificate chains Root certificate Self-signed certificate Issuer Intermediate certificate Issuer Server certificate

SSL secured connections Server Client

Threats handled by SSL: Eavesdropping SELECT * FROM secret_stuff Server Client

Eavesdropping Prevented by encrypting all data Key negotiation is automatic Server certificate used but not verified

Threats handled by SSL: Man in the middle Valid SSL session Valid SSL session Fake server Server Client

SSL server verification On top of encryption Validate that the server is who it claims to be CA issues certificate, can be selfsigned CA certificate known by client

Threats handled by SSL: Man in the middle Valid SSL session Fake server Server Client

SSL client authentication On top of encryption Normally on top of server verificateion, but not necessary CA issued certificate on client Match CN on certificate to user id Protect client certificate!

SSL in libpq Controlled by sslmode parameter Or environment PGSSLMODE For security, must be set on client Remember, unknown = unsecure

Summary of libpq SSL modes Client Mode Protect against Compatible with server set to... Performance Eavesdrop MITM SSL required SSL disabled overhead disable no no FAIL works no allow no no works works If necessary prefer no no works works If possible require yes no works FAIL yes verify-ca yes yes works FAIL yes verify-full yes yes works FAIL yes

Summary of libpq SSL modes Client Mode Protect against Compatible with server set to... Performance Eavesdrop MITM SSL required SSL disabled overhead disable no no FAIL works no allow no no works works If necessary prefer no no works works If possible require yes no works FAIL yes verify-ca yes yes works FAIL yes verify-full yes yes works FAIL yes

Summary of libpq SSL modes Client Mode Protect against Compatible with server set to... Performance Eavesdrop MITM SSL required SSL disabled overhead disable no no FAIL works no allow no no works works If necessary prefer no no works works If possible require yes no works FAIL yes verify-ca yes yes works FAIL yes verify-full yes yes works FAIL yes

Summary of libpq SSL modes Client Mode Protect against Compatible with server set to... Performance Eavesdrop MITM SSL required SSL disabled overhead disable no no FAIL works no allow no no works works If necessary prefer no no works works If possible require yes no works FAIL yes verify-ca yes yes works FAIL yes verify-full yes yes works FAIL yes

Summary Only encrypt what you really need Only encrypted where you really need Key management is hard Many use-cases are very narrow

Encrypted PostgreSQL Questions? magnus@hagander.net http://blog.hagander.net