diff --git a/docs/installation/docker-compose.md b/docs/installation/docker-compose.md index 167209401..03f402438 100644 --- a/docs/installation/docker-compose.md +++ b/docs/installation/docker-compose.md @@ -4,8 +4,8 @@ This installation method is for test-setups and small-scale productive setups. ## Prerequisites -- docker -- docker-compose +- docker +- docker-compose ## Install diff --git a/docs/upgrading/to-0.12.md b/docs/upgrading/to-0.12.md index 9243fc03c..8c2407de8 100644 --- a/docs/upgrading/to-0.12.md +++ b/docs/upgrading/to-0.12.md @@ -6,6 +6,7 @@ This update brings these headline features: - Add Kubernetes Integration for Outposts, which deploys and maintains Outposts with High Availability in a Kubernetes Cluster - Add System Task Overview to see all background tasks, their status, the log output, and retry them - Alerts now disappear automatically +- Audit Logs are now searchable Fixes: diff --git a/passbook/audit/migrations/0006_auto_20201017_2024.py b/passbook/audit/migrations/0006_auto_20201017_2024.py new file mode 100644 index 000000000..89a0fdc5b --- /dev/null +++ b/passbook/audit/migrations/0006_auto_20201017_2024.py @@ -0,0 +1,42 @@ +# Generated by Django 3.1.2 on 2020-10-17 20:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("passbook_audit", "0005_auto_20201005_2139"), + ] + + operations = [ + migrations.RemoveField( + model_name="event", + name="date", + ), + migrations.AlterField( + model_name="event", + name="action", + field=models.TextField( + choices=[ + ("login", "Login"), + ("login_failed", "Login Failed"), + ("logout", "Logout"), + ("user_write", "User Write"), + ("suspicious_request", "Suspicious Request"), + ("password_set", "Password Set"), + ("token_view", "Token View"), + ("invitation_created", "Invite Created"), + ("invitation_used", "Invite Used"), + ("authorize_application", "Authorize Application"), + ("source_linked", "Source Linked"), + ("impersonation_started", "Impersonation Started"), + ("impersonation_ended", "Impersonation Ended"), + ("model_created", "Model Created"), + ("model_updated", "Model Updated"), + ("model_deleted", "Model Deleted"), + ("custom_", "Custom Prefix"), + ] + ), + ), + ] diff --git a/passbook/audit/models.py b/passbook/audit/models.py index a6b37a648..c589a5349 100644 --- a/passbook/audit/models.py +++ b/passbook/audit/models.py @@ -100,6 +100,8 @@ class EventAction(models.TextChoices): SUSPICIOUS_REQUEST = "suspicious_request" PASSWORD_SET = "password_set" # noqa # nosec + TOKEN_VIEW = "token_view" + INVITE_CREATED = "invitation_created" INVITE_USED = "invitation_used" @@ -122,7 +124,6 @@ class Event(models.Model): event_uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4) user = models.JSONField(default=dict) action = models.TextField(choices=EventAction.choices) - date = models.DateTimeField(auto_now_add=True) app = models.TextField() context = models.JSONField(default=dict, blank=True) client_ip = models.GenericIPAddressField(null=True) diff --git a/passbook/audit/templates/audit/list.html b/passbook/audit/templates/audit/list.html index 214ab744e..744f4d815 100644 --- a/passbook/audit/templates/audit/list.html +++ b/passbook/audit/templates/audit/list.html @@ -17,6 +17,7 @@