SlideShare a Scribd company logo
1 of 31
Download to read offline
Best Practices in
Security with
PostgreSQL
Dave Page
Marc Linster
March 9, 2021
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
2
• Slides and recording will be available in next 48 hours
• Submit questions via the platform chat
Welcome – Housekeeping Items
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
3
Agenda
• Introduction to EDB
• Aspects of Data Security
• General recommendations
• Key Concepts:
• Authentication
• Authorization
• Auditing
• Data encryption
• Summary
• Q&A
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
4
Who is EDB?
1986
The design
of PostgreSQL
1996
Birth of
PostgreSQL
2004
EDB
is founded
2021
EDB acquires
2nd Quadrant
Materialized
Views
Parallel
Query
JIT
Compilation
Heap Only
Tuples (HOT)
Serializable
Parallel Query
2007
2ndQuadrant
launched
Logical
Replication
Transaction
Control
Hot
Standby
Generated
Columns
We’re database fanatics who care deeply about PostgreSQL
• Largest dedicated PostgreSQL company
• Enterprise PostgreSQL innovations
• Major PostgreSQL community leadership
EDB supercharges PostgreSQL
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
5
Aspects of Data Security
Data
Security
Unauthorized
access
Data
corruption
Loss of
access
Data breaches
(Un)intentional corruption
Hardware failure
Operator error
Process failure
Loss of encryption keys
Network failure
Disaster recovery
Notification and compliance
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
6
General Recommendations
• Keep your operating system and your database patched.
• Don’t put a postmaster port on the internet
• Isolate the database port from other network traffic
• Grant users the minimum access they require to do their work, nothing more
• Restrict access to configuration files (postgresql.conf and pg_hba.conf)
• Disallow host system login by the database superuser roles
• Provide each user with their own login
• Don’t rely solely on your front-end application to prevent unauthorized access
• Keep backups, and have a tested recovery plan.
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
7
DB Host
Database files
Data
base
Data
base
Data
base
Data access control:
• Tables
• Columns
• Rows
• Views
• Security barriers
DB Server
Authentication:
• Users
• Roles
• Password profiles
Data Center Physical access
Host access
DB Server network
access
File system encryption
Data file encryption
Data encryption
• Column based
encryption
DML/DDL Auditing
SQL Injection Attack
Prevention
Encryption in transit w.
host authentication
Data
redaction/masking
Key
Management
System
Defence in Depth
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
8
AAA Model
Popular model for security architectures
• Authentication: verify that the user is who they claim to be.
• Authorization: verify that the user is allowed access.
• Auditing (or Accounting): record all database activity, including the user name and the time
in the log files.
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
9
Authentication
Defined in hba.conf ⇐ make sure you understand how this works and protect that file!
• Kerberos/GSSAPI Single Sign-On (SSO) authentication
• Data sent over the database connection is unencrypted unless SSL or GSS encryption is in use.
• SSPI — Windows Single Sign-On (SSO) authentication
• LDAP and RADIUS
• LDAP (specifically, LDAP+STARTTLS) should only be used if Kerberos is out of the question.
• LDAP passwords are forwarded to the LDAP server, and it can easily be set up in an insecure way.
• RADIUS should not be used because it has weak encryption, using md5 hashing for credentials.
• Cert — TLS certificate authentication; often used in machine-to-machine communication.
• md5 and scram — stores username and password information in the database
• Scram is highly preferred over md5 as the passwords are securely hashed.
• Use with EDB Postgres password profiles
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
10
Password Profiles
EDB Postgres Advanced Server 9.5 and above
Oracle compatible password profiles can be used to:
• specify the number of allowable failed login attempts
• lock an account due to excessive failed login attempts
• mark a password for expiration
• define a grace period after a password expiration
• define rules for password complexity
• define rules that limit password reuse
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
11
Password Profiles - Setup ( 1 of 4)
-- Create profile and a user
CREATE PROFILE myprofile;
CREATE USER myuser IDENTIFIED BY mypassword;
-- Assign profile to a user
ALTER USER myuser PROFILE myprofile;
-- Check the user-profile mapping
SELECT rolname, rolprofile FROM pg_roles WHERE rolname = 'myuser';
rolname | rolprofile
---------+------------
myuser | myprofile
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
12
Password Profiles - Definition of Rules ( 2 of 4)
ALTER PROFILE myprofile LIMIT
FAILED_LOGIN_ATTEMPTS 3
PASSWORD_LOCK_TIME 2;
SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles
WHERE rolname = 'myuser';
rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate
---------+------------+---------------------+-----------------+-------------
myuser | myprofile | OPEN | 0 |
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
13
Password Profiles - 1st failed login ( 3 of 4)
c - myuser
Password for user myuser:
FATAL: password authentication failed for user "myuser"
SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles
WHERE rolname = 'myuser';
rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate
---------+------------+---------------------+-----------------+-------------
myuser | myprofile | OPEN | 1 |
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
14
Password Profiles - Account Locked ( 4 of 4)
c - myuser
Password for user myuser:
FATAL: role "myuser" is locked
Previous connection kept
SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles
WHERE rolname = 'myuser';
rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate
---------+------------+---------------------+-----------------+----------------------------------
myuser | myprofile | LOCKED(TIMED) | 0 | 13-NOV-18 12:25:50.811022 +05
Super user interaction
ALTER USER myuser ACCOUNT UNLOCK;
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
15
Authorization
We know who you are - what are you allowed to do?
● Standard method: Manage access privileges to tables, views and other objects
● Best Practice:
○ Revoke CREATE privileges from all users and grant them back to trusted roles only:
■ Principle Of Least Privilege
○ Don't allow the use of functions or triggers written in untrusted procedural languages.
○ Database objects should be owned by a secure role
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
16
Roles and Permissions
Manage permissions through roles
• Roles represent users and groups
• Roles take on the permissions of other roles they are members of
• Organise permissions around "group" roles, and make "login" roles members of them
• Avoid granting permissions directly to individual login roles to avoid management pain
• Roles have attributes, as well as being used in ACLs, e.g.
• LOGIN, SUPERUSER, CREATEDB, CREATEROLE, VALID UNTIL
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
17
ACLs
Secure access to tables, views, functions and more
• GRANT or REVOKE operations from specific roles
• Operations are dependent on the object type:
• Tables/views: SELECT, INSERT, UPDATE, DELETE…
• Functions: EXECUTE
• Database: CONNECT
• Languages: USAGE
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
18
Views
Provide access to data without granting access to the underlying tables
• SELECT permission can be revoked from sensitive tables
• Views can be created to access a subset (rows and/or columns) of the sensitive data
• SELECT permission can be granted to the view
• Don't forget the SECURITY BARRIER option!
• This tells the planner that the view is used for security reasons
• Prevents leakage through functions that may be called in the query by ensuring selectivity
clauses are applied before functions can see any of the data, at the cost of some optimisation
• Don't forget the LEAKPROOF option on functions!
• Superusers can set this to indicate a function doesn't leak data, to avoid the optimization loss
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
19
Security Definer Functions
Similar to the setuid bit in a Unix file ACL
• Secure underlying tables and other objects
• Provide a function that executes with the privileges of its definer rather than its caller
• Allows sensitive operations through a tightly defined interface
• Use with care!
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
20
Row Level Security (a.k.a. Virtual Private
Database)
Restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification
commands
CREATE TABLE accounts (manager text, company text, contact_email text);
ALTER TABLE accounts ENABLE ROW LEVEL SECURITY;
CREATE POLICY account_managers ON accounts TO managers
USING (manager = current_user);
DBMS_RLS provides key functions for Oracle’s Virtual Private Database in EDB Postgres
Advanced Server
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
21
Data Redaction
Username [enterprisedb]: privilegeduser
mycompany=> select * from employees;
id | name | ssn |   phone |   birthday
----+--------------+-------------+------------+--------------------
 1 | Sally Sample | 020-78-9345 | 5081234567 | 02-FEB-61 00:00:00
 1 | Jane Doe   | 123-33-9345 | 6171234567 | 14-FEB-63 00:00:00
 1 | Bill Foo | 123-89-9345 | 9781234567 | 14-FEB-63 00:00:00
