# Get netsettings.
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
-my $idsusedrulefilesfile = "$IDS::settingsdir/ids-used-rulefiles.conf";
+my $idsusedrulefilesfile = "$IDS::settingsdir/suricata-used-rulefiles.yaml";
my $errormessage;
&Header::showhttpheaders();
next if ($line =~ /^\s*$/);
# Gather rule sid and message from the ruleline.
- if ($line =~ /.*include \$RULE_PATH\/(.*)/) {
+ if ($line =~ /.*- (.*)/) {
my $rulefile = $1;
# Add the rulefile to the %idsrules hash.
# Open file for used rulefiles.
open (FILE, ">$idsusedrulefilesfile") or die "Could not write to $idsusedrulefilesfile. $!\n";
+ # Write yaml header to the file.
+ print FILE "%YAML 1.1\n";
+ print FILE "---\n\n";
+
# Write header to file.
print FILE "#Autogenerated file. Any custom changes will be overwritten!\n";
if (@enabled_rulefiles) {
# Loop through the array of rulefiles which should be loaded and write the to the file.
foreach my $file (@enabled_rulefiles) {
- print FILE "include \$RULE_PATH/$file\n";
+ print FILE " - $file\n";
}
}