Securing PostgreSQL From External Attack



Similar documents
Secure PostgreSQL Deployments

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

PowerChute TM Network Shutdown Security Features & Deployment

Thick Client Application Security

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

A PostgreSQL Security Primer

CrashPlan Security SECURITY CONTEXT TECHNOLOGY

Passing PCI Compliance How to Address the Application Security Mandates

Last update: February 23, 2004

Contents. Identity Assurance (Scott Rea Dartmouth College) IdM Workshop, Brisbane Australia, August 19, 2008

White Paper BMC Remedy Action Request System Security

Sample Report. Security Test Plan. Prepared by Security Innovation

MySQL Security: Best Practices

WHITE PAPER AUGUST Preventing Security Breaches by Eliminating the Need to Transmit and Store Passwords

Web Application Guidelines

Security Goals Services

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

Public Key Infrastructure (PKI)

SSL A discussion of the Secure Socket Layer

Hack Proof Your Webapps

The Top Web Application Attacks: Are you vulnerable?

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

Installation Procedure SSL Certificates in IIS 7

Authentication Types. Password-based Authentication. Off-Line Password Guessing

Encrypted PostgreSQL

Where every interaction matters.

Complying with PCI Data Security

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

Python Cryptography & Security. José Manuel

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

Extended SSL Certificates

2.4: Authentication Authentication types Authentication schemes: RSA, Lamport s Hash Mutual Authentication Session Keys Trusted Intermediaries

Security vulnerabilities in the Internet and possible solutions

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

Den Gode Webservice - Security Analysis

Kerberos. Public domain image of Heracles and Cerberus. From an Attic bilingual amphora, BC. From Italy (?).

Snow Agent System Pilot Deployment version

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

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

Entrust Managed Services PKI. Getting an end-user Entrust certificate using Entrust Authority Administration Services. Document issue: 2.

WHITE PAPER Usher Mobile Identity Platform

Using Voltage Secur

1. Why is the customer having the penetration test performed against their environment?

How to generate SSL certificates for use with a KVM box & XViewer with XCA v0.9.3

Securing your Microsoft Internet Information Services (MS IIS) Web Server with a thawte Digital Certificate thawte thawte thawte thawte thawte 10.

Sync Security and Privacy Brief

Using EMC Unisphere in a Web Browsing Environment: Browser and Security Settings to Improve the Experience

VPN Lesson 2: VPN Implementation. Summary

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

Arkansas Department of Information Systems Arkansas Department of Finance and Administration

Reading an sent with Voltage Secur . Using the Voltage Secur Zero Download Messenger (ZDM)

SSL/TLS: The Ugly Truth

Connected from everywhere. Cryptelo completely protects your data. Data transmitted to the server. Data sharing (both files and directory structure)

iscsi Security (Insecure SCSI) Presenter: Himanshu Dwivedi

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

Update Instructions

DNS security: poisoning, attacks and mitigation

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

Deploying PostgreSQL in a Windows Enterprise

Network Security. 1 Pass the course => Pass Written exam week 11 Pass Labs

Computer Security: Principles and Practice

CSE/EE 461 Lecture 23

Cisco Trust Anchor Technologies

SSL Protect your users, start with yourself

Criteria for web application security check. Version

Dashlane Security Whitepaper

Chapter 9 Key Management 9.1 Distribution of Public Keys Public Announcement of Public Keys Publicly Available Directory

Designing federated identity management architectures for addressing the recent attacks against online financial transactions.

The Benefits of SSL Content Inspection ABSTRACT

Security Threat Kill Chain What log data would you need to identify an APT and perform forensic analysis?

Using Foundstone CookieDigger to Analyze Web Session Management

Client Server Registration Protocol

Web Payment Security. A discussion of methods providing secure communication on the Internet. Zhao Huang Shahid Kahn

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

