Skip to content

Commit eb5967b

Browse files
committed
feat: add virustotal-scan-url
1 parent 3581c53 commit eb5967b

File tree

16 files changed

+3051
-0
lines changed

16 files changed

+3051
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77

88
## [Unreleased]
99

10+
### Added ("feat")
11+
12+
Monitoring Plugins:
13+
14+
* virustotal-scan-url: analyses URLs to detect malware and other breaches using VirusTotal
15+
16+
1017
### Fixed ("fix")
1118

1219
Assets:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ See some of our check plugins at a glance on an Icinga server:
197197
<img alt="uptime" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/uptime.png" width="30%"/> &nbsp;
198198
<img alt="uptimerobot" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/uptimerobot.png" width="30%"/> &nbsp;
199199
<img alt="users" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/users.png" width="30%"/> &nbsp;
200+
<img alt="virustotal-scan-url" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/virustotal-scan-url.png" width="30%"/> &nbsp;
200201
<img alt="whmcs-status" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/whmcs-status.png" width="30%"/> &nbsp;
201202
<img alt="wildfly-deployment-status" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/wildfly-deployment-status.png" width="30%"/> &nbsp;
202203
<img alt="wildfly-gc-status" src="https://download.linuxfabrik.ch/monitoring-plugins/assets/screenshots/wildfly-gc-status.png" width="30%"/> &nbsp;

