LoginSignup
1
1

More than 5 years have passed since last update.

DBSATの新バージョンを試す(DBSAT 2.1.0)

Posted at

Oracle Databaseの各種設定がセキュリティの観点で望ましい状態にあるかをアセスメントするツールがOracle Database Security Assessment Tool (DBSAT)です。
旧バージョンの使い方をこちらに書きましたが、3月にバージョン2.1.0がリリースされたため Oracle Database 18c に対して再度検証してみました。詳しいマニュアルはこちらから参照することができます。

新機能

以下の新機能が dbsat 2.1.0 には追加されました。

  • Oracle Database 18c, 19c および Autonomous Databases をサポート
  • STIG Rules への参照を追加
  • ユーザーに直接付与されたシステム権限にマーク
  • PUBLICに付与されたシステム権限にマーク
  • PDB runs show only Roles and Privileges that can be acted upon for quicker remediation
  • 監査設定に対する追加検証
  • 一部推奨項目の変更
  • REMOTE_LOGIN_PASSWORDFILE に対する追加検証
  • インスタンス名に対する追加検証
  • 90日以内のバックアップに関する追加検証
  • 監査データに対する権限の検証
  • DBMS_AUDIT_MGMT パッケージに対する権限の検証
  • Discoverer で Java 9 and 10のサポート
  • Discoverer で多国語対応
  • Discoverer でカテゴリーの追加
  • Discoverer でリスクレベル毎の推奨項目を追加

事前準備

準備段階はあまり変わっていません。

ユーザー作成

以下の権限を持つユーザーが必要です。旧バージョンと異なるのはCAPTURE_ADMINロールが必要になったくらいでしょうか。

  • CREATE SESSION システム権限
  • SYS.REGISTRY$HISTORY に対するSELECT オブジェクト権限
  • SELECT_CATALOG_ROLEロール
  • DV_SECANALYST ロール (Database Vaultを使っている場合)
  • AUDIT_VIEWER ロール
  • CAPTURE_ADMIN ロール
  • SYS.DBA_USERS_WITH_DEFPWD に対する SELECT オブジェクト権限
  • AUDSYS.AUD$UNIFIED に対する SELECT オブジェクト権限
$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Thu Apr 11 13:09:42 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> CREATE USER dbsat IDENTIFIED BY dbsat DEFAULT TABLESPACE users;

User created.

SQL> GRANT CREATE SESSION TO dbsat;

Grant succeeded.

SQL> GRANT SELECT_CATALOG_ROLE TO dbsat;

Grant succeeded.

SQL> GRANT AUDIT_VIEWER TO dbsat;

Grant succeeded.

SQL> GRANT CAPTURE_ADMIN TO dbsat;

Grant succeeded.

SQL> GRANT SELECT ON SYS.DBA_USERS_WITH_DEFPWD TO dbsat;

Grant succeeded.

SQL> GRANT SELECT ON AUDSYS.AUD$UNIFIED TO dbsat;

Grant succeeded.

インストール

インストール方法も変わっていません。My Oracle Support (MOS) から以下のドキュメントを参照し、dbsat.zipファイルをダウンロードします。

Oracle Database Security Assessment Tool (DBSAT) (Doc ID 2138254.1)

ダウンロードしたzipファイルを任意のディレクトリに展開します。

$ mkdir dbsat
$ cd dbsat
$ unzip ../dbsat.zip
Archive:  ../dbsat.zip
  inflating: dbsat
  inflating: dbsat.bat
  inflating: sat_reporter.py
  inflating: sat_analysis.py
  inflating: sat_collector.sql
  inflating: xlsxwriter/app.py
  inflating: xlsxwriter/chart_area.py
  inflating: xlsxwriter/chart_bar.py
  inflating: xlsxwriter/chart_column.py
  inflating: xlsxwriter/chart_doughnut.py
  inflating: xlsxwriter/chart_line.py
  inflating: xlsxwriter/chart_pie.py
  inflating: xlsxwriter/chart.py
  inflating: xlsxwriter/chart_radar.py
  inflating: xlsxwriter/chart_scatter.py
  inflating: xlsxwriter/chartsheet.py
  inflating: xlsxwriter/chart_stock.py
  inflating: xlsxwriter/comments.py
  inflating: xlsxwriter/compat_collections.py
  inflating: xlsxwriter/compatibility.py
  inflating: xlsxwriter/contenttypes.py
  inflating: xlsxwriter/core.py
  inflating: xlsxwriter/custom.py
  inflating: xlsxwriter/drawing.py
  inflating: xlsxwriter/exceptions.py
  inflating: xlsxwriter/format.py
  inflating: xlsxwriter/__init__.py
  inflating: xlsxwriter/packager.py
  inflating: xlsxwriter/relationships.py
  inflating: xlsxwriter/shape.py
  inflating: xlsxwriter/sharedstrings.py
  inflating: xlsxwriter/styles.py
  inflating: xlsxwriter/table.py
  inflating: xlsxwriter/theme.py
  inflating: xlsxwriter/utility.py
  inflating: xlsxwriter/vml.py
  inflating: xlsxwriter/workbook.py
  inflating: xlsxwriter/worksheet.py
  inflating: xlsxwriter/xmlwriter.py
  inflating: xlsxwriter/LICENSE.txt
  inflating: Discover/bin/discoverer.jar
  inflating: Discover/lib/ojdbc8.jar
  inflating: Discover/lib/oraclepki.jar
  inflating: Discover/lib/osdt_cert.jar
  inflating: Discover/lib/osdt_core.jar
  inflating: Discover/conf/sample_dbsat.config
  inflating: Discover/conf/sensitive_en.ini
  inflating: Discover/conf/sensitive_es.ini
  inflating: Discover/conf/sensitive_de.ini
  inflating: Discover/conf/sensitive_pt.ini
  inflating: Discover/conf/sensitive_it.ini
  inflating: Discover/conf/sensitive_fr.ini
  inflating: Discover/conf/sensitive_nl.ini

