-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial suricata templates * install suricata-update service * added suricata configuration Co-authored-by: Stefan Majer <[email protected]>
- Loading branch information
Showing
14 changed files
with
2,041 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package netconf | ||
|
||
import ( | ||
"github.com/metal-stack/metal-networker/pkg/net" | ||
) | ||
|
||
// TplSuricataConfig is the name of the template for the suricata configuration. | ||
const TplSuricataConfig = "suricata_config.yaml.tpl" | ||
|
||
// SuricataConfigData represents the information required to render suricata configuration. | ||
type SuricataConfigData struct { | ||
Comment string | ||
DefaultRouteVrf string | ||
} | ||
|
||
// SuricataConfigValidator can validate configuration for suricata. | ||
type SuricataConfigValidator struct { | ||
path string | ||
} | ||
|
||
// NewSuricataConfigApplier constructs a new instance of this type. | ||
func NewSuricataConfigApplier(kb KnowledgeBase, tmpFile string) (net.Applier, error) { | ||
defaultRouteVrf, err := getDefaultRouteVRFName(kb) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
data := SuricataUpdateData{Comment: versionHeader(kb.Machineuuid), DefaultRouteVrf: defaultRouteVrf} | ||
validator := SuricataConfigValidator{tmpFile} | ||
|
||
return net.NewNetworkApplier(data, validator, nil), nil | ||
} | ||
|
||
// Validate validates suricata configuration. | ||
func (v SuricataConfigValidator) Validate() error { | ||
return nil | ||
} |
Oops, something went wrong.