oak-security-audit

NAME

oak-security-audit: audit accounts, passwords, privileges and other security settings.

SYNOPSIS

Perform a strict audit:
oak-security-audit
Perform a strict audit (explicit):
oak-security-audit --audit-level=strict
Perform a strict audit (explicit), handle the users 'my_admin' and 'my_assistant' as if they were 'root':
oak-security-audit --audit-level=strict --assume-root=my_admin,my_assistant
Perform a normal level (more relaxed) audit:
oak-security-audit --audit-level=normal
Same as above, provide connection parameters, prompt for password:
oak-security-audit --user=root --ask-pass --socket=/tmp/mysql.sock -l normal
Same as above, use defaults file:
oak-security-audit --defaults-file=/home/myuser/.my-oak.cnf -l normal

DESCRIPTION

oak-security-audit connects to a MySQL instance and performs comprehensive security tests. Tests are performed on the following subjects:
  • Accounts
  • Passwords
  • Privileges
  • General
The utility prints a detailed report which lists the tests, the result of each test, and recommendations. Recommendations may vary from specific queries to be executed, to general guidelines for consideration. The utility does not modify data or performs any of its recommendations. It is up to the user to decide if and how to act. The following audits are performed:
  • Accounts
    • Check for non-local root accounts
    • Check for anonymous users
    • Check for wildcard host accounts
  • Passwords
    • Look for accounts with empty passwords (implies no password required)
    • Look for different users sharing the same password
  • Privileges
    • Report non-root accounts with all grants
    • Report non-root accounts with administrative privileges (e.g. SUPER, SHUTDOWN)
    • Report non-root accounts with powerful modification privileges (e.g. DROP, ALTER)
    • Report non-root accounts with data manipulation privileges on all schemata
    • Report non-root accounts with write access to the `mysql` schema
  • General
    • Check the security related sql_mode
    • See if old passwords are used
    • See if networking is enabled
    • See if the `test` schema exists
If --assume-root is used, then in addition to user 'root', all listed users are handled in the same way as 'root'. This means some tests will be more restrictive on those users, and some more permissive.

OPTIONS

--ask-pass

Prompt for password.

-r ASSUME_ROOT, --assume-root=ASSUME_ROOT

Comma seperated list of users which are to be treated as 'root'

--defaults-file=DEFAULTS_FILE

Read from MySQL configuration file. Overrides --user, --password, --socket, --port.

Configuration needs to be in the following format:

[client]
user=my_user
password=my_pass
socket=/tmp/mysql.sock
port=3306

-H HOST, --host=HOST

MySQL host (default: localhost)

-p PASSWORD, --password=PASSWORD

MySQL password

-P PORT, --port=PORT

TCP/IP port (default: 3306)

-S SOCKET, --socket=SOCKET

MySQL socket file. Only applies when host is localhost

-u USER, --user=USER

MySQL user

ENVIRONMENT

Requires MySQL 5.0 or newer, python 2.3 or newer. python-mysqldb must be installed in order to use this tool. You can
apt-get install python-mysqldb
or
yum install mysql-python

SEE ALSO

oak-block-account

LICENSE

This tool is released under the BSD license.
Copyright (c) 2008 - 2010, Shlomi Noach
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

AUTHOR

Shlomi Noach
 
openark kit documentation