From c09191a91e9c2326893d4d698eaea256ea6045e8 Mon Sep 17 00:00:00 2001 From: mamutmk5 <3045922+mamutmk5@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:45:32 +0100 Subject: [PATCH 1/2] BC-8328 - license check also on prod nbc off (#1010) --- ansible/host_vars/prod-nbc/cfg.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/host_vars/prod-nbc/cfg.yml b/ansible/host_vars/prod-nbc/cfg.yml index 349a057b5..ae140cc5d 100644 --- a/ansible/host_vars/prod-nbc/cfg.yml +++ b/ansible/host_vars/prod-nbc/cfg.yml @@ -21,6 +21,5 @@ SCHULCONNEX_CLIENT__API_URL: "https://api-dienste.moin.schule/v1" SCHULCONNEX_CLIENT__TOKEN_ENDPOINT: "https://auth.moin.schule/realms/moins/protocol/openid-connect/token" PROVISIONING_SCHULCONNEX_POLICIES_INFO_URL: "https://api-dienste.moin.schule/v1/policies-info" -FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED: "true" FEATURE_PREFERRED_CTL_TOOLS_ENABLED: "false" From 2dd9ccb458b32bc1a84a6ce17429601c2c877198 Mon Sep 17 00:00:00 2001 From: Phillip Date: Wed, 30 Oct 2024 19:51:43 +0100 Subject: [PATCH 2/2] BC-8339 last seven days security check on files (#1011) --- .../templates/values.yml.j2 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/ansible/roles/mongodb_query_exporter/templates/values.yml.j2 b/ansible/roles/mongodb_query_exporter/templates/values.yml.j2 index ad8ba98e0..b47c47791 100644 --- a/ansible/roles/mongodb_query_exporter/templates/values.yml.j2 +++ b/ansible/roles/mongodb_query_exporter/templates/values.yml.j2 @@ -926,3 +926,44 @@ aggregations: } } ] + + + - database: {{ mongodb_query_exporter_mongodb_sc_db_name }} + collection: files + metrics: + - name: sc_files_security_check_last_seven_days + type: gauge + help: 'Legacy files scan results in the last 7 days' + value: total + overrideEmpty: true + emptyValue: 0 + labels: [status] + constLabels: {} + mode: pull + pipeline: | + [ + { "$match": { "isDirectory": false, "securityCheck": { "$exists": true } } }, + { + "$match": { + "$expr": { + "$gte": [ + "$createdAt", + { "$subtract": ["$$NOW", 604800000] } + ] + } + } + }, + { + "$group": { + "_id": "$securityCheck.status", + "total": { "$sum": 1 } + } + }, + { + "$project": { + "_id": 0, + "status": "$_id", + "total": "$total" + } + } + ]