(3 rows)
Username [enterprisedb]: redacteduser
mycompany=> select * from employees;
id | name | ssn |   phone |   birthday
----+--------------+-------------+------------+--------------------
 1 | Sally Sample | xxx-xx-9345 | 5081234567 | 02-FEB-02 00:00:00
 1 | Jane Doe | xxx-xx-9345 | 6171234567 | 14-FEB-02 00:00:00
 1 | Bill Foo | xxx-xx-9345 | 9781234567 | 14-FEB-02 00:00:00
(3 rows)
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
22
Auditing
PostgreSQL provides basic logging
• Uses the standard server log, so output may be mixed with errors, warnings and other info
• Log connections and disconnections
• Log DML and/or DDL queries
• Beware: when log_statement is set to 'ddl' or higher, ALTER ROLE command can result in password
exposure in the logs, except in EDB Postgres Advanced Server 11
• Use edb_filter_log.redact_password_command to redact stored passwords from the log file
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
23
Auditing
EDB Postgres Advanced Server offers enhanced auditing to dedicated logs
• Track and analyze database activities
• Record connections by database Users
• Successful and failed
• Record SQL activity by database Users
• Errors, rollbacks, all DDL, all DML, all SQL statements
• Session Tag Auditing
• Associate middle-tier application data with specific activities in the database log (e.g. track
application Users or IP addresses not just database users)
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
24
Audit Configuration Params
• postgresql.conf parameter: edb_audit (Values = XML or CSV )
• edb_audit_directory & edb_audit_filename
• edb_audit_rotation_day, edb_audit_rotation_size, edb_audit_rotation_seconds
• edb_audit_connect and edb_audit_disconnect
• edb_audit_statement
• Specifies which SQL statements to capture
• edb_filter_log.redact_password_commands ⇐ Redacts passwords from audit file!
edb_audit_connect = 'all'
edb_audit_statement = create view,create materialized view,create
sequence,grant'
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
25
SQL Injection Prevention
• SQL Injection attacks are possible where applications are designed in a way that allows the
attacker to modify SQL that is executed on the database server.
• By far the most common way to create a vulnerability of this type is by creating SQL queries
by concatenating strings that include user-supplied data.
From: https://www.explainxkcd.com/wiki/index.php/327:_Exploits_of_a_Mom
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
26
SQL Injection Prevention
Example
• Consider a website which will login a user using a query constructed as follows:
login_ok = conn.execute("SELECT count(*) FROM users WHERE name = '" + username + "' AND
password = '" + password + "';");
• If the user enters their username as dave and their password as secret' OR '1' = '1
, the generated
SQL will become:
SELECT count(*) FROM users WHERE name = 'dave' AND password = ' secret' OR '1' = '1';
• If the code is testing that login_ok has a non-zero value to authenticate the user, then the user will be
logged in regardless of whether the username/password is correct.
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
27
SQL Injection Prevention
Protecting against it in the application - sanitize the user input!
• Don't use string concatenation to include user supplied input in queries!
• Use parameterised queries instead, and let the language, driver, or database handle it.
• Here's a Python example (using the psycopg2 driver):
cursor.execute("""SELECT count(*) FROM users WHERE username = %s
AND password = %s;""", (username, password))
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
28
SQL Protect
EDB Postgres Advanced Server: Additional SQL Injection Prevention at the Database Level
• Utility Commands
• Any DDL commands: DROP TABLE
• SQL Tautologies
• SQL WHERE predicates such as "… AND 1=1"
• Empty DML
• DML commands with no WHERE filter, such as: DELETE FROM EMPLOYEE;
• Unauthorized Relations
• Results from Learn mode associating roles with tables
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
29
Encryption
Encrypt at rest and in transit -- key: Understand the threat vector!
• Password storage hashing/encryption
• Encryption for specific columns
• Data partition encryption
• Encrypting passwords across a network
• Encrypting data across a network
• SSL host authentication
• Client-side encryption
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
30
VTE - Advanced Option for PCI Compliant Storage Encryption
Compatible with EDB Postgres Advanced Server - Used for PCI compliance
https://www.brighttalk.com/webcast/2037/396902?utm_source=Thales&utm_medium=brighttalk&utm_campaign=396902
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
31
Conclusion
Security comes in layers!
AAA (Authorization, Authentication, Auditing) reference model
Encryption at rest and on the wire has to be part of the plan
Least privilege approach is key
Read, read, and read some more!
● EDB Security Technical Implementation Guidelines (STIG) for PostgreSQL on
Windows and Linux
● Blog: How to Secure PostgreSQL: Security Hardening Best Practices & Tips
● Blog: Managing Roles with Password Profiles: Part 1
● Blog: Managing Roles with Password Profiles: Part 2
● Blog: Managing Roles with Password Profiles: Part 3
Thank You

More Related Content

What's hot

Improve oracle 12c security
Improve oracle 12c securityImprove oracle 12c security
Improve oracle 12c securityLaurent Leturgez
 
AppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep DiveAppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep DiveDave Allen
 
Oracle Database Firewall - Pierre Leon
Oracle Database Firewall - Pierre LeonOracle Database Firewall - Pierre Leon
Oracle Database Firewall - Pierre LeonOracleVolutionSeries
 
AppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 BetaAppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 BetaDave Allen
 
Isaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingIsaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingAntonios Chatzipavlis
 
Windows Small Business Server 2011 Nasıl Kullanılır
Windows Small Business Server 2011 Nasıl KullanılırWindows Small Business Server 2011 Nasıl Kullanılır
Windows Small Business Server 2011 Nasıl KullanılırMustafa
 
Sql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsSql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsEduardo Castro
 
Active directory ds ws2008 r2
Active directory ds ws2008 r2Active directory ds ws2008 r2
Active directory ds ws2008 r2MICTT Palma
 
SQL Server 2012 Security Task
SQL Server 2012 Security TaskSQL Server 2012 Security Task
SQL Server 2012 Security TaskYaakub Idris
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network securityZhaoyang Wang
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOpsFrank Munz
 
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov17
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov1712.2 secure configureconsole_adop_changes_aioug_appsdba_nov17
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov17pasalapudi
 
Webinar: MongoDB 2.6 New Security Features
Webinar: MongoDB 2.6 New Security FeaturesWebinar: MongoDB 2.6 New Security Features
Webinar: MongoDB 2.6 New Security FeaturesMongoDB
 
Server 2008 r2 ppt
Server 2008 r2 pptServer 2008 r2 ppt
Server 2008 r2 pptRaj Solanki
 
Multiple ldap implementation with ebs using oid
Multiple ldap implementation with ebs using oidMultiple ldap implementation with ebs using oid
Multiple ldap implementation with ebs using oidpasalapudi
 
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise DirectoryCause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise Directoryrwgorrel
 

What's hot (20)

Improve oracle 12c security
Improve oracle 12c securityImprove oracle 12c security
Improve oracle 12c security
 
AppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep DiveAppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep Dive
 
Oracle Database Firewall - Pierre Leon
Oracle Database Firewall - Pierre LeonOracle Database Firewall - Pierre Leon
Oracle Database Firewall - Pierre Leon
 
AppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 BetaAppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 Beta
 
Isaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditingIsaca sql server 2008 r2 security & auditing
Isaca sql server 2008 r2 security & auditing
 
Mcts chapter 4
Mcts chapter 4Mcts chapter 4
Mcts chapter 4
 
Windows Small Business Server 2011 Nasıl Kullanılır
Windows Small Business Server 2011 Nasıl KullanılırWindows Small Business Server 2011 Nasıl Kullanılır
Windows Small Business Server 2011 Nasıl Kullanılır
 
Sql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsSql Server 2008 Security Enhanments
Sql Server 2008 Security Enhanments
 
Sql Server Security Best Practices
Sql Server Security Best PracticesSql Server Security Best Practices
Sql Server Security Best Practices
 
Active directory ds ws2008 r2
Active directory ds ws2008 r2Active directory ds ws2008 r2
Active directory ds ws2008 r2
 
SQL Server 2012 Security Task
SQL Server 2012 Security TaskSQL Server 2012 Security Task
SQL Server 2012 Security Task
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
 
2) security
2) security2) security
2) security
 
