Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
chef-mysql-hardening — このchef cookbookはmysqlのセキュリティ設定を提供します。 | Kitploit
ツール/GitHubGitHub/dev-sec/chef-mysql-hardening
防御ツールスクリプトと自動化構成監査DevSecOps設定ミスデータベースセキュリティ
GitHubdev-sec/chef-mysql-hardening

chef-mysql-hardening

このchef cookbookはmysqlのセキュリティ設定を提供します。

リポジトリを見る
278110日前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有
ウェブサイト

mysql-hardening (Chef cookbook)

Supermarket Build Status Code Coverage Dependencies Gitter Chat

説明

mysql のセキュリティ設定を提供します。攻撃者に対する攻撃面を最小限に抑えた設定で、本番環境に対応した mysql インスタンスをセットアップすることを目的としています。

この cookbook は mysql のセキュリティ設定に焦点を当てており、インストールには mysql cookbook を再利用しています。そのため、Chef で既存の mysql 設定の上にこのハードニング層を追加できます。

この cookbook は os-hardening および ssh-hardening と問題なく連携するように最適化されています。これらがなくても問題なく動作しますが、apt-get update や yum update などの前提条件がすべて満たされていることを確認する必要があります。

要件

  • Opscode chef

使用方法

サンプルの role は次のようになります。

root@kitploit:~
{
    "name": "mysql",
    "default_attributes": { },
    "override_attributes": { },
    "json_class": "Chef::Role",
    "description": "MySql Hardened Server Test Role",
    "chef_type": "role",
    "default_attributes" : {
      "mysql": {
        "server_root_password": "iloverandompasswordsbutthiswilldo",
        "server_debian_password": "iloverandompasswordsbutthiswilldo"
      }
    },
    "run_list": [
        "recipe[chef-solo-search]",
        "recipe[apt]",
        "recipe[mysql::server]",
        "recipe[mysql-hardening]"
    ]
}

レシピ

mysql-hardening::hardening (デフォルト)

このレシピは mysql cookbook のオーバーレイレシピであり、mysql-hardening::hardening を適用します。

以下を runlist に追加し、セキュリティオプションの属性をカスタマイズしてください。

root@kitploit:~
  "recipe[mysql::server]",
  "recipe[mysql-hardening]"

このハードニングレシピはハードニングをインストールしますが、Mysql、MariaDB、または Percona の既存のインストールを前提としています。mysql cookbook を使用していない場合は、属性を適宜調整する必要があるかもしれません。

  • node['mysql']['service_name'] = 'default'
  • node['mysql']['data_dir'] = '/var/lib/mysql'
  • node['mysql-hardening']['conf-file'] = '/etc/mysql/conf.d/hardening.cnf'
  • node['mysql-hardening']['user'] = 'mysql'

セキュリティオプション

詳細情報は Deutsche Telekom (ドイツ語) および Symantec で既に公開されています。

  • default['mysql']['security']['chroot'] - chroot
  • default['mysql']['security']['safe_user_create'] - safe-user-create
  • default['mysql']['security']['secure_auth'] - secure-auth
  • default['mysql']['security']['skip_symbolic_links'] - skip-symbolic-links
  • default['mysql']['security']['skip_show_database'] - skip-show-database
  • default['mysql']['security']['local_infile'] - local-infile
  • default['mysql']['security']['allow-suspicious-udfs'] - allow-suspicious-udfs
  • default['mysql']['security']['automatic_sp_privileges'] - automatic_sp_privileges
  • default['mysql']['security']['secure-file-priv'] - secure-file-priv

セキュリティ設定

このセットアップでは、デフォルトで以下のパラメータを設定します。

root@kitploit:~
user = mysql
port = 3306
bind-address = X.Y.Z.W

# via ['mysql']['security']['local_infile']
local-infile = 0

# via ['mysql']['security']['safe_user_create']
safe-user-create = 1

# via ['mysql']['security']['secure_auth']
secure-auth = 1

# via ['mysql']['security']['skip_show_database']
skip-show-database

# via ['mysql']['security']['skip_symbolic_links']
skip-symbolic-links

# via ['mysql']['security']['automatic_sp_privileges']
automatic_sp_privileges = 0

# via ['mysql']['security']['secure-file-priv']
secure-file-priv = /tmp

さらに、以下のパラメータが設定されていないことを保証します。

  • ['mysql']['security']['secure_auth'] による old-passwords の無効化
  • node['mysql']['security']['allow-suspicious-udfs'] による allow-suspicious-udfs の無効化
  • skip-grant-tables
  • chroot (代わりに Ubuntu では AppArmor を推奨)

さらに、/var/lib/mysql のパーミッションは mysql ユーザーに制限されます。

テスト

root@kitploit:~
# Install dependencies
gem install bundler
bundle install

# Do lint checks
bundle exec rake lint

# Fetch tests
git clone https://github.com/dev-sec/tests-mysql-hardening test/integration

# fast test on one machine
bundle exec kitchen test default-ubuntu-1204

# test on all machines
bundle exec kitchen test

# for development
bundle exec kitchen create default-ubuntu-1204
bundle exec kitchen converge default-ubuntu-1204

この cookbook には、簡単に開発するための guard ファイルが付属しています。開発中、guard はフォルダを監視し、foodcritic と robocop を実行します。

root@kitploit:~
# list all plugins
bundle exec guard list

# run guard with foodcritic and robocop
bundle exec guard -P Foodcritic Rubocop

テスト済みオペレーティングシステム

  • Ubuntu 12.04
  • Ubuntu 14.04
  • CentOS 6.4
  • CentOS 6.5
  • Oracle 6.4
  • Oracle 6.5
  • Debian 7

コントリビューター + 謝辞

  • Dominik Richter
  • Christoph Hartmann
  • Patrick Meier
  • Edmund Haselwanter

ライセンスと作者

  • Author:: Deutsche Telekom AG

Apache License, Version 2.0 (以下「ライセンス」) に基づいてライセンスされています。 ライセンスに準拠する場合を除き、このファイルを使用することはできません。 ライセンスのコピーは以下から入手できます。

root@kitploit:~
http://www.apache.org/licenses/LICENSE-2.0

適用法で要求される場合、または書面による同意がある場合を除き、 ライセンスに基づいて配布されるソフトウェアは「現状のまま」で配布され、 明示的または黙示的を問わず、いかなる保証も伴いません。 ライセンスに基づく特定の言語による許可および制限については、 ライセンスを参照してください。

ツールをダウンロード