diff --git a/auditd/1.0.0/cmodule/main.lua b/auditd/1.0.0/cmodule/main.lua index 13e2d93..9edf9c2 100644 --- a/auditd/1.0.0/cmodule/main.lua +++ b/auditd/1.0.0/cmodule/main.lua @@ -45,9 +45,10 @@ __api.add_cbs{ } while not __api.is_close() do - if os.time() - last_check > check_interval_sec then + local now = os.time() + if now - last_check > check_interval_sec then + last_check = now setup_audit() - last_check = os.time() end __api.await(1000) end diff --git a/auditd/1.0.0/config/config_schema.json b/auditd/1.0.0/config/config_schema.json index 01d441c..0dd731c 100644 --- a/auditd/1.0.0/config/config_schema.json +++ b/auditd/1.0.0/config/config_schema.json @@ -1,6 +1,41 @@ { "additionalProperties": false, - "properties": {}, - "required": [], + "properties": { + "audit_rules": { + "rules": {}, + "type": "string", + "ui": { + "columns": 6, + "widget": "textarea", + "widgetConfig": { + "rows": 8 + } + } + }, + "auditd_conf": { + "rules": {}, + "type": "string", + "ui": { + "columns": 6, + "widget": "textarea", + "widgetConfig": { + "rows": 8 + } + } + }, + "check_interval_sec": { + "rules": {}, + "type": "integer", + "ui": { + "columns": 4, + "widgetConfig": {} + } + } + }, + "required": [ + "audit_rules", + "auditd_conf", + "check_interval_sec" + ], "type": "object" } \ No newline at end of file diff --git a/auditd/1.0.0/config/current_config.json b/auditd/1.0.0/config/current_config.json index 9e26dfe..6abc378 100644 --- a/auditd/1.0.0/config/current_config.json +++ b/auditd/1.0.0/config/current_config.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "audit_rules": "# Managed by SOLDR(auditd)\n-D", + "auditd_conf": "# Managed by SOLDR(auditd)", + "check_interval_sec": 600 +} \ No newline at end of file diff --git a/auditd/1.0.0/config/default_config.json b/auditd/1.0.0/config/default_config.json index 9e26dfe..6abc378 100644 --- a/auditd/1.0.0/config/default_config.json +++ b/auditd/1.0.0/config/default_config.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "audit_rules": "# Managed by SOLDR(auditd)\n-D", + "auditd_conf": "# Managed by SOLDR(auditd)", + "check_interval_sec": 600 +} \ No newline at end of file diff --git a/auditd/1.0.0/config/locale.json b/auditd/1.0.0/config/locale.json index 5e15be3..dacd9ff 100644 --- a/auditd/1.0.0/config/locale.json +++ b/auditd/1.0.0/config/locale.json @@ -9,7 +9,38 @@ "description": "" } }, - "config": {}, + "config": { + "audit_rules": { + "en": { + "title": "Audit rules", + "description": "/etc/audit/audit.rules" + }, + "ru": { + "title": "Правила аудита", + "description": "/etc/audit/audit.rules" + } + }, + "auditd_conf": { + "en": { + "title": "Audit daemon configuration", + "description": "/etc/audit/auditd.conf" + }, + "ru": { + "title": "Конфигурация демона auditd", + "description": "/etc/audit/auditd.conf" + } + }, + "check_interval_sec": { + "en": { + "title": "Check interval, seconds", + "description": "Module is checking audit configuration every given interval of time" + }, + "ru": { + "title": "Интервал проверки, ceкунды", + "description": "Проверять конфигурацию аудита через указанный интервал времени" + } + } + }, "secure_config": {}, "fields": {}, "actions": {},