Top Banner
Oracle 安全实践入门篇 冯大辉 (Fenng)
24

Oracle Security 101

Jan 28, 2015

Download

Technology

Dahui Feng

这是我2007年做的一份文档。因为之前分享出来的文件已经找不到了,因而重新上传了一下。

该文档内容有删节,另外,用的时候注意内容的时效性。
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Oracle Security 101

Oracle 安全之实践入门篇 �

冯大辉 (Fenng) �

Page 2: Oracle Security 101

个人介绍

l  Blog: http://www.dbanotes.net �

l  Oracle ACE �

l  DBA@支付宝(Alipay.com) �

l  IM/Mail: [email protected]

l  Books �

Page 3: Oracle Security 101

议程 �

l  我们身边的安全问题 �

l  发现、收集、侦测 �

l  安全加固(三板斧)���᠋᠌᠍1)OS安全加固���᠋᠌᠍2)Oracle 网络加固���᠋᠌᠍3)RDBMS 安全加固���᠋᠌᠍N)... �

l  其他、更多Oracle安全功能选件 �

l  演示 �

Page 4: Oracle Security 101

我们身边的数据库安全问题

l  eg: 内部人员通过后门入侵数据库,盗取用户账户信息。���᠋᠌᠍ �

l  eg: 应用程序错误,暴露数据库配置信息。���᠋᠌᠍ �

l  eg: 数据库管理员监守自盗,盗取客户资料

Page 5: Oracle Security 101

发现、收集问题 (1)

l  Oracle CPU (Critical Patch Update) 跟踪���᠋᠌᠍Oracle Security Alert ���᠋᠌᠍首次发布 CPU :2005 年 3 月 15 日 ���᠋᠌᠍要注意:“不提供除 CPU 或安全警报通告、安装前说明、自述文件和常见问题解答中所提供信息外的其他具体信息 ” ,也没有“...对产品中的

漏洞开发或发布可利用的入侵代码(或“验证性代码”)” �

l  Metalink Hacking /Google hacking/ Yahoo Hacking���᠋᠌᠍eg: http://www.red-database-security.com/wp/oracle_metalink_hacking_us.pdf �

Page 6: Oracle Security 101

发现、收集问题 (2)

l 内部安全审计、扫描���᠋᠌᠍eg: Nessus ���᠋᠌᠍面对一个新系统的最好办法: scan ... �

l 安全邮件列表 �

Page 7: Oracle Security 101

侦测:Nessus 简介 �

l  Top 100 Network Security Tools No.1 �

l  http://www.nessus.org/ �

l  跨平台 �

l  非 GPL 版权 (个人用户有免费版本可用) �

l  扫描报告示例 ���᠋᠌᠍next pageà �

Page 8: Oracle Security 101
Page 9: Oracle Security 101

安全加固

l  策略���᠋᠌᠍性能、可用性与安全之间的平衡���᠋᠌᠍ �

l  递进式改进���᠋᠌᠍一蹴而就是不可能的���᠋᠌᠍ �

l  Log, Log, Log���᠋᠌᠍操作Log、软件Log,有记录可依 �

Page 10: Oracle Security 101

OS 安全加固 �

l  关闭不必要的端口与服务���᠋᠌᠍eg: snmp �

l  文件完整性检验 �

Tripwire, AIDE, Integrit , AIX Security Expert �

l  相关工具:nmap lsof netstat ...... �

# nmap -sTU localhost �

# find / -path /proc -prune -o -type f -perm +6000 –ls �

Page 11: Oracle Security 101

Oracle 网络安全加固

l  Top 1 Problem: Listener 密码设定���᠋᠌᠍演示在后面���᠋᠌᠍ �

l  Oracle 10g 新增本地操作系统验证功能 �

l  Log 设定与审计 �

l  防火墙 �

Page 12: Oracle Security 101

RDBMS 安全加固 �

l  最小授权原则���᠋᠌᠍grant resouce to scott ; NO, NO, NO! �

l  取消不必要的权限���᠋᠌᠍resouce, unlimited tablespace...create session �

l  权限审计���᠋᠌᠍eg: who has dba role ? �

Page 13: Oracle Security 101

Package 调用溢出权限提升 �

l  UTL_SMTP �

l  UTL_TCP �

l  UTL_HTTP �

l  DBMS_FLASHBACK �

l  DBMS_OBFUSCATION_TOOLKIT �

l  DBMS_METADATA �

l  DBMS_JOB �

l  DBMS_RANDOM �

l  更多......关注 Oracle CPU �

