Search code examples
mysqlubuntuintrusion-detection

How to Monitor MYSQL changes


I have installed The AIDE on my Ubuntu server and I would like now to Monitor MYSQL changes (new fields, new content, new tables etc. created). How can I do this with AIDE?

Thanks! Roman


Solution

  • Unless there is a special library (framework or app) I can't see a way for you to do this using AIDE. AIDE would better serve to monitor configuration files, and instead daily dumps of the actual SQL on an offsite server (that also supports versioning).

    Requirement: I would like now to Monitor MYSQL changes (new fields, new content, new tables etc. created).

    From here there is a description of what AIDE does:

    "It is a host-based intrusion detection system (HIDS) for checking the integrity of files. It does this by creating a baseline database of files on an initial run, and then checks this database against the system on subsequent runs. File properties that can be checked against include inode, permissions, modification time, file contents, etc."

    Monitoring Changes in Table Content:

    Unless there is a tool to perform parsing based on diffs (between two different binary files), it will not be that easy to understand changes related to new fields, and new content.

    Therefore I would propose an hourly (or daily) mysql dump of your data within a git folder (which provides versioning) and preferebly on a secure offsite server.

    Monitoring Addition of Tables

    If you wish to detect the addition of new tables, it will be as simple as monitoring the creation of underlying Database files. For example, the IMAP engine creates 3 different underlying files one of these being MYD.