Skip to content
KitploitKITPLOIT
FerramentasExploitsBlog
Log in
Enviar
FerramentasExploitsBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
chef-mysql-hardening — Este cookbook do chef fornece configuração de segurança para o mysql. | Kitploit
Ferramentas/GitHubGitHub/dev-sec/chef-mysql-hardening
Ferramentas DefensivasScripting e AutomaçãoAuditoria de ConfiguraçãoDevSecOpsConfiguração IncorretaSegurança de Banco de Dados
GitHubdev-sec/chef-mysql-hardening

chef-mysql-hardening

Este cookbook do chef fornece configuração de segurança para o mysql.

Ver Repositório
2781há 10 diasRevisado pelo Kitploit

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Site
Compartilhar

mysql-hardening (Chef cookbook)

Supermarket Build Status Code Coverage Dependencies Gitter Chat

Descrição

Fornece configurações de segurança para o mysql. Destina-se a configurar instâncias de mysql prontas para produção, configuradas com uma superfície mínima para atacantes.

Este cookbook foca na configuração de segurança do mysql e reutiliza o mysql cookbook para a instalação. Portanto, você pode adicionar esta camada de hardening sobre sua configuração existente de mysql no Chef.

Otimizamos este cookbook para funcionar com e sem complicações. Ele funcionará bem sem eles, mas você precisa garantir que todas as pré-condições, como ou , sejam atendidas.

os-hardening
ssh-hardening
apt-get update
yum update

Requisitos

  • Opscode chef

Uso

Um exemplo de role pode ser assim:

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]"
    ]
}

Recipes

mysql-hardening::hardening (padrão)

Esta recipe é uma recipe de sobreposição para o mysql cookbook) e aplica mysql-hardening::hardening

Adicione o seguinte à sua runlist e personalize os atributos das opções de segurança

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

Esta recipe de hardening instala o hardening, mas espera uma instalação existente de Mysql, MariaDB ou Percona. Se você não estiver usando o mysql cookbook, talvez seja necessário adaptar os atributos:

  • 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'

Opções de Segurança

Informações adicionais já estão disponíveis em Deutsche Telekom (Alemão) e 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

Configuração de Segurança

Esta configuração define os seguintes parâmetros por padrão

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

Além disso, garante que os seguintes parâmetros não estejam definidos

  • desativar old-passwords via ['mysql']['security']['secure_auth']
  • desativar allow-suspicious-udfs via node['mysql']['security']['allow-suspicious-udfs']
  • skip-grant-tables
  • chroot (em vez disso, preferimos AppArmor no Ubuntu)

Além disso, a permissão de /var/lib/mysql é limitada ao usuário mysql.

Testes

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

Este cookbook vem com um arquivo guard para facilitar o desenvolvimento. Durante o desenvolvimento, o guard monitora as pastas e executa footcritic e robocop.

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

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

Sistemas Operacionais Testados

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

Contribuidores + Agradecimentos

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

Licença e Autor

  • Author:: Deutsche Telekom AG

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Baixar ferramenta