Giter Site home page Giter Site logo

setbased / php-audit Goto Github PK

View Code? Open in Web Editor NEW
37.0 8.0 8.0 1.4 MB

A tool for creating audit tables and triggers for logging data changes in a MySQL database.

Home Page: https://php-audit.readthedocs.io

License: MIT License

PHP 99.93% Shell 0.07%
audit-tables audit-trail changelog mysql mariadb triggers

php-audit's Introduction

PhpAudit

Social Legal Docs Release Tests Code
Gitter License Documentation Status Latest Stable Version
Build Status
Code Coverage
Scrutinizer Code Quality

PhpAudit is a tool for creating and maintaining audit tables and triggers for creating audit trails of data changes in MySQL databases.

Features

PhpAudit has the following features:

  • Creates audit tables for tables in your database for which auditing is required.
  • Creates triggers on tables for recording inserts, updates, and deletes of rows.
  • Helps you to maintain audit tables and triggers when you modify your application's tables.
  • Reports differences in table structure between your application's tables and audit tables.
  • Disabling triggers under certain conditions.
  • Flexible configuration. You can define additional columns to audit tables, for example: logging user and session IDs.

Using the audit trail you track changes made to the data of your application by the users of the application. Even of data that has been deleted or changed back to its original state. Also, you can track how your application manipulates data and find bugs if your application.

Manual

The manual of PhpAudit is available at Read the Docs.

Contributing

We are looking for contributors. We can use your help for:

  • Fixing bugs and solving issues.
  • Writing documentation.
  • Developing new features.
  • Code review.
  • Implementing PhpAudit for other database systems.

You can contribute to this project in many ways:

  • Fork this project on GitHub and create a pull request.
  • Create an issue on GitHub.
  • Asking critical questions.
  • Contacting us at Gitter.

Support

If you are having issues, please let us know. Contact us at Gitter or create an issue on GitHub.

For commercial support, please contact us at [email protected].

License

The project is licensed under the MIT license.

php-audit's People

Contributors

dmitriynagorniy avatar gitter-badger avatar prwater avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-audit's Issues

Not compatible with PHP 8.1

Hi,
On Ubuntu 22.04, PHP 8.1, running the audit script produces a fatal error. If someone can suggest a fix, I would be grateful.

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught SetBased\Exception\ErrorException: Return type of Noodlehaus\AbstractConfig::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cp/vendor/hassankhan/config/src/AbstractConfig.php:184
Stack trace:
#0 /var/www/cp/vendor/hassankhan/config/src/AbstractConfig.php(17): SetBased\ErrorHandler\ErrorHandler->handleError()
#1 /var/www/cp/vendor/composer/ClassLoader.php(571): include('...')
#2 /var/www/cp/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /var/www/cp/vendor/hassankhan/config/src/Config.php(22): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/cp/vendor/composer/ClassLoader.php(571): include('...')
#5 /var/www/cp/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#6 /var/www/cp/vendor/setbased/php-audit/src/Command/BaseCommand.php(61): Composer\Autoload\ClassLoader->loadClass()
#7 /var/www/cp/vendor/setbased/php-audit/src/Command/AuditCommand.php(42): SetBased\Audit\Command\BaseCommand->readConfigFile()
#8 /var/www/cp/vendor/symfony/console/Command/Command.php(298): SetBased\Audit\Command\AuditCommand->execute()
#9 /var/www/cp/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#10 /var/www/cp/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/cp/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#12 /var/www/cp/vendor/setbased/php-audit/bin/audit(28): Symfony\Component\Console\Application->run()
#13 /var/www/cp/vendor/bin/audit(117): include('...')
#14 {main} in /var/www/cp/vendor/hassankhan/config/src/AbstractConfig.php on line 17

No manual?

Any manual or docs on usage, e.g. what the config file is expected to include?

PHP 8.1 dependencies not fulfillable

Hi!
When trying to use composer, I cannot seem to fulfil the required dependencies:

Your requirements could not be resolved to an installable set of packages.


  Problem 1
    - setbased/php-audit 1.9.0 requires symfony/console ^6.2.5 -> satisfiable by symfony/console[v6.2.5, ..., v6.3.4].
    - setbased/php-audit[1.8.0, ..., 1.8.2] require symfony/console ^5.4.16 || ^6.2.2 -> satisfiable by symfony/console[v5.4.16, ..., v5.4.28, v6.2.2, ..., v6.3.4].
    - setbased/php-audit[1.7.0, ..., 1.7.1] require symfony/console ^5.3.7 -> satisfiable by symfony/console[v5.3.7, ..., v5.4.28].
    - setbased/php-audit[1.6.0, ..., 1.6.1] require symfony/console ^5.0 -> satisfiable by symfony/console[v5.0.0, ..., v5.4.28].
    - setbased/php-audit[1.5.0, ..., 1.5.2] require setbased/php-stratum-mysql ^5.0 -> satisfiable by setbased/php-stratum-mysql[5.0.0, ..., 5.1.1].
    - setbased/php-audit 1.4.0 requires setbased/php-stratum-mysql ^4.0 -> satisfiable by setbased/php-stratum-mysql[4.0.0, ..., 4.4.1].
    - setbased/php-audit[1.0.0, ..., 1.3.0] require setbased/php-stratum-mysql ^4.0.0 -> satisfiable by setbased/php-stratum-mysql[4.0.0, ..., 4.4.1].
    - symfony/console[v6.2.2, ..., v6.3.4] conflict with symfony/process <5.4.
    - symfony/console[v5.0.9, ..., v5.4.28] conflict with symfony/process <4.4.
    - setbased/php-stratum-mysql[4.4.0, ..., 4.4.1, 5.0.0, ..., 5.1.1] require zendframework/zend-code ^3.0 -> satisfiable by zendframework/zend-code[3.0.0, ..., 3.4.1].
    - setbased/php-stratum-mysql[4.0.0, ..., 4.3.0] require zendframework/zend-code ^3.0.0 -> satisfiable by zendframework/zend-code[3.0.0, ..., 3.4.1].
    - robbiep/zbar-qrdecoder 2.0.2 requires symfony/process ^3.0 -> satisfiable by symfony/process[v3.4.47].
    - setbased/php-audit[0.9.6, ..., 0.9.8] require setbased/php-stratum ^0.9.64 -> found setbased/php-stratum[dev-master, 4.0.0, 4.0.1, 5.0.0, ..., 5.4.0, 6.0.0, ..., 6.3.1] but it does not match the constraint.
    - setbased/php-audit 0.9.9 requires setbased/php-affirm ^0.2.0 -> could not be found in any version, there may be a typo in the package name.
    - zendframework/zend-code[3.0.0, ..., 3.0.1] require php ^5.5 || ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
    - zendframework/zend-code[3.0.2, ..., 3.0.5] require php ^5.5 || 7.0.0 - 7.0.4 || ^7.0.6 -> your php version (8.1.2) does not satisfy that requirement.
    - zendframework/zend-code 3.1.0 requires php ^5.6 || 7.0.0 - 7.0.4 || ^7.0.6 -> your php version (8.1.2) does not satisfy that requirement.
    - zendframework/zend-code[3.2.0, ..., 3.4.1] require php ^7.1 -> your php version (8.1.2) does not satisfy that requirement.
    - symfony/console[v5.0.0, ..., v5.0.8] require php ^7.2.5 -> your php version (8.1.2) does not satisfy that requirement.
    - robbiep/zbar-qrdecoder is locked to version 2.0.2 and an update of this package was not requested.
    - Root composer.json requires setbased/php-audit * -> satisfiable by setbased/php-audit[0.9.6, 0.9.7, 0.9.8, 0.9.9, 1.0.0, ..., 1.9.0].


Documentation

Could you write some documentation/example ?
Thanks !

Audit_usr_id and Session

I have set the variable '@abc_g_usr_id' at the time of user logon in my php application. I tried the static variable in audit.json file in additional sql column like the below
"set @'abc_g_usr_id' = 4;"
and it has been reflected in db table properly. Now, I got stuck in setting up the variable in login page. Can you help me out how can we use the variable for auditing End user and Session. I read the document but unable to find the solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.