Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
chef-mysql-hardening — Questa cookbook di chef fornisce la configurazione di sicurezza per mysql. | Kitploit
Strumenti/GitHubGitHub/dev-sec/chef-mysql-hardening
Strumenti DifensiviScripting e AutomazioneAudit di ConfigurazioneDevSecOpsConfigurazione ErrataSicurezza dei Database
GitHubdev-sec/chef-mysql-hardening

chef-mysql-hardening

Questa cookbook di chef fornisce la configurazione di sicurezza per mysql.

Vedi Repository
278110 giorni faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Sito web
Condividi

mysql-hardening (Chef cookbook)

Supermarket Build Status Code Coverage Dependencies Gitter Chat

Descrizione

Fornisce configurazioni di sicurezza per mysql. È pensato per configurare istanze mysql pronte per la produzione, configurate con una superficie minima per gli attaccanti.

Questo cookbook si concentra sulla configurazione di sicurezza di mysql e riutilizza il mysql cookbook per l'installazione. Pertanto puoi aggiungere questo livello di hardening sopra la tua configurazione mysql esistente in Chef.

Abbiamo ottimizzato questo cookbook per funzionare senza problemi con e . Funzionerà bene anche senza, ma devi assicurarti che tutte le precondizioni come o siano soddisfatte.

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

Requisiti

  • Opscode chef

Utilizzo

Un ruolo di esempio potrebbe essere:

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 (predefinita)

Questa recipe è una recipe di sovrapposizione per il mysql cookbook) e applica mysql-hardening::hardening

Aggiungi quanto segue alla tua runlist e personalizza gli attributi delle opzioni di sicurezza

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

Questa recipe di hardening installa l'hardening ma si aspetta un'installazione esistente di Mysql, MariaDB o Percona. Se non stai usando il mysql cookbook, potresti dover adattare gli attributi:

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

Opzioni di sicurezza

Ulteriori informazioni sono già disponibili presso Deutsche Telekom (tedesco) 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

Configurazione di sicurezza

Questa configurazione imposta i seguenti parametri per impostazione predefinita

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

Inoltre garantisce che i seguenti parametri non siano impostati

  • disattiva old-passwords tramite ['mysql']['security']['secure_auth']
  • disattiva allow-suspicious-udfs tramite node['mysql']['security']['allow-suspicious-udfs']
  • skip-grant-tables
  • chroot (preferiamo invece AppArmor per Ubuntu)

Inoltre i permessi di /var/lib/mysql sono limitati all'utente mysql.

Test

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

Questo cookbook viene fornito con un file guard per facilitare lo sviluppo. Durante lo sviluppo guard controlla le cartelle ed esegue footcritic e robocop.

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

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

Sistemi operativi testati

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

Contributori + Riconoscimenti

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

Licenza e Autore

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

Scarica lo strumento