]> git.ipfire.org Git - dbl.git/commitdiff
exporters: Configure allocated SIDs
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 13 Mar 2026 11:48:09 +0000 (11:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 13 Mar 2026 11:48:09 +0000 (11:48 +0000)
  https://github.com/sidallocation/sidallocation.org/issues/37
  https://github.com/sidallocation/sidallocation.org/commit/0e1c905f5e8eb8cc0d68aa91cc03783077c44efa

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/exporters.py

index c5f7bb48d0002767401aa93872fc0b48e446883d..84e5bcbafe2b70f7206973d4e5141091c87388ac 100644 (file)
@@ -430,11 +430,11 @@ class SuricataRulesExporter(TextExporter):
                # Write the header
                self.write_header(f)
 
-               # Our SID range is 406000000 - 406999999, because of HTTP Status 406 - Not Acceptable
-               sid = 406000000
+               # Our SID range is 12000000 - 12999999, because of HTTP Status 406 - Not Acceptable
+               sid = 12000000
 
-               # Shift the ID of the list to the higher 16 bits and append the offset
-               sid |= self.list.id << 16
+               # Shift the ID of the list
+               sid += self.list.id * 100
 
                # Map the priority
                # High Priority
@@ -464,7 +464,7 @@ class SuricataRulesExporter(TextExporter):
                                ),
                                "classtype" : "policy-violation",
                                "priority"  : priority,
-                               "sid"       : sid | 1,
+                               "sid"       : sid + 1,
                                "rev"       : "1",
                                "reference" : (
                                        "url",
@@ -488,7 +488,7 @@ class SuricataRulesExporter(TextExporter):
                                ),
                                "classtype" : "policy-violation",
                                "priority"  : priority,
-                               "sid"       : sid | 2,
+                               "sid"       : sid + 2,
                                "rev"       : "1",
                                "reference" : (
                                        "url",
@@ -512,7 +512,7 @@ class SuricataRulesExporter(TextExporter):
                                ),
                                "classtype" : "policy-violation",
                                "priority"  : priority,
-                               "sid"       : sid | 3,
+                               "sid"       : sid + 3,
                                "rev"       : "1",
                                "reference" : (
                                        "url",
@@ -536,7 +536,7 @@ class SuricataRulesExporter(TextExporter):
                                ),
                                "classtype" : "policy-violation",
                                "priority"  : priority,
-                               "sid"       : sid | 4,
+                               "sid"       : sid + 4,
                                "rev"       : "1",
                                "reference" : (
                                        "url",