WINDOWS SERVER 2008
WINDOWS SERVER 2008WINDOWS SERVER 2008
WINDOWS SERVER 2008
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOps
 
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov17
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov1712.2 secure configureconsole_adop_changes_aioug_appsdba_nov17
12.2 secure configureconsole_adop_changes_aioug_appsdba_nov17
 
Webinar: MongoDB 2.6 New Security Features
Webinar: MongoDB 2.6 New Security FeaturesWebinar: MongoDB 2.6 New Security Features
Webinar: MongoDB 2.6 New Security Features
 
Server 2008 r2 ppt
Server 2008 r2 pptServer 2008 r2 ppt
Server 2008 r2 ppt
 
Multiple ldap implementation with ebs using oid
Multiple ldap implementation with ebs using oidMultiple ldap implementation with ebs using oid
Multiple ldap implementation with ebs using oid
 
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise DirectoryCause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
 

Similar to Best Practices for Securing PostgreSQL Databases

Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Role-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jRole-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jNeo4j
 
Less06 users
Less06 usersLess06 users
Less06 usersImran Ali
 
ppt-security-dbsat-222-overview-nodemo.pdf
ppt-security-dbsat-222-overview-nodemo.pdfppt-security-dbsat-222-overview-nodemo.pdf
ppt-security-dbsat-222-overview-nodemo.pdfcamyla81
 
Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Ashnikbiz
 
