mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-10-23 00:12:22 +00:00
feat: add proxy protocol configuration setting
This change adds a configuration option to enable Proxy Protocol (not yet implemented). Planned for TCP and SSH honeypot types. Use `<useProxyProtocol>true</useProxyProtocol>` in the XML config.
This commit is contained in:
@@ -104,6 +104,7 @@ type Server struct {
|
||||
Headers []string `xml:"headers>header"`
|
||||
Prompts []Prompt `xml:"prompts>prompt"`
|
||||
SendToThreatFeed bool `xml:"sendToThreatFeed"`
|
||||
UseProxyProtocol bool `xml:"useProxyProtocol"`
|
||||
Rules Rules `xml:"rules"`
|
||||
SourceIPHeader string `xml:"sourceIpHeader"`
|
||||
LogPath string `xml:"logPath"`
|
||||
@@ -257,9 +258,15 @@ func (c *Config) InitializeLoggers() error {
|
||||
io.MultiWriter(file, c.Monitor),
|
||||
&slog.HandlerOptions{
|
||||
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
|
||||
// Remove 'message' and 'log level' fields from output.
|
||||
if a.Key == slog.MessageKey || a.Key == slog.LevelKey {
|
||||
switch a.Key {
|
||||
case slog.MessageKey, slog.LevelKey:
|
||||
// Remove default 'message' and 'log level' fields.
|
||||
return slog.Attr{}
|
||||
case "source_ip_error":
|
||||
// Remove 'source_ip_error' field if it's empty.
|
||||
if len(a.Value.String()) == 0 {
|
||||
return slog.Attr{}
|
||||
}
|
||||
}
|
||||
return a
|
||||
},
|
||||
|
Reference in New Issue
Block a user