Page 14: Oracle Security 101

避免坏习惯 (1)

l  命令行中的密码:$sqlplus scott/tiger ���᠋᠌᠍$ ps –ef |grep sqlplus ���᠋᠌᠍好的习惯:���᠋᠌᠍sqlplus “/ nolog” ���᠋᠌᠍@>connect scott Enter password: *****

Page 15: Oracle Security 101

避免坏习惯 (2)

l  Shell 脚本中存在密码明文���᠋᠌᠍1) 操作系统验证用户���᠋᠌᠍���᠋᠌᠍2) Oracle Password Repository (OPR)���᠋᠌᠍http://sourceforge.net/projects/opr���᠋᠌᠍���᠋᠌᠍sqlplus -s /NOLOG << EOF���᠋᠌᠍connect system/`opr -r foodb system`@foo �

l  没有或者不遵守密码策略 �l  过度授权���᠋᠌᠍

grant resource to scott; NO! �

Page 16: Oracle Security 101

更为深入的 Oracle 安全选项组件 �

l  Oracle Audit �

l  Fine-Grained Access Control �

l  Oracle Database Vault �

l  Secure Backup �

l  加密与透明数据加密���᠋᠌᠍���᠋᠌᠍Again: 可用性、安全、性能之间的平衡 �

Page 17: Oracle Security 101

出发角度对比

Page 18: Oracle Security 101

Oracle Database Vault 的意义 �

Page 19: Oracle Security 101

安全策略

l  安全策略的建立 难点在于执行

l  安全与可用性、性能之间的平衡 具体情况具体分析

Page 20: Oracle Security 101

Oracle Listener 密码设定演示(1) �

l  LSNRCTL> change_password �l  Old password: �l  New password: �l  Reenter new password: �l  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) �l  Password changed for listener �l  The command completed successfully �l  LSNRCTL> set password �l  Password: �l  The command completed successfully �l  LSNRCTL> save_config �l  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) �l  Saved LISTENER configuration parameters. �l  Listener Parameter File /opt/oracle/products/9.2.0/network/admin/listener.ora �l  Old Parameter File /opt/oracle/products/9.2.0/network/admin/listener.bak �l  The command completed successfully �l  LSNRCTL> exit �

Page 21: Oracle Security 101

Oracle Listener 密码设定演示(2) �

l  $ lsnrctl status���᠋᠌᠍

���᠋᠌᠍LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 07-SEP-2007 18:18:01���᠋᠌᠍Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.���᠋᠌᠍Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))���᠋᠌᠍TNS-01169: The listener has not recognized the password���᠋᠌᠍

���᠋᠌᠍ $ cat /opt/oracle/products/9.2.0/network/admin/listener.ora���᠋᠌᠍

���᠋᠌᠍#----ADDED BY TNSLSNR 07-SEP-2007 18:17:54--- �

�PASSWORDS_LISTENER = A072C8903DA55A33 �

�#-------------------------------------------- �

Page 22: Oracle Security 101

Listener 信息窥探 �

l  $ ./tnscmd status -h 10.0.0.94 -p 1521 --indent l  sending (CONNECT_DATA=(COMMAND=status)) to 10.0.0.94:1521 l  writing 89 bytes l  reading l  . .......6.........u. .................... l  DESCRIPTION= l  (内容略) l  ALIAS=LISTENER l  SECURITY=OFF l  VERSION=TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production l  START_DATE=25-JUN-2007 13:02:37 l  SIDNUM=1 l  LOGFILE=/opt/oracle/products/9.2.0/network/log/listener.log l  PRMFILE=/opt/oracle/products/9.2.0/network/admin/listener.ora l  TRACING=off l  UPTIME=443684410 l  SNMP=OFF l  PID=221398 l  (内容略) l  SERVICE= l  SERVICE_NAME=test l  INSTANCE= l  INSTANCE_NAME=test l  NUM=1 l  INSTANCE_STATUS=UNKNOWN l  NUMREL=1

Page 23: Oracle Security 101

资源

l  tnscmd���᠋᠌᠍http://www.jammed.com/~jwa/hacks/security/tnscmd/ �

l  Metalink Note: 92602.1 ���᠋᠌᠍“How to Password Protect the Listener” �

l  Oracle Database Listener Security Guide���᠋᠌᠍http://www.integrigy.com/security-resources/whitepapers/Integrigy_Oracle_Listener_TNS_Security.pdf �

Page 24: Oracle Security 101

Q & A

l  http://www.dbanotes.net 订阅RSS,获取动态 