Creating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseCreating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseEDB
 
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)Andrejs Prokopjevs
 
Less10 security mb3
Less10 security mb3Less10 security mb3
Less10 security mb3Imran Ali
 
Privilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabasePrivilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabaseMarkus Flechtner
 
Pl17: MySQL 8.0: security
Pl17: MySQL 8.0: securityPl17: MySQL 8.0: security
Pl17: MySQL 8.0: securityGeorgi Kodinov
 
Odv oracle customer_demo
Odv oracle customer_demoOdv oracle customer_demo
Odv oracle customer_demoViaggio Italia
 
GDPR Webinar January 2018
GDPR Webinar January 2018GDPR Webinar January 2018
GDPR Webinar January 2018EDB
 
5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-ReadyEDB
 
ukoug2008-oracle-activedirectory-wi-131847.ppt
ukoug2008-oracle-activedirectory-wi-131847.pptukoug2008-oracle-activedirectory-wi-131847.ppt
ukoug2008-oracle-activedirectory-wi-131847.pptMartinCarrozzo
 
Lecture 11 managing the network
Lecture 11   managing the networkLecture 11   managing the network
Lecture 11 managing the networkWiliam Ferraciolli
 
Oracle Database Security For Developers
Oracle Database Security For DevelopersOracle Database Security For Developers
Oracle Database Security For DevelopersSzymon Skorupinski
 
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...DataStax
 
Security in oracle
Security in oracleSecurity in oracle
Security in oraclessuser40bb47
 

Similar to Best Practices for Securing PostgreSQL Databases (20)

Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Role-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jRole-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4j
 
Less06 users
Less06 usersLess06 users
Less06 users
 
ppt-security-dbsat-222-overview-nodemo.pdf
ppt-security-dbsat-222-overview-nodemo.pdfppt-security-dbsat-222-overview-nodemo.pdf
ppt-security-dbsat-222-overview-nodemo.pdf
 
Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1
 
Creating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres DatabaseCreating a Multi-Layered Secured Postgres Database
Creating a Multi-Layered Secured Postgres Database
 
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)
Security of Oracle EBS - How I can Protect my System (UKOUG APPS 18 edition)
 
Less10 security mb3
Less10 security mb3Less10 security mb3
Less10 security mb3
 
Privilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabasePrivilege Analysis with the Oracle Database
Privilege Analysis with the Oracle Database
 
Pl17: MySQL 8.0: security
Pl17: MySQL 8.0: securityPl17: MySQL 8.0: security
Pl17: MySQL 8.0: security
 