基本的な使い方

使い方は変わっていません。dbsatコマンドにcollectとファイル名や接続ユーザー名を指定し、Collectorを実行します。次に出力されたファイルを指定してReporterを起動します。

$ ./dbsat --help

Database Security Assessment Tool version 2.1 (March 2019)

    Usage: dbsat collect [ -n ] <database_connect_string> <output_file>
           dbsat report [ -a ] [ -n ] [ -x <section> ] <input_file>
           dbsat discover [ -n ] -c <config_file> <output_file>

    Options:
       -a  Report about all user accounts, including locked,
           Oracle-supplied users
       -n  No encryption for output
       -x  Specify sections to exclude from report (may be repeated for
           multiple sections)
       -c  Configuration file for discoverer

Collector の実行

まず Collector を実行します。下記ではデータベースに対する接続ユーザーとしてdbsatを、収集したデータを保存するファイルに $HOME/dbsat.result1.zip ファイルを指定しています。ファイル名にはzip拡張子は指定しません。

$ cd dbsat
$ ./dbsat collect dbsat $HOME/dbsat.result1

Database Security Assessment Tool version 2.1 (March 2019)

This tool is intended to assist in you in securing your Oracle database
system. You are solely responsible for your system and the effect and
results of the execution of this tool (including, without limitation,
any damage or data loss). Further, the output generated by this tool may
include potentially sensitive system configuration data and information
that could be used by a skilled attacker to penetrate your system. You
are solely responsible for ensuring that the output of this tool,
including any generated reports, is handled in accordance with your
company's policies.

Connecting to the target Oracle database...


SQL*Plus: Release 18.0.0.0.0 - Production on Thu Apr 11 13:15:41 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Enter password: <<DB接続パスワード>>

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

Setup complete.
SQL queries complete.
OS commands complete.
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
DBSAT Collector completed successfully.

Calling /u02/app/oracle/product/18.0.0/dbhome_1/bin/zip to encrypt dbsat.result1.json...

Enter password: << zipファイルのパスワード >>
Verify password: << zipファイルのパスワード >>
  adding: dbsat.result1.json (deflated 87%)
zip completed successfully.
$

Reporterの実行

次にReporterを実行します。

$ cd dbsat
$ ./dbsat report -a -n ../dbsat.result1

Database Security Assessment Tool version 2.1 (March 2019)

This tool is intended to assist in you in securing your Oracle database
system. You are solely responsible for your system and the effect and
results of the execution of this tool (including, without limitation,
any damage or data loss). Further, the output generated by this tool may
include potentially sensitive system configuration data and information
that could be used by a skilled attacker to penetrate your system. You
are solely responsible for ensuring that the output of this tool,
including any generated reports, is handled in accordance with your
company's policies.

Archive:  dbsat.result1.zip
[dbsat.result1.zip] dbsat.result1.json password: <<zipファイルのパスワード>>
  inflating: dbsat.result1.json
DBSAT Reporter ran successfully.

レポートの確認

Reporterによるレポートは、HTML, JSON, テキスト, Microsoft Excelのそれぞれの形式で出力されます。

$ ls -l ../dbsat.result1*
-rw------- 1 oracle oinstall 213277 Apr 11 13:19 ../dbsat.result1_report.html
-rw------- 1 oracle oinstall 172149 Apr 11 13:19 ../dbsat.result1_report.json
-rw------- 1 oracle oinstall 148908 Apr 11 13:19 ../dbsat.result1_report.txt
-rw------- 1 oracle oinstall  24663 Apr 11 13:19 ../dbsat.result1_report.xlsx
-rw------- 1 oracle oinstall  49275 Apr 11 13:17 ../dbsat.result1.zip
$

追加された検証項目のうち、いくつかを紹介します。

管理者権限を持つユーザーの一覧
Users with Administrative Privileges

ログオンとログオフの監査が不足
User Logon / Logoff Audit

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1