You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (_config.AddExtendedDnsError && request.EDNS is not null)
131
155
{
132
-
options = new EDnsOption[] { new EDnsOption(EDnsOptionCode.EXTENDED_DNS_ERROR, new EDnsExtendedDnsErrorOptionData(EDnsExtendedDnsErrorCode.Blocked, blockingReport)) };
156
+
options = new EDnsOption[] { new EDnsOption(EDnsOptionCode.EXTENDED_DNS_ERROR, new EDnsExtendedDnsErrorOptionData(EDnsExtendedDnsErrorCode.Blocked, string.Empty)) };
133
157
}
134
158
135
159
if (_config.AllowTxtBlockingReport && question.Type == DnsResourceRecordType.TXT)
136
160
{
137
-
DnsResourceRecord[] answer = new DnsResourceRecord[] { new DnsResourceRecord(question.Name, DnsResourceRecordType.TXT, question.Class, 60, new DnsTXTRecordData(blockingReport)) };
161
+
DnsResourceRecord[] answer = new DnsResourceRecord[] { new DnsResourceRecord(question.Name, DnsResourceRecordType.TXT, question.Class, 60, new DnsTXTRecordData(string.Empty)) };
138
162
return Task.FromResult(new DnsDatagram(
139
163
ID: request.Identifier,
140
164
isResponse: true,
@@ -156,7 +180,7 @@ public Task<DnsDatagram> ProcessRequestAsync(DnsDatagram request, IPEndPoint rem
throw new HttpRequestException($"MISP API returned a non-success status code: {(int)response.StatusCode}. Body: {errorBody}", null, response.StatusCode);
341
364
}
342
365
343
-
await using Stream responseStream = await response.Content.ReadAsStreamAsync();
A plugin that pulls malicious domain names and IP addresses from MISP feeds and enforces blocking in Technitium DNS.
4
+
5
+
It maintains in-memory blocklists with disk-backed caching and periodically refreshes from the source.
6
+
7
+
## Features
8
+
9
+
- Retrieves indicators of compromise (IOCs) aka. malicious domain names and, optionally, IP source/destination addresses from a MISP server via its REST API.
10
+
- Handles paginated fetches with exponential backoff and retry on transient failures.
11
+
- Stores the latest blocklist in memory for fast lookup and persists it to disk for faster startup.
12
+
- Blocks matching DNS requests by returning NXDOMAIN or, for TXT queries when enabled, a human-readable blocking report.
13
+
- Optionally includes extended DNS error metadata.
14
+
- Configurable refresh interval and age window for which indicators are considered.
15
+
- Optional disabling of TLS certificate validation with explicit warning in logs.
16
+
17
+
## Configuration
18
+
19
+
Supply a JSON configuration like the following:
20
+
21
+
```json
22
+
{
23
+
"enableBlocking": true,
24
+
"mispServerUrl": "https://misp.example.com",
25
+
"mispApiKey": "YourMispApiKeyHere",
26
+
"disableTlsValidation": false,
27
+
"updateInterval": "2h",
28
+
"maxIocAge": "15d",
29
+
"allowTxtBlockingReport": true,
30
+
"paginationLimit": 5000,
31
+
"addExtendedDnsError": true,
32
+
"enableIpAddressBlocking": false
33
+
}
34
+
```
35
+
36
+
- You can disable the app without uninstalling.
37
+
- You can disable TLS validation for test instances and homelabs, but **it is not recommended use this option in production**.
38
+
- The `maxIocAge` option is used for filtering IOCs wih `lastSeen` attributes on MISP. So, you can dynamically filter for recent campaigns.
39
+
- The `allowTxtBlockingReport` rewrites the response with a blocking report.
40
+
- The `addExtendedDnsError` is useful when logs are exported to a SIEM. The blocking report gets added to EDNS payload of the package.
41
+
- The `enableIpAddressBlocking` flag enables blocking results based on the resolved IP address of `A` and `AAAA` records. It may cause performance impact. **Use with caution**.
42
+
43
+
# Thanks
44
+
45
+
Thanks to everyone who has been part of or contributed to [MISP Project](https://www.misp-project.org/) for being an amazing resource.
0 commit comments