assets/icingaweb2-module-director/all-the-rest.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,12 @@
15631563
"entry_value": "Veeam Backup & Replication (Windows)",
15641564
"format": "string"
15651565
},
1566+
{
1567+
"allowed_roles": null,
1568+
"entry_name": "virustotal",
1569+
"entry_value": "VirusTotal",
1570+
"format": "string"
1571+
},
15661572
{
15671573
"allowed_roles": null,
15681574
"entry_name": "vsftpd",
@@ -43152,6 +43158,58 @@
4315243158
},
4315343159
"uuid": "4e41e4c7-81be-453b-a932-c66e301b3eff"
4315443160
},
43161+
"VirusTotal Service Set": {
43162+
"assign_filter": "\"virustotal-scan-url\"=host.vars.tags",
43163+
"description": null,
43164+
"object_name": "VirusTotal Service Set",
43165+
"object_type": "template",
43166+
"services": {
43167+
"VirusTotal Scan URL": {
43168+
"action_url": null,
43169+
"apply_for": null,
43170+
"assign_filter": null,
43171+
"check_command": null,
43172+
"check_interval": null,
43173+
"check_period": null,
43174+
"check_timeout": null,
43175+
"command_endpoint": null,
43176+
"disabled": false,
43177+
"display_name": null,
43178+
"enable_active_checks": null,
43179+
"enable_event_handler": null,
43180+
"enable_flapping": null,
43181+
"enable_notifications": null,
43182+
"enable_passive_checks": null,
43183+
"enable_perfdata": null,
43184+
"event_command": null,
43185+
"fields": [],
43186+
"flapping_threshold_high": null,
43187+
"flapping_threshold_low": null,
43188+
"groups": [],
43189+
"host": null,
43190+
"icon_image": null,
43191+
"icon_image_alt": null,
43192+
"imports": [
43193+
"tpl-service-virustotal-scan-url"
43194+
],
43195+
"max_check_attempts": null,
43196+
"notes": null,
43197+
"notes_url": null,
43198+
"object_name": "VirusTotal Scan URL",
43199+
"object_type": "object",
43200+
"retry_interval": null,
43201+
"service_set": null,
43202+
"template_choice": null,
43203+
"use_agent": null,
43204+
"use_var_overrides": null,
43205+
"uuid": "f86f2dc8-968d-4161-86c9-a72e84ea58fa",
43206+
"vars": {},
43207+
"volatile": null,
43208+
"zone": null
43209+
}
43210+
},
43211+
"uuid": "93934306-2b58-4c35-a128-9fc12ad0e2e6"
43212+
},
4315543213
"vsftpd Service Set": {
4315643214
"assign_filter": "\"vsftpd\"=host.vars.tags",
4315743215
"description": null,
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Check virustotal-scan-url
2+
3+
## Overview
4+
5+
Analyses URLs to detect malware and other breaches using [VirusTotal](https://www.virustotal.com/).
6+
7+
Hints:
8+
9+
* In order to use this plugin, you will need to create a VirusTotal account.
10+
* This plugin uses the [VirusTotal API v3](https://docs.virustotal.com/reference/overview). See the [documentation](https://docs.virustotal.com/reference/public-vs-premium-api) on any constraints and restrictions, especially for commercial use.
11+
12+
13+
## Fact Sheet
14+
15+
| Fact | Value |
16+
|----|----|
17+
| Check Plugin Download | <https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/virustotal-scan-url> |
18+
| Check Interval Recommendation | Once an hour |
19+
| Can be called without parameters | No |
20+
| Requirements | VirusTotal account, VirusTotal API key and Premium API if this plugin is used in business workflows that do not contribute new files or in commercial products/services. |
21+
22+
23+
## Help
24+
25+
```text
26+
usage: virustotal-scan-url [-h] [-V] [--always-ok] [--insecure] [--no-proxy]
27+
[--severity {warn,crit}] [--test TEST]
28+
[--timeout TIMEOUT] --token TOKEN --url URL
29+
30+
Analyses URLs to detect malware and other breaches using VirusTotal.
31+
32+
options:
33+
-h, --help show this help message and exit
34+
-V, --version show program's version number and exit
35+
--always-ok Always returns OK.
36+
--insecure This option explicitly allows to perform "insecure"
37+
SSL connections. Default: False
38+
--no-proxy Do not use a proxy. Default: False
39+
--severity {warn,crit}
40+
Severity for alerting. Default: warn
41+
--test TEST For unit tests. Needs "path-to-stdout-file,path-to-
42+
stderr-file,expected-retc".
43+
--timeout TIMEOUT Network timeout in seconds. Default: 8 (seconds)
44+
--token TOKEN VirusTotal API token
45+
--url URL URL to scan.
46+
```
47+
48+
49+
## Usage Examples
50+
51+
```bash
52+
./virustotal-scan-url --token b480bd43 --url https://secure.eicar.org/eicar.com
53+
```
54+
55+
Output:
56+
57+
```text
58+
9/97 security vendors flagged https://secure.eicar.org/eicar.com as malicious.
59+
60+
Engine ! Result ! Method ! Category
61+
------------+------------+-----------+--------------------
62+
Antiy-AVL ! malicious ! blacklist ! malicious [WARNING]
63+
AutoShun ! malicious ! blacklist ! malicious [WARNING]
64+
BitDefender ! malware ! blacklist ! malicious [WARNING]
65+
CRDF ! malicious ! blacklist ! malicious [WARNING]
66+
Fortinet ! malware ! blacklist ! malicious [WARNING]
67+
G-Data ! malware ! blacklist ! malicious [WARNING]
68+
Lionic ! malware ! blacklist ! malicious [WARNING]
69+
Sophos ! malware ! blacklist ! malicious [WARNING]
70+
URLQuery ! suspicious ! blacklist ! suspicious
71+
VIPRE ! malware ! blacklist ! malicious [WARNING]
72+
```
73+
74+
75+
## States
76+
77+
* Alerts according to the given severity level (default: WARN due to the many false positives on VT) if the scanner's result falls into the "malicious" category.
78+
79+
80+
## Perfdata / Metrics
81+
82+
According to <https://docs.virustotal.com/reference/analyses-object>:
83+
84+
| Name | Type | Description |
85+
|----|----|----|
86+
| harmless | Number | Number of reports saying that is harmless. |
87+
| malicious | Number | Number of reports saying that is malicious. |
88+
| suspicious | Number | Number of reports saying that is suspicious. |
89+
| timeout | Number | Number of timeouts when analysing this URL. |
90+
| undetected | Number | Number of reports saying that is undetected. |
91+
| vendors | Number | Number of scan vendors used. |
92+
93+
94+
## Credits, License
95+
96+
* Authors: [Linuxfabrik GmbH, Zurich](https://www.linuxfabrik.ch)
97+
* License: The Unlicense, see [LICENSE file](https://unlicense.org/).
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
apiVersion: grizzly.grafana.com/v1alpha1
2+
kind: Dashboard
3+
metadata:
4+
folder: linuxfabrik-monitoring-plugins
5+
name: example
6+
spec:
7+
schemaVersion: 2024101801
8+
tags:
9+
- Linuxfabrik
10+
- Grizzly
11+
- static
12+
time:
13+
from: now-90d
14+
to: now
15+
timepicker:
16+
hidden: false
17+
refresh_intervals:
18+
- 1m
19+
timezone: browser
20+
title: Example
21+
uid: linuxfabrik-monitoring-plugins-example
22+
editable: true
23+
liveNow: true
24+
refresh: 1m
25+
templating:
26+
list:
27+
- label: Command
28+
name: command
29+
query: SHOW MEASUREMENTS WITH MEASUREMENT =~ /.*example.*/
30+
current:
31+
text: cmd-check-example
32+
value: cmd-check-example
33+
refresh: 1
34+
sort: 1
35+
type: query
36+
- label: Hostname
37+
name: hostname
38+
query: SHOW TAG VALUES FROM "$command" WITH KEY = "hostname"
39+
refresh: 1
40+
sort: 1
41+
type: query
42+
- label: Service
43+
name: service
44+
query: SHOW TAG VALUES FROM "$command" WITH KEY = "service" WHERE hostname = '$hostname'
45+
refresh: 1
46+
sort: 1
47+
type: query
48+
49+
panels:
50+
51+
- title: Example - Percentages
52+
type: timeseries
53+
gridPos:
54+
h: 8
55+
w: 12
56+
x: 0
57+
y: 0
58+
fieldConfig:
59+
defaults:
60+
color:
61+
mode: palette-classic
62+
custom:
63+
lineInterpolation: smooth
64+
spanNulls: true
65+
decimals: 0
66+
max: 110
67+
min: 0
68+
unit: percent
69+
overrides:
70+
- __systemRef: hideSeriesFrom
71+
matcher:
72+
id: byNames
73+
options:
74+
mode: exclude
75+
names:
76+
- example
77+
prefix: 'All except:'
78+
properties:
79+
- id: custom.hideFrom
80+
value:
81+
viz: true
82+
options:
83+
legend:
84+
calcs:
85+
- first
86+
- min
87+
- mean
88+
- max
89+
- last
90+
displayMode: table
91+
placement: bottom
92+
showLegend: true
93+
tooltip:
94+
mode: multi
95+
sort: none
96+
97+
targets:
98+
99+
- alias: example
100+
refId: example
101+
groupBy:
102+
- params:
103+
- $interval
104+
type: time
105+
measurement: $command
106+
resultFormat: time_series
107+
select:
108+
- - params:
109+
- value
110+
type: field
111+
- params: []
112+
type: mean
113+
tags:
114+
- key: hostname
115+
operator: '='
116+
value: $hostname
117+
- condition: AND
118+
key: service
119+
operator: '='
120+
value: $service
121+
- condition: AND
122+
key: metric
123+
operator: '='
124+
value: example
125+
126+
- title: Example - Absolute Values
127+
type: timeseries
128+
gridPos:
129+
h: 8
130+
w: 12
131+
x: 12
132+
y: 0
133+
fieldConfig:
134+
defaults:
135+
color:
136+
mode: palette-classic
137+
custom:
138+
lineInterpolation: smooth
139+
spanNulls: true
140+
decimals: 0
141+
min: 0
142+
unit: short
143+
options:
144+
legend:
145+
calcs:
146+
- first
147+
- min
148+
- mean
149+
- max
150+
- last
151+
displayMode: table
152+
placement: bottom
153+
showLegend: true
154+
tooltip:
155+
mode: multi
156+
sort: none
157+
158+
targets:
159+
160+
- alias: example
161+
refId: example
162+
groupBy:
163+
- params:
164+
- $interval
165+
type: time
166+
measurement: $command
167+
resultFormat: time_series
168+
select:
169+
- - params:
170+
- value
171+
type: field
172+
- params: []
173+
type: mean
174+
- params: []
175+
type: non_negative_difference # use to convert continues counters to absolute values
176+
tags:
177+
- key: hostname
178+
operator: '='
179+
value: $hostname
180+
- condition: AND
181+
key: service
182+
operator: '='
183+
value: $service
184+
- condition: AND
185+
key: metric
186+
operator: '='
187+
value: example

0 commit comments

Comments
 (0)