mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-10-23 08:22:21 +00:00
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:
@@ -13,7 +13,6 @@
|
||||
<databasePath>/opt/deceptifeed/logs/threatfeed.csv</databasePath>
|
||||
<threatExpiryHours>336</threatExpiryHours>
|
||||
<includePrivateIPs>false</includePrivateIPs>
|
||||
<customThreatsPath></customThreatsPath>
|
||||
<excludeListPath></excludeListPath>
|
||||
</threatFeed>
|
||||
|
||||
|
@@ -13,7 +13,6 @@
|
||||
<databasePath>threatfeed.csv</databasePath>
|
||||
<threatExpiryHours>336</threatExpiryHours>
|
||||
<includePrivateIPs>false</includePrivateIPs>
|
||||
<customThreatsPath></customThreatsPath>
|
||||
<excludeListPath></excludeListPath>
|
||||
</threatFeed>
|
||||
|
||||
|
@@ -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"`
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user