
This chef cookbook는 mysql에 대한 보안 구성을 제공합니다.
mysql을 위한 보안 구성을 제공합니다. 공격자에게 최소한의 공격 표면만 노출되도록 구성된 프로덕션 환경용 mysql 인스턴스를 설정하는 것을 목적으로 합니다.
이 cookbook은 mysql의 보안 구성에 초점을 맞추며, 설치를 위해 mysql cookbook을 재사용합니다. 따라서 Chef에서 기존 mysql 구성 위에 이 하드닝 계층을 추가할 수 있습니다.
이 cookbook은 os-hardening 및 ssh-hardening과 문제없이 작동하도록 최적화되었습니다. 이들 없이도 잘 동작하지만, apt-get update 또는 yum update와 같은 모든 사전 조건이 충족되었는지 확인해야 합니다.
예시 role은 다음과 같습니다:
{
"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 cookbook을 위한 오버레이 레시피이며 mysql-hardening::hardening을 적용합니다.
다음을 runlist에 추가하고 보안 옵션 속성을 사용자 정의하세요.
"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에서 이미 확인할 수 있습니다.
이 설정은 기본적으로 다음 매개변수를 설정합니다.
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 비활성화또한 /var/lib/mysql의 권한은 mysql 사용자로 제한됩니다.
# 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을 실행합니다.
# list all plugins
bundle exec guard list
# run guard with foodcritic and robocop
bundle exec guard -P Foodcritic Rubocop
Apache License, Version 2.0("라이선스")에 따라 라이선스가 부여됩니다. 라이선스를 준수하지 않는 한 이 파일을 사용할 수 없습니다. 라이선스 사본은 다음에서 확인할 수 있습니다.
http://www.apache.org/licenses/LICENSE-2.0
관련 법률에서 요구하거나 서면으로 동의하지 않는 한, 라이선스에 따라 배포되는 소프트웨어는 명시적이든 묵시적이든 어떠한 종류의 보증이나 조건 없이 "있는 그대로" 배포됩니다. 라이선스에 따른 권한과 제한 사항에 대한 구체적인 내용은 라이선스를 참조하세요.