Odv oracle customer_demo
Odv oracle customer_demoOdv oracle customer_demo
Odv oracle customer_demo
 
GDPR Webinar January 2018
GDPR Webinar January 2018GDPR Webinar January 2018
GDPR Webinar January 2018
 
5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready5 Ways to Make Your Postgres GDPR-Ready
5 Ways to Make Your Postgres GDPR-Ready
 
ukoug2008-oracle-activedirectory-wi-131847.ppt
ukoug2008-oracle-activedirectory-wi-131847.pptukoug2008-oracle-activedirectory-wi-131847.ppt
ukoug2008-oracle-activedirectory-wi-131847.ppt
 
Lecture 11 managing the network
Lecture 11   managing the networkLecture 11   managing the network
Lecture 11 managing the network
 
Oracle Database Security For Developers
Oracle Database Security For DevelopersOracle Database Security For Developers
Oracle Database Security For Developers
 
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
 
Security in oracle
Security in oracleSecurity in oracle
Security in oracle
 

More from Kangaroot

So you think you know SUSE?
So you think you know SUSE?So you think you know SUSE?
So you think you know SUSE?Kangaroot
 
Live demo: Protect your Data
Live demo: Protect your DataLive demo: Protect your Data
Live demo: Protect your DataKangaroot
 
RootStack - Devfactory
RootStack - DevfactoryRootStack - Devfactory
RootStack - DevfactoryKangaroot
 
Welcome at OPEN'22
Welcome at OPEN'22Welcome at OPEN'22
Welcome at OPEN'22Kangaroot
 
EDB Postgres in Public Sector
EDB Postgres in Public SectorEDB Postgres in Public Sector
EDB Postgres in Public SectorKangaroot
 
Deploying NGINX in Cloud Native Kubernetes
Deploying NGINX in Cloud Native KubernetesDeploying NGINX in Cloud Native Kubernetes
Deploying NGINX in Cloud Native KubernetesKangaroot
 
Cloud demystified, what remains after the fog has lifted.
Cloud demystified, what remains after the fog has lifted.  Cloud demystified, what remains after the fog has lifted.
Cloud demystified, what remains after the fog has lifted. Kangaroot
 
Zimbra at Kangaroot / OPEN{virtual}
Zimbra at Kangaroot / OPEN{virtual}Zimbra at Kangaroot / OPEN{virtual}
Zimbra at Kangaroot / OPEN{virtual}Kangaroot
 
NGINX Controller: faster deployments, fewer headaches
NGINX Controller: faster deployments, fewer headachesNGINX Controller: faster deployments, fewer headaches
NGINX Controller: faster deployments, fewer headachesKangaroot
 
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...Do you want to start with OpenShift but don’t have the manpower, knowledge, e...
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...Kangaroot
 
Red Hat multi-cluster management & what's new in OpenShift
Red Hat multi-cluster management & what's new in OpenShiftRed Hat multi-cluster management & what's new in OpenShift
Red Hat multi-cluster management & what's new in OpenShiftKangaroot
 
There is no such thing as “Vanilla Kubernetes”
There is no such thing as “Vanilla Kubernetes”There is no such thing as “Vanilla Kubernetes”
There is no such thing as “Vanilla Kubernetes”Kangaroot
 
Elastic SIEM (Endpoint Security)
Elastic SIEM (Endpoint Security)Elastic SIEM (Endpoint Security)
Elastic SIEM (Endpoint Security)Kangaroot
 
Hashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public SectorHashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public SectorKangaroot
 
Kangaroot - Bechtle kadercontracten
Kangaroot - Bechtle kadercontractenKangaroot - Bechtle kadercontracten
Kangaroot - Bechtle kadercontractenKangaroot
 
Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 8Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 8Kangaroot
 
Kangaroot open shift best practices - straight from the battlefield
Kangaroot open shift best practices - straight from the battlefieldKangaroot open shift best practices - straight from the battlefield
Kangaroot open shift best practices - straight from the battlefieldKangaroot
 
Kubecontrol - managed Kubernetes by Kangaroot
Kubecontrol - managed Kubernetes by KangarootKubecontrol - managed Kubernetes by Kangaroot
Kubecontrol - managed Kubernetes by KangarootKangaroot
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformKangaroot
 
10 - MongoDB
10 - MongoDB10 - MongoDB
10 - MongoDBKangaroot
 

More from Kangaroot (20)

So you think you know SUSE?
So you think you know SUSE?So you think you know SUSE?
So you think you know SUSE?
 
Live demo: Protect your Data
Live demo: Protect your DataLive demo: Protect your Data
Live demo: Protect your Data
 
RootStack - Devfactory
RootStack - DevfactoryRootStack - Devfactory
RootStack - Devfactory
 
Welcome at OPEN'22
Welcome at OPEN'22Welcome at OPEN'22
Welcome at OPEN'22
 
EDB Postgres in Public Sector
EDB Postgres in Public SectorEDB Postgres in Public Sector
EDB Postgres in Public Sector
 
