Skip to content

Commit bdd94ac

Browse files
committed
Add new iprep sources
1 parent f10e9ff commit bdd94ac

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

suricata/update/commands/addsource.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def register(parser):
3737
help="Additional HTTP header to add to requests")
3838
parser.add_argument("--no-checksum", action="store_false",
3939
help="Skips downloading the checksum URL")
40+
parser.add_argument("--iprep", action="store_true",
41+
help="Identifies source as an IPRep Source")
4042
parser.set_defaults(func=add_source)
4143

4244

@@ -67,6 +69,8 @@ def add_source():
6769

6870
header = args.http_header if args.http_header else None
6971

72+
is_iprep = args.iprep
73+
7074
source_config = sources.SourceConfiguration(
71-
name, header=header, url=url, checksum=checksum)
75+
name, header=header, url=url, checksum=checksum, is_iprep=is_iprep)
7276
sources.save_source_config(source_config)

suricata/update/sources.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ def save_source_config(source_config):
7979
class SourceConfiguration:
8080

8181
def __init__(self, name, header=None, url=None,
82-
params={}, checksum=True):
82+
params={}, checksum=True, is_iprep=False):
8383
self.name = name
8484
self.url = url
8585
self.params = params
8686
self.header = header
8787
self.checksum = checksum
88+
self.is_iprep = is_iprep
8889

8990
def dict(self):
9091
d = {
@@ -98,6 +99,8 @@ def dict(self):
9899
d["http-header"] = self.header
99100
if self.checksum:
100101
d["checksum"] = self.checksum
102+
if self.is_iprep:
103+
d["is_iprep"] = self.is_iprep
101104
return d
102105

103106
class Index:

0 commit comments

Comments
 (0)