Add basic auditing for filesystem actions

Specifically skipping read actions since there isn't much to say there, and it generally wouldn't be very helpful (plus, likely to generate lots of logs).
This commit is contained in:
Dane Everitt 2021-01-17 11:46:08 -08:00
parent b15679d3bb
commit ccecaa6694
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 164 additions and 64 deletions

View file

@ -1,8 +1,8 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAuditLogsTable extends Migration
{
@ -15,7 +15,14 @@ class CreateAuditLogsTable extends Migration
{
Schema::create('audit_logs', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->char('uuid', 36);
$table->boolean('is_system')->default(false);
$table->bigInteger('user_id')->nullable();
$table->bigInteger('server_id')->nullable();
$table->string('action');
$table->json('device');
$table->json('metadata');
$table->timestamp('created_at', 0);
});
}