Remove feature for custom threat file

This change removes the `CustomThreatsPath` setting from the threat feed configuration. The default configuration files are updated with this setting removed.
This commit is contained in:
Ryan Smith
2025-03-26 18:23:37 -07:00
parent 7bad11a4a7
commit 4fd048c287
4 changed files with 0 additions and 18 deletions

View File

@@ -13,7 +13,6 @@
<databasePath>/opt/deceptifeed/logs/threatfeed.csv</databasePath>
<threatExpiryHours>336</threatExpiryHours>
<includePrivateIPs>false</includePrivateIPs>
<customThreatsPath></customThreatsPath>
<excludeListPath></excludeListPath>
</threatFeed>

View File

@@ -13,7 +13,6 @@
<databasePath>threatfeed.csv</databasePath>
<threatExpiryHours>336</threatExpiryHours>
<includePrivateIPs>false</includePrivateIPs>
<customThreatsPath></customThreatsPath>
<excludeListPath></excludeListPath>
</threatFeed>

View File

@@ -142,7 +142,6 @@ type ThreatFeed struct {
DatabasePath string `xml:"databasePath"`
ExpiryHours int `xml:"threatExpiryHours"`
IsPrivateIncluded bool `xml:"includePrivateIPs"`
CustomThreatsPath string `xml:"customThreatsPath"`
ExcludeListPath string `xml:"excludeListPath"`
}

View File

@@ -40,21 +40,6 @@ func handlePlain(w http.ResponseWriter, r *http.Request) {
return
}
}
// If a custom threat file is supplied in the configuration, append the
// contents of the file to the HTTP response. To allow for flexibility, the
// contents of the file are not parsed or validated.
if len(cfg.ThreatFeed.CustomThreatsPath) > 0 {
data, err := os.ReadFile(cfg.ThreatFeed.CustomThreatsPath)
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to read custom threats file:", err)
return
}
_, err = w.Write(data)
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to serve threat feed:", err)
}
}
}
// handleJSON handles HTTP requests to serve the full threat feed in JSON