[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA

PgDay.Seoul
PgDay.SeoulPgDay.Seoul
FB/lee.hyeongchae
PGDay.Seoul 2018 1
PostgreSQL Authentication
with FreeIPA
Agenda
• About me
• PostgreSQL Authentication
• IBM’s RHEL’s IdM FreeIPA
• DEMO
PGDay.Seoul 2018 2
About me
PGDay.Seoul 2018 3
•이형채 (대명봇)
• 게임허브
• Kosslab
• Tibero
• Altibase
• Telcobase
• Cubrid
• Inervit
Why ?!
PGDay.Seoul 2018 4
MySQLAudit
Scale
out
blockchain
monitoringsecurity
bakcupHA
Performance
No
Money
Architectureauth
Mission !!
PGDay.Seoul 2018 5
HA – github’s Orchestrator
PGDay.Seoul 2018 6
Scale-out – TiDB, VitessDB
PGDay.Seoul 2018 7
PingCap’s TiDB PingCap’s TiDB
Auth & Security ?!
PGDay.Seoul 2018 8
FreeIPA Tadpole DB Hub
PostgreSQL Authentication
PGDay.Seoul 2018 9
Authentication vs Authorization
인증 권한
PGDay.Seoul 2018 10
Client Authentication
PGDay.Seoul 2018 11
https://paquier.xyz/content/materials/20180531_pgcon_auth.pdf
인증 설명
trust
연결을 무조건 허용합니다. 이 방식은 PostgreSQL 데이터베이스 서버에 연결할 수있는 모든 사용자가 모든 PostgreSQL 사용자로 암호 및 기타 인증없이 로그인하는 것을 허
용합니다.
reject
연결을 무조건 거부합니다. 특정 호스트를 한 그룹에서 ' 제외 ' 하는 데 유용합니다. 예를 들어, 한 줄의 reject특정 호스트가 연결을 거부합니다. 한편, 뒤에 줄에서 특정 네트
워크의 나머지 호스트가 연결을 허용합니다.
scram-sha-256 SCRAM-SHA-256 인증을 수행하여 사용자의 암호를 확인합니다.
md5 SCRAM-SHA-256 또는 MD5 인증을 수행하여 사용자의 암호를 확인합니다.
password 클라이언트에 대한 인증시에 일반 텍스트 암호를 요구합니다. 암호는 네트워크를 통해 일반 텍스트 형식으로 전송되므로 신뢰할 수없는 네트워크에서는 사용하지 마십시오.
gss 사용자 인증에 GSSAPI를 사용합니다. 이것은 TCP / IP 연결을 사용하는 경우에만 사용할 수 있습니다.
sspi 사용자의 인증 SSPI를 사용합니다. 이것은 Windows를 사용하는 경우에만 사용할 수 있습니다.
ident
클라이언트 운영 체제에서 사용자 이름을 클라이언트상의 ident 서버에게 물어 아이디가 요구 된 데이터베이스 사용자 이름과 일치하는지 확인합니다. ident 인증은 TCP / IP
연결에서만 사용할 수 있습니다. 로컬 연결이 지정되어있는 경우는 peer 인증이 대신 사용됩니다.
peer 클라이언트 운영 체제에서 사용자 이름을 운영 체제에서 가져온 사용자 이름이 요청한 데이터베이스 사용자 이름과 일치하는지 확인합니다. 이것은 로컬 접속시에만 사용
ldap LDAP 서버를 사용하여 인증합니다.
radius RADIUS 서버를 사용하여 인증합니다.
cert SSL 클라이언트 인증서를 사용하여 인증합니다.
pam 운영 체제에서 제공하는 PAM (Pluggable Authentication Modules) 서비스를 사용한 인증입니다.
bsd 운영 체제에서 제공되는 BSD 인증 서비스를 사용하여 인증합니다.
GSSAPI or GSS-API
( Generic Security Services Application Program Interface )
GSSAPI == Keberos API
KRB5 API
PGDay.Seoul 2018 12
Keberos
• 커베로스(Kerberos)는 티켓(ticket)을 기반으로 동작
하는 컴퓨터 네트워크 인증 암호화 프로토콜로서 비
보안 네트워크에서 통신하는 노드가 보안 방식으로
다른 노드에 대해 식별할 수 있게 허용한다.
• 클라이언트-서버 모델을 목적으로 개발되었으며 사
용자와 서버가 서로 식별할 수 있는 상호 인증(양방
향 인증)을 제공한다.
• 커베로스 프로토콜의 메시지는 도청과 재전송 공격
으로부터 보호된다.
• 커베로스는 대칭 키 암호로 빌드되며 TTP(신뢰된 서
드 파티)를 요구한다. 또, 특정 인증 구간에서 비대칭
키 암호 방식을 이용함으로써 선택적으로 공개 키 암
호 방식을 사용할 수 있다.
PGDay.Seoul 2018 13
https://www.ibm.com/support/knowledgecenter/ko/SS7K4U_8.5.5/com.ibm.websphere.zseries.doc/ae/csec
_kerb_auth_explain.html#csec_kerb_auth_explain__kerbwhat
LDAP ( Lightweight Directory Access Protocol )
PGDay.Seoul 2018 14
LDAP ( Lightweight Directory Access Protocol )
https://dzone.com/articles/introduction-to-kerberos-for-managers
PGDay.Seoul 2018 15
Authentication Flow Authorization Flow
PAM ( Pluggable Authentication Modules )
PGDay.Seoul 2018 16
IBM’s RHEL’s IdM FreeIPA
PGDay.Seoul 2018 17
FreeIPA ( I + P + T or A )
PGDay.Seoul 2018 18
• Manage Linux users and client hosts in your realm from one central locatio
n with CLI, Web UI or RPC access. Enable Single Sign On authentication fo
r all your systems, services and applications.
Identify
• Define Kerberos authentication and authorization policies for your identities
. Control services like DNS, SUDO, SELinux or autofs.Policy
• Create mutual trust with other Identity Management systems like
Microsoft Active Directory.
• Audit : http://scribery.github.io
Trusts ?!
RHEL’s IdM or IPA ?!
PGDay.Seoul 2018 19
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/linux_domain_identity_authentication_and_policy_guide/index
FreeIPA
PGDay.Seoul 2018 20
Dogtag Cert
Keberos
BIND
NTP
LDAP
389
DS
SSSD
(pam,sshd,sudo)
FreeIPA
PGDay.Seoul 2018 21
FreeIPA Web UI
PGDay.Seoul 2018 22
OAuth2, SAML, …
PGDay.Seoul 2018 23
OpenStack
PGDay.Seoul 2018 24
SSO ( Single Sign-On )
PGDay.Seoul 2018 25
FreeIPA
DEMO
PGDay.Seoul 2018 26
PGDay.Seoul 2018 27
PGDay.Seoul 2018 28
PGDay.Seoul 2018 29
PGDay.Seoul 2018 30
PGDay.Seoul 2018 31
PGDay.Seoul 2018 32
PGDay.Seoul 2018 33
PostgreSQL
$ vim postgesql.conf
krb_server_keyfile = '/var/lib/pgsql/data/krb5.keytab'
krb_srvname = 'postgres’
$ vim pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 gss include_realm=0 krb_realm=EXAMPLE.COM
PGDay.Seoul 2018 34
PostgreSQL
ssh 1st change password
$ kinit myuser
$ createuser myuser
$ psql –U myuser
PGDay.Seoul 2018 35
R.I.P.
PGDay.Seoul 2018 36
Q?!A
PGDay.Seoul 2018 37
1 of 37

More Related Content

What's hot(20)

AWS 활용한 Data Lake 구성하기AWS 활용한 Data Lake 구성하기
AWS 활용한 Data Lake 구성하기
Nak Joo Kwon1.6K views

Similar to [Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA(20)

Google Cloud Platform - ApigeeGoogle Cloud Platform - Apigee
Google Cloud Platform - Apigee
bliexsoft974 views
API Management Reference ArchitectureAPI Management Reference Architecture
API Management Reference Architecture
Seong-Bok Lee2.8K views
게이트단의 보안게이트단의 보안
게이트단의 보안
Choonghyun Yang835 views
Hyperconnect pycon 2019Hyperconnect pycon 2019
Hyperconnect pycon 2019
Jun Young Lee349 views
REST API 설계REST API 설계
REST API 설계
Terry Cho63.3K views
Google Cloud NEXT'17 정리Google Cloud NEXT'17 정리
Google Cloud NEXT'17 정리
Yongyoon Shin1.9K views
개발자를 위한 네이버 클라우드 플랫폼ㅣNAVER CLOUD PLATFORM for Developers 개발자를 위한 네이버 클라우드 플랫폼ㅣNAVER CLOUD PLATFORM for Developers
개발자를 위한 네이버 클라우드 플랫폼ㅣNAVER CLOUD PLATFORM for Developers
NAVER CLOUD PLATFORMㅣ네이버 클라우드 플랫폼1.7K views

More from PgDay.Seoul(20)

[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning
PgDay.Seoul1.2K views

[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA

  • 2. Agenda • About me • PostgreSQL Authentication • IBM’s RHEL’s IdM FreeIPA • DEMO PGDay.Seoul 2018 2
  • 3. About me PGDay.Seoul 2018 3 •이형채 (대명봇) • 게임허브 • Kosslab • Tibero • Altibase • Telcobase • Cubrid • Inervit
  • 6. HA – github’s Orchestrator PGDay.Seoul 2018 6
  • 7. Scale-out – TiDB, VitessDB PGDay.Seoul 2018 7 PingCap’s TiDB PingCap’s TiDB
  • 8. Auth & Security ?! PGDay.Seoul 2018 8 FreeIPA Tadpole DB Hub
  • 10. Authentication vs Authorization 인증 권한 PGDay.Seoul 2018 10
  • 11. Client Authentication PGDay.Seoul 2018 11 https://paquier.xyz/content/materials/20180531_pgcon_auth.pdf 인증 설명 trust 연결을 무조건 허용합니다. 이 방식은 PostgreSQL 데이터베이스 서버에 연결할 수있는 모든 사용자가 모든 PostgreSQL 사용자로 암호 및 기타 인증없이 로그인하는 것을 허 용합니다. reject 연결을 무조건 거부합니다. 특정 호스트를 한 그룹에서 ' 제외 ' 하는 데 유용합니다. 예를 들어, 한 줄의 reject특정 호스트가 연결을 거부합니다. 한편, 뒤에 줄에서 특정 네트 워크의 나머지 호스트가 연결을 허용합니다. scram-sha-256 SCRAM-SHA-256 인증을 수행하여 사용자의 암호를 확인합니다. md5 SCRAM-SHA-256 또는 MD5 인증을 수행하여 사용자의 암호를 확인합니다. password 클라이언트에 대한 인증시에 일반 텍스트 암호를 요구합니다. 암호는 네트워크를 통해 일반 텍스트 형식으로 전송되므로 신뢰할 수없는 네트워크에서는 사용하지 마십시오. gss 사용자 인증에 GSSAPI를 사용합니다. 이것은 TCP / IP 연결을 사용하는 경우에만 사용할 수 있습니다. sspi 사용자의 인증 SSPI를 사용합니다. 이것은 Windows를 사용하는 경우에만 사용할 수 있습니다. ident 클라이언트 운영 체제에서 사용자 이름을 클라이언트상의 ident 서버에게 물어 아이디가 요구 된 데이터베이스 사용자 이름과 일치하는지 확인합니다. ident 인증은 TCP / IP 연결에서만 사용할 수 있습니다. 로컬 연결이 지정되어있는 경우는 peer 인증이 대신 사용됩니다. peer 클라이언트 운영 체제에서 사용자 이름을 운영 체제에서 가져온 사용자 이름이 요청한 데이터베이스 사용자 이름과 일치하는지 확인합니다. 이것은 로컬 접속시에만 사용 ldap LDAP 서버를 사용하여 인증합니다. radius RADIUS 서버를 사용하여 인증합니다. cert SSL 클라이언트 인증서를 사용하여 인증합니다. pam 운영 체제에서 제공하는 PAM (Pluggable Authentication Modules) 서비스를 사용한 인증입니다. bsd 운영 체제에서 제공되는 BSD 인증 서비스를 사용하여 인증합니다.
  • 12. GSSAPI or GSS-API ( Generic Security Services Application Program Interface ) GSSAPI == Keberos API KRB5 API PGDay.Seoul 2018 12
  • 13. Keberos • 커베로스(Kerberos)는 티켓(ticket)을 기반으로 동작 하는 컴퓨터 네트워크 인증 암호화 프로토콜로서 비 보안 네트워크에서 통신하는 노드가 보안 방식으로 다른 노드에 대해 식별할 수 있게 허용한다. • 클라이언트-서버 모델을 목적으로 개발되었으며 사 용자와 서버가 서로 식별할 수 있는 상호 인증(양방 향 인증)을 제공한다. • 커베로스 프로토콜의 메시지는 도청과 재전송 공격 으로부터 보호된다. • 커베로스는 대칭 키 암호로 빌드되며 TTP(신뢰된 서 드 파티)를 요구한다. 또, 특정 인증 구간에서 비대칭 키 암호 방식을 이용함으로써 선택적으로 공개 키 암 호 방식을 사용할 수 있다. PGDay.Seoul 2018 13 https://www.ibm.com/support/knowledgecenter/ko/SS7K4U_8.5.5/com.ibm.websphere.zseries.doc/ae/csec _kerb_auth_explain.html#csec_kerb_auth_explain__kerbwhat
  • 14. LDAP ( Lightweight Directory Access Protocol ) PGDay.Seoul 2018 14
  • 15. LDAP ( Lightweight Directory Access Protocol ) https://dzone.com/articles/introduction-to-kerberos-for-managers PGDay.Seoul 2018 15 Authentication Flow Authorization Flow
  • 16. PAM ( Pluggable Authentication Modules ) PGDay.Seoul 2018 16
  • 17. IBM’s RHEL’s IdM FreeIPA PGDay.Seoul 2018 17
  • 18. FreeIPA ( I + P + T or A ) PGDay.Seoul 2018 18 • Manage Linux users and client hosts in your realm from one central locatio n with CLI, Web UI or RPC access. Enable Single Sign On authentication fo r all your systems, services and applications. Identify • Define Kerberos authentication and authorization policies for your identities . Control services like DNS, SUDO, SELinux or autofs.Policy • Create mutual trust with other Identity Management systems like Microsoft Active Directory. • Audit : http://scribery.github.io Trusts ?!
  • 19. RHEL’s IdM or IPA ?! PGDay.Seoul 2018 19 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/linux_domain_identity_authentication_and_policy_guide/index
  • 20. FreeIPA PGDay.Seoul 2018 20 Dogtag Cert Keberos BIND NTP LDAP 389 DS SSSD (pam,sshd,sudo)
  • 25. SSO ( Single Sign-On ) PGDay.Seoul 2018 25 FreeIPA
  • 34. PostgreSQL $ vim postgesql.conf krb_server_keyfile = '/var/lib/pgsql/data/krb5.keytab' krb_srvname = 'postgres’ $ vim pg_hba.conf # TYPE DATABASE USER CIDR-ADDRESS METHOD host all all 0.0.0.0/0 gss include_realm=0 krb_realm=EXAMPLE.COM PGDay.Seoul 2018 34
  • 35. PostgreSQL ssh 1st change password $ kinit myuser $ createuser myuser $ psql –U myuser PGDay.Seoul 2018 35