UNITED STATES OF AMERICA BEFORE THE FEDERAL TRADE COMMISSION. Julie Brill Maureen K. Ohlhausen Joshua D. Wright Terrell McSweeny

Configuring User Identification via Active Directory

Configure SecureZIP for Windows for Entrust Entelligence Security Provider 7.x for Windows

Achieving PCI Compliance with Postgres. Denish Patel Database Architect

Entrust Managed Services PKI. Configuring secure LDAP with Domain Controller digital certificates

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

Message authentication and. digital signatures

Application Design and Development

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Protecting Your Name on the Internet The Business Benefits of Extended Validation SSL Certificates

Chapter 16: Authentication in Distributed System

Internet Programming. Security

Designing a Secure Client-Server System Master of Science Thesis in the Programme Software Engineering & Technology

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

Security vulnerabilities in new web applications. Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

USB Portable Storage Device: Security Problem Definition Summary

Security Policy Revision Date: 23 April 2009

Secure Sockets Layer (SSL) / Transport Layer Security (TLS)

DRAFT Standard Statement Encryption

Single Sign-On Secure Authentication Password Mechanism

Protected Trust Directory Sync Guide

StreamServe Persuasion SP4 Encryption and Authentication

Ensuring the security of your mobile business intelligence

Transcription:

Securing From External Attack BRUCE MOMJIAN January, 2012 systems are rich with attack vectors to exploit. This presentation explores the many potential external vulnerabilities and shows how they can be secured. Includes concepts from Magnus Hagander Creative Commons Attribution License http://momjian.us/presentations 1 / 29

Attack Vectors Securing, From External Attack 2 / 29

External Attack Vectors Trust security Passwords / authentication theft Network snooping Network pass-through spoofing / backup theft Administrator access Securing, From External Attack 3 / 29

Internal Attack Vectors (Not Covered) object permissions SQL injection attacks Application vulnerability Operating system compromise Securing, From External Attack 4 / 29

Authentication Security http://www.my-time-machines.net/mosler_34.htm Securing, From External Attack 5 / 29

Avoid Trust Security # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust Solution: Use the initdb -A flag, i.e., you don t want to see this: WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the -A option the next time you run initdb. Securing, From External Attack 6 / 29

Password Snooping Connection Request Need Password Password Sent Vulnerable to snooping md5(password+username) md5(password+username) md5(password+username) md5(password+username) Using username in the MD5 string prevents the same password used by different users from appearing the same. It also adds some randomness to the md5 checksums. Securing, From External Attack 7 / 29

MD5 Authentication Prevents Password Snooping connection request need password, sent random salt md5(md5(password+username) + salt) md5(password+username) md5(password+username) md5(password+username) md5(password+username) Securing, From External Attack 8 / 29

MD5 Authentication Prevents Password Replay connection request need password, sent random salt0 md5(md5(password+username) + salt0) OK Malicious connection request need password, sent random salt1 md5(md5(password+username) + salt0) replay md5(password+username) md5(password+username) md5(password+username) md5(password+username) X salt is a random four-byte integer so millions of connection attempts might allow the reuse of an old authentication reply. Securing, From External Attack 9 / 29

Password Attacks Weak passwords Reuse of old passwords Brute-Force password attacks None of these vulnerabilities is prevented by Postgres directly, but external authentication methods, like LDAP, PAM, and SSPI, can prevent them. Securing, From External Attack 10 / 29

Queries and Data Still Vulnerable to Network Snooping SELECT * FROM customers; Barr Bearings $10230 James Akel Queries and data vulnerable to snooping Password changes are also vulnerable to snooping. Securing, From External Attack 11 / 29

SSL Prevents Snooping By Encrypting Queries and Data AES256(SELECT * FROM customers); AES256(Barr Bearings $10230 James Akel) Queries and data encrypted by SSL Securing, From External Attack 12 / 29

Preventing Spoofing http://redwing.hutman.net/~mreed/warriorshtm/impostor.htm Securing, From External Attack 13 / 29

