diff --git a/api/djangormm/agents/migrations/0009_agent_antivirus.py b/api/djangormm/agents/migrations/0009_agent_antivirus.py new file mode 100644 index 00000000..7b4e657b --- /dev/null +++ b/api/djangormm/agents/migrations/0009_agent_antivirus.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-11-18 00:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('agents', '0008_agent_version'), + ] + + operations = [ + migrations.AddField( + model_name='agent', + name='antivirus', + field=models.CharField(default='n/a', max_length=255), + ), + ] diff --git a/api/djangormm/agents/models.py b/api/djangormm/agents/models.py index 1fa2cccb..918e2b82 100644 --- a/api/djangormm/agents/models.py +++ b/api/djangormm/agents/models.py @@ -31,6 +31,7 @@ class Agent(models.Model): logged_in_username = models.CharField(null=True, max_length=200) cpu_info = JSONField(null=True) client = models.CharField(max_length=200) + antivirus = models.CharField(default="n/a", max_length=255) site = models.CharField(max_length=150) monitoring_type = models.CharField(max_length=30) description = models.CharField(null=True, max_length=255) diff --git a/api/djangormm/api/views.py b/api/djangormm/api/views.py index 244b73c1..4bad0792 100644 --- a/api/djangormm/api/views.py +++ b/api/djangormm/api/views.py @@ -276,6 +276,7 @@ def update(request): plat = data["platform"] plat_release = data["platform_release"] version = data["version"] + av = data["av"] agent = get_object_or_404(Agent, agent_id=agent_id) @@ -286,6 +287,7 @@ def update(request): agent.plat = plat agent.plat_release = plat_release agent.version = version + agent.antivirus = av agent.save(update_fields=[ "last_seen", @@ -296,6 +298,7 @@ def update(request): "plat", "plat_release", "version", + "antivirus", ]) sync_salt_modules_task.delay(agent.pk)