Deploying NGINX in Cloud Native Kubernetes
Deploying NGINX in Cloud Native KubernetesDeploying NGINX in Cloud Native Kubernetes
Deploying NGINX in Cloud Native Kubernetes
 
Cloud demystified, what remains after the fog has lifted.
Cloud demystified, what remains after the fog has lifted.  Cloud demystified, what remains after the fog has lifted.
Cloud demystified, what remains after the fog has lifted.
 
Zimbra at Kangaroot / OPEN{virtual}
Zimbra at Kangaroot / OPEN{virtual}Zimbra at Kangaroot / OPEN{virtual}
Zimbra at Kangaroot / OPEN{virtual}
 
NGINX Controller: faster deployments, fewer headaches
NGINX Controller: faster deployments, fewer headachesNGINX Controller: faster deployments, fewer headaches
NGINX Controller: faster deployments, fewer headaches
 
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...Do you want to start with OpenShift but don’t have the manpower, knowledge, e...
Do you want to start with OpenShift but don’t have the manpower, knowledge, e...
 
Red Hat multi-cluster management & what's new in OpenShift
Red Hat multi-cluster management & what's new in OpenShiftRed Hat multi-cluster management & what's new in OpenShift
Red Hat multi-cluster management & what's new in OpenShift
 
There is no such thing as “Vanilla Kubernetes”
There is no such thing as “Vanilla Kubernetes”There is no such thing as “Vanilla Kubernetes”
There is no such thing as “Vanilla Kubernetes”
 
Elastic SIEM (Endpoint Security)
Elastic SIEM (Endpoint Security)Elastic SIEM (Endpoint Security)
Elastic SIEM (Endpoint Security)
 
Hashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public SectorHashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public Sector
 
Kangaroot - Bechtle kadercontracten
Kangaroot - Bechtle kadercontractenKangaroot - Bechtle kadercontracten
Kangaroot - Bechtle kadercontracten
 
Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 8Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 8
 
Kangaroot open shift best practices - straight from the battlefield
Kangaroot open shift best practices - straight from the battlefieldKangaroot open shift best practices - straight from the battlefield
Kangaroot open shift best practices - straight from the battlefield
 
Kubecontrol - managed Kubernetes by Kangaroot
Kubecontrol - managed Kubernetes by KangarootKubecontrol - managed Kubernetes by Kangaroot
Kubecontrol - managed Kubernetes by Kangaroot
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platform
 
10 - MongoDB
10 - MongoDB10 - MongoDB
10 - MongoDB
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