Localhost Spoofing While the Is Down Connection Request Fake Need Plain Password Password Sent X Records passwords for later use with the real server Uses a fake socket or binds to port 5432 while the real server is down. (/tmp is world-writable and 5432 is not a root-only port.) The server controls the choice of password instead of md5. Securing, From External Attack 14 / 29

Network Spoofing Connection Request Fake Need Plain Password Password Sent X Records passwords for later use with the real server Without SSL root certificates there is no way to know if the server you are connecting to is a legitimate server. Securing, From External Attack 15 / 29

Network Spoofing Pass-Through Connection Request Fake Need Plain Password Password Sent OK Query Result Records passwords for later use with the real server. It can also capture queries, data, and inject its own queries. Query Result Without SSL root certificates there is no way to know if the server you are connecting to is a legitimate server. Securing, From External Attack 16 / 29

SSL Prefer Is Not Secure SSL or Non SSL Prefer SSL Fake No SSL Non SSL OK Query Result Records passwords for later use with the real server. It can also capture queries, data, and inject its own queries. Query Result Without SSL root certificates there is no way to know if the server you are connecting to is a legitimate server. Securing, From External Attack 17 / 29

SSL Require Is Not Secure From Spoofing SSL or Non SSL Require SSL Fake OK SSL SSL OK Query Result Records passwords for later use with the real server. It can also capture queries, data, and inject its own queries. Query Result Without SSL root certificates there is no way to know if the server you are connecting to is a legitimate server. Securing, From External Attack 18 / 29

SSL Verify-CA Is Secure From Spoofing SSL verify-ca Fake root.crt X Invalid certificate (no CA signature) server.crt Securing, From External Attack 19 / 29

SSL Verify-full Is Secure Even From Some Certificate Thefts SSL verify full Fake root.crt X Invalid certificate (hostname mismatch) 0000000 1111111 server.crt 0000000 1111111 Certificate stolen from a CA trusted computer, but not the database server. server.crt Securing, From External Attack 20 / 29

Data Encryption To Avoid Data Theft http://jproc.ca/crypto/enigma.html Securing, From External Attack 21 / 29

Disk Volume Encryption http://www.pclaunches.com/ Securing, From External Attack 22 / 29

Column Encryption id name credit_card_number --------+--------------------+------------------------------ 428914 Piller Plaster Co. \xc30d04070302254dc045353f28 ; 456cd241013e2d421e198f3320e8 ; 41a7e4f751ebd9e2938cb6932390 ; 5c339c02b5a8580663d6249eb24f ; 192e226c1647dc02536eb6a79a65 ; 3f3ed455ffc5726ca2b67430d5 Encryption methods are decryptable (e.g. AES), while hashes are one-way (e.g. MD5). A one-way hash is best for data like passwords that only need to be checked for a match, rather than decrypted. Securing, From External Attack 23 / 29

Where to Store the Key? On the SELECT * FROM customers; Barr Bearings $10230 James Akel Decrypted data key Securing, From External Attack 24 / 29

Store the Key on an Intermediate SELECT Cryptographic SELECT Barr Bearings Decrypted V#ja20a Encrypted key Securing, From External Attack 25 / 29

Store the Key on the and Encrypt/Decrypt on the key SELECT decrypt(col, key) FROM customers; Barr Bearings $10230 James Akel Decrypted data Securing, From External Attack 26 / 29

Encrypt/Decrypt on the key SELECT * FROM customers; V#aei32ok3 Encrypted data This prevents server administrators from viewing sensitive data. Securing, From External Attack 27 / 29

Store the Key on a Hardware Token SELECT * FROM customers; key V#aei32ok3 Encrypted data This prevents problems caused by client hardware theft. Securing, From External Attack 28 / 29

Conclusion http://momjian.us/presentations Todd Ehlers, Flickr Securing, From External Attack 29 / 29