Best Practices for Securing PostgreSQL Databases

  • 1. Best Practices in Security with PostgreSQL Dave Page Marc Linster March 9, 2021
  • 2. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 2 • Slides and recording will be available in next 48 hours • Submit questions via the platform chat Welcome – Housekeeping Items
  • 3. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 3 Agenda • Introduction to EDB • Aspects of Data Security • General recommendations • Key Concepts: • Authentication • Authorization • Auditing • Data encryption • Summary • Q&A
  • 4. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 4 Who is EDB? 1986 The design of PostgreSQL 1996 Birth of PostgreSQL 2004 EDB is founded 2021 EDB acquires 2nd Quadrant Materialized Views Parallel Query JIT Compilation Heap Only Tuples (HOT) Serializable Parallel Query 2007 2ndQuadrant launched Logical Replication Transaction Control Hot Standby Generated Columns We’re database fanatics who care deeply about PostgreSQL • Largest dedicated PostgreSQL company • Enterprise PostgreSQL innovations • Major PostgreSQL community leadership EDB supercharges PostgreSQL
  • 5. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 5 Aspects of Data Security Data Security Unauthorized access Data corruption Loss of access Data breaches (Un)intentional corruption Hardware failure Operator error Process failure Loss of encryption keys Network failure Disaster recovery Notification and compliance
  • 6. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 6 General Recommendations • Keep your operating system and your database patched. • Don’t put a postmaster port on the internet • Isolate the database port from other network traffic • Grant users the minimum access they require to do their work, nothing more • Restrict access to configuration files (postgresql.conf and pg_hba.conf) • Disallow host system login by the database superuser roles • Provide each user with their own login • Don’t rely solely on your front-end application to prevent unauthorized access • Keep backups, and have a tested recovery plan.
  • 7. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 7 DB Host Database files Data base Data base Data base Data access control: • Tables • Columns • Rows • Views • Security barriers DB Server Authentication: • Users • Roles • Password profiles Data Center Physical access Host access DB Server network access File system encryption Data file encryption Data encryption • Column based encryption DML/DDL Auditing SQL Injection Attack Prevention Encryption in transit w. host authentication Data redaction/masking Key Management System Defence in Depth
  • 8. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 8 AAA Model Popular model for security architectures • Authentication: verify that the user is who they claim to be. • Authorization: verify that the user is allowed access. • Auditing (or Accounting): record all database activity, including the user name and the time in the log files.
  • 9. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 9 Authentication Defined in hba.conf ⇐ make sure you understand how this works and protect that file! • Kerberos/GSSAPI Single Sign-On (SSO) authentication • Data sent over the database connection is unencrypted unless SSL or GSS encryption is in use. • SSPI — Windows Single Sign-On (SSO) authentication • LDAP and RADIUS • LDAP (specifically, LDAP+STARTTLS) should only be used if Kerberos is out of the question. • LDAP passwords are forwarded to the LDAP server, and it can easily be set up in an insecure way. • RADIUS should not be used because it has weak encryption, using md5 hashing for credentials. • Cert — TLS certificate authentication; often used in machine-to-machine communication. • md5 and scram — stores username and password information in the database • Scram is highly preferred over md5 as the passwords are securely hashed. • Use with EDB Postgres password profiles
  • 10. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 10 Password Profiles EDB Postgres Advanced Server 9.5 and above Oracle compatible password profiles can be used to: • specify the number of allowable failed login attempts • lock an account due to excessive failed login attempts • mark a password for expiration • define a grace period after a password expiration • define rules for password complexity • define rules that limit password reuse
  • 11. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 11 Password Profiles - Setup ( 1 of 4) -- Create profile and a user CREATE PROFILE myprofile; CREATE USER myuser IDENTIFIED BY mypassword; -- Assign profile to a user ALTER USER myuser PROFILE myprofile; -- Check the user-profile mapping SELECT rolname, rolprofile FROM pg_roles WHERE rolname = 'myuser'; rolname | rolprofile ---------+------------ myuser | myprofile
  • 12. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 12 Password Profiles - Definition of Rules ( 2 of 4) ALTER PROFILE myprofile LIMIT FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 2; SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles WHERE rolname = 'myuser'; rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate ---------+------------+---------------------+-----------------+------------- myuser | myprofile | OPEN | 0 |
  • 13. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 13 Password Profiles - 1st failed login ( 3 of 4) c - myuser Password for user myuser: FATAL: password authentication failed for user "myuser" SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles WHERE rolname = 'myuser'; rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate ---------+------------+---------------------+-----------------+------------- myuser | myprofile | OPEN | 1 |
  • 14. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 14 Password Profiles - Account Locked ( 4 of 4) c - myuser Password for user myuser: FATAL: role "myuser" is locked Previous connection kept SELECT rolname, rolprofile, edb_get_role_status(oid), rolfailedlogins, rollockdate FROM pg_roles WHERE rolname = 'myuser'; rolname | rolprofile | edb_get_role_status | rolfailedlogins | rollockdate ---------+------------+---------------------+-----------------+---------------------------------- myuser | myprofile | LOCKED(TIMED) | 0 | 13-NOV-18 12:25:50.811022 +05 Super user interaction ALTER USER myuser ACCOUNT UNLOCK;
  • 15. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 15 Authorization We know who you are - what are you allowed to do? ● Standard method: Manage access privileges to tables, views and other objects ● Best Practice: ○ Revoke CREATE privileges from all users and grant them back to trusted roles only: ■ Principle Of Least Privilege ○ Don't allow the use of functions or triggers written in untrusted procedural languages. ○ Database objects should be owned by a secure role
  • 16. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 16 Roles and Permissions Manage permissions through roles • Roles represent users and groups • Roles take on the permissions of other roles they are members of • Organise permissions around "group" roles, and make "login" roles members of them • Avoid granting permissions directly to individual login roles to avoid management pain • Roles have attributes, as well as being used in ACLs, e.g. • LOGIN, SUPERUSER, CREATEDB, CREATEROLE, VALID UNTIL
  • 17. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 17 ACLs Secure access to tables, views, functions and more • GRANT or REVOKE operations from specific roles • Operations are dependent on the object type: • Tables/views: SELECT, INSERT, UPDATE, DELETE… • Functions: EXECUTE • Database: CONNECT • Languages: USAGE
  • 18. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 18 Views Provide access to data without granting access to the underlying tables • SELECT permission can be revoked from sensitive tables • Views can be created to access a subset (rows and/or columns) of the sensitive data • SELECT permission can be granted to the view • Don't forget the SECURITY BARRIER option! • This tells the planner that the view is used for security reasons • Prevents leakage through functions that may be called in the query by ensuring selectivity clauses are applied before functions can see any of the data, at the cost of some optimisation • Don't forget the LEAKPROOF option on functions! • Superusers can set this to indicate a function doesn't leak data, to avoid the optimization loss
  • 19. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 19 Security Definer Functions Similar to the setuid bit in a Unix file ACL • Secure underlying tables and other objects • Provide a function that executes with the privileges of its definer rather than its caller • Allows sensitive operations through a tightly defined interface • Use with care!
  • 20. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 20 Row Level Security (a.k.a. Virtual Private Database) Restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands CREATE TABLE accounts (manager text, company text, contact_email text); ALTER TABLE accounts ENABLE ROW LEVEL SECURITY; CREATE POLICY account_managers ON accounts TO managers USING (manager = current_user); DBMS_RLS provides key functions for Oracle’s Virtual Private Database in EDB Postgres Advanced Server
  • 21. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 21 Data Redaction Username [enterprisedb]: privilegeduser mycompany=> select * from employees; id | name | ssn |   phone |   birthday ----+--------------+-------------+------------+--------------------  1 | Sally Sample | 020-78-9345 | 5081234567 | 02-FEB-61 00:00:00  1 | Jane Doe   | 123-33-9345 | 6171234567 | 14-FEB-63 00:00:00  1 | Bill Foo | 123-89-9345 | 9781234567 | 14-FEB-63 00:00:00 (3 rows) Username [enterprisedb]: redacteduser mycompany=> select * from employees; id | name | ssn |   phone |   birthday ----+--------------+-------------+------------+--------------------  1 | Sally Sample | xxx-xx-9345 | 5081234567 | 02-FEB-02 00:00:00  1 | Jane Doe | xxx-xx-9345 | 6171234567 | 14-FEB-02 00:00:00  1 | Bill Foo | xxx-xx-9345 | 9781234567 | 14-FEB-02 00:00:00 (3 rows)
  • 22. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 22 Auditing PostgreSQL provides basic logging • Uses the standard server log, so output may be mixed with errors, warnings and other info • Log connections and disconnections • Log DML and/or DDL queries • Beware: when log_statement is set to 'ddl' or higher, ALTER ROLE command can result in password exposure in the logs, except in EDB Postgres Advanced Server 11 • Use edb_filter_log.redact_password_command to redact stored passwords from the log file
  • 23. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 23 Auditing EDB Postgres Advanced Server offers enhanced auditing to dedicated logs • Track and analyze database activities • Record connections by database Users • Successful and failed • Record SQL activity by database Users • Errors, rollbacks, all DDL, all DML, all SQL statements • Session Tag Auditing • Associate middle-tier application data with specific activities in the database log (e.g. track application Users or IP addresses not just database users)
  • 24. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 24 Audit Configuration Params • postgresql.conf parameter: edb_audit (Values = XML or CSV ) • edb_audit_directory & edb_audit_filename • edb_audit_rotation_day, edb_audit_rotation_size, edb_audit_rotation_seconds • edb_audit_connect and edb_audit_disconnect • edb_audit_statement • Specifies which SQL statements to capture • edb_filter_log.redact_password_commands ⇐ Redacts passwords from audit file! edb_audit_connect = 'all' edb_audit_statement = create view,create materialized view,create sequence,grant'
  • 25. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 25 SQL Injection Prevention • SQL Injection attacks are possible where applications are designed in a way that allows the attacker to modify SQL that is executed on the database server. • By far the most common way to create a vulnerability of this type is by creating SQL queries by concatenating strings that include user-supplied data. From: https://www.explainxkcd.com/wiki/index.php/327:_Exploits_of_a_Mom
  • 26. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 26 SQL Injection Prevention Example • Consider a website which will login a user using a query constructed as follows: login_ok = conn.execute("SELECT count(*) FROM users WHERE name = '" + username + "' AND password = '" + password + "';"); • If the user enters their username as dave and their password as secret' OR '1' = '1 , the generated SQL will become: SELECT count(*) FROM users WHERE name = 'dave' AND password = ' secret' OR '1' = '1'; • If the code is testing that login_ok has a non-zero value to authenticate the user, then the user will be logged in regardless of whether the username/password is correct.
  • 27. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 27 SQL Injection Prevention Protecting against it in the application - sanitize the user input! • Don't use string concatenation to include user supplied input in queries! • Use parameterised queries instead, and let the language, driver, or database handle it. • Here's a Python example (using the psycopg2 driver): cursor.execute("""SELECT count(*) FROM users WHERE username = %s AND password = %s;""", (username, password))
  • 28. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 28 SQL Protect EDB Postgres Advanced Server: Additional SQL Injection Prevention at the Database Level • Utility Commands • Any DDL commands: DROP TABLE • SQL Tautologies • SQL WHERE predicates such as "… AND 1=1" • Empty DML • DML commands with no WHERE filter, such as: DELETE FROM EMPLOYEE; • Unauthorized Relations • Results from Learn mode associating roles with tables
  • 29. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 29 Encryption Encrypt at rest and in transit -- key: Understand the threat vector! • Password storage hashing/encryption • Encryption for specific columns • Data partition encryption • Encrypting passwords across a network • Encrypting data across a network • SSL host authentication • Client-side encryption
  • 30. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 30 VTE - Advanced Option for PCI Compliant Storage Encryption Compatible with EDB Postgres Advanced Server - Used for PCI compliance https://www.brighttalk.com/webcast/2037/396902?utm_source=Thales&utm_medium=brighttalk&utm_campaign=396902
  • 31. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 31 Conclusion Security comes in layers! AAA (Authorization, Authentication, Auditing) reference model Encryption at rest and on the wire has to be part of the plan Least privilege approach is key Read, read, and read some more! ● EDB Security Technical Implementation Guidelines (STIG) for PostgreSQL on Windows and Linux ● Blog: How to Secure PostgreSQL: Security Hardening Best Practices & Tips ● Blog: Managing Roles with Password Profiles: Part 1 ● Blog: Managing Roles with Password Profiles: Part 2 ● Blog: Managing Roles with Password Profiles: Part 3 Thank You