rosetta-ce 1.3.4__py3-none-any.whl → 1.3.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rosetta-ce might be problematic. Click here for more details.
- rosetta/rfaker.py +66 -30
- {rosetta_ce-1.3.4.dist-info → rosetta_ce-1.3.6.dist-info}/METADATA +1 -1
- {rosetta_ce-1.3.4.dist-info → rosetta_ce-1.3.6.dist-info}/RECORD +6 -6
- {rosetta_ce-1.3.4.dist-info → rosetta_ce-1.3.6.dist-info}/LICENSE +0 -0
- {rosetta_ce-1.3.4.dist-info → rosetta_ce-1.3.6.dist-info}/WHEEL +0 -0
- {rosetta_ce-1.3.4.dist-info → rosetta_ce-1.3.6.dist-info}/top_level.txt +0 -0
rosetta/rfaker.py
CHANGED
|
@@ -438,7 +438,8 @@ class Events:
|
|
|
438
438
|
f"rule={rule_id} act={action}"
|
|
439
439
|
if observables:
|
|
440
440
|
for observable, observable_value in vars(observables).items():
|
|
441
|
-
|
|
441
|
+
if observable_value:
|
|
442
|
+
generic_cef += f" {observable}={random.choice(observable_value)}"
|
|
442
443
|
cef_messages.append(generic_cef)
|
|
443
444
|
return cef_messages
|
|
444
445
|
|
|
@@ -477,39 +478,74 @@ class Events:
|
|
|
477
478
|
"""
|
|
478
479
|
leef_messages = []
|
|
479
480
|
faker = cls._create_faker()
|
|
481
|
+
vendor = vendor or faker.company()
|
|
480
482
|
version = version or faker.numerify("1.0.#")
|
|
481
483
|
if timestamp is None:
|
|
482
484
|
timestamp = datetime.now() - timedelta(hours=1)
|
|
483
485
|
timestamp += timedelta(seconds=faker.random_int(min=0, max=3599))
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
486
|
+
if product == "WAF":
|
|
487
|
+
for i in range(count):
|
|
488
|
+
timestamp += timedelta(seconds=1)
|
|
489
|
+
severity = random.choice(observables.severity) if observables and observables.severity \
|
|
490
|
+
else faker.random_int(min=1, max=5)
|
|
491
|
+
src_ip = random.choice(observables.src_ip) if observables and observables.src_ip \
|
|
492
|
+
else faker.ipv4()
|
|
493
|
+
src_port = faker.random_int(min=1024, max=65535)
|
|
494
|
+
host = random.choice(observables.src_host) if observables and observables.src_host \
|
|
495
|
+
else faker.hostname()
|
|
496
|
+
method = random.choice(observables.technique).get('mechanism') if observables and observables.technique \
|
|
497
|
+
else random.choice(TECHNIQUES).get('mechanism')
|
|
498
|
+
url = random.choice(observables.technique).get('indicator') if observables and observables.technique \
|
|
499
|
+
else random.choice(TECHNIQUES).get('indicator')
|
|
500
|
+
protocol = random.choice(observables.protocol) if observables and observables.protocol \
|
|
501
|
+
else random.choice(PROTOCOLS)
|
|
502
|
+
user_agent = faker.user_agent()
|
|
503
|
+
referer = random.choice(observables.url) if observables and observables.url \
|
|
504
|
+
else Observables.generator(observable_type=ObservableType.URL, known=ObservableKnown.BAD, count=1)
|
|
505
|
+
response_code = random.choice(observables.error_code) if observables and observables.error_code \
|
|
506
|
+
else random.choice(ERROR_CODE)
|
|
507
|
+
response_size = faker.random_int(min=100, max=10000)
|
|
508
|
+
rule_id = random.choice(observables.event_id) if observables and observables.event_id \
|
|
509
|
+
else faker.random_int(min=1, max=200)
|
|
510
|
+
action = random.choice(observables.action) if observables and observables.action \
|
|
511
|
+
else random.choice(ACTIONS)
|
|
512
|
+
attack_type = random.choice(observables.technique).get('technique') if observables and \
|
|
513
|
+
observables.technique else random.choice(TECHNIQUES).get('technique')
|
|
514
|
+
cookie_name = faker.word()
|
|
515
|
+
cookie_value = faker.uuid4()
|
|
516
|
+
cookies = f"{cookie_name}={cookie_value}"
|
|
517
|
+
leef_log = f"LEEF:1.0|{vendor}|{product}|{version}|deviceEventDate={timestamp}|{faker.ipv4()}|{host}|"
|
|
518
|
+
leef_log += f"src_ip={src_ip} src_port={src_port} request_url={url} method={method} referer={referer} "
|
|
519
|
+
leef_log += f"protocol={protocol} status={str(response_code)} action={action} attack_type={attack_type}"
|
|
520
|
+
leef_log += f" response_size={response_size} rule_id={rule_id} user_agent={user_agent} "
|
|
521
|
+
leef_log += f"severity={severity} cookie={cookies}"
|
|
522
|
+
leef_messages.append(leef_log)
|
|
523
|
+
else:
|
|
524
|
+
for i in range(count):
|
|
525
|
+
timestamp += timedelta(seconds=1)
|
|
526
|
+
severity = random.choice(observables.severity) if observables and observables.severity \
|
|
527
|
+
else faker.random_int(min=1, max=5)
|
|
528
|
+
src_ip = random.choice(observables.src_ip) if observables and observables.src_ip \
|
|
529
|
+
else faker.ipv4()
|
|
530
|
+
src_port = faker.random_int(min=1024, max=65535)
|
|
531
|
+
host = random.choice(observables.src_host) if observables and observables.src_host \
|
|
532
|
+
else faker.hostname()
|
|
533
|
+
url = random.choice(observables.technique).get('indicator') if observables and observables.technique \
|
|
534
|
+
else random.choice(TECHNIQUES).get('indicator')
|
|
535
|
+
protocol = random.choice(observables.protocol) if observables and observables.protocol \
|
|
536
|
+
else random.choice(PROTOCOLS)
|
|
537
|
+
response_code = random.choice(observables.error_code) if observables and observables.error_code \
|
|
538
|
+
else random.choice(ERROR_CODE)
|
|
539
|
+
action = random.choice(observables.action) if observables and observables.action \
|
|
540
|
+
else random.choice(ACTIONS)
|
|
541
|
+
leef_log = f"LEEF:1.0|{vendor}|{product}|{version}|deviceEventDate={timestamp}|{faker.ipv4()}|{host}|"
|
|
542
|
+
leef_log += f"src_ip={src_ip} src_port={src_port} request_url={url} protocol={protocol} "
|
|
543
|
+
leef_log += f"status={str(response_code)} action={action} severity={severity}"
|
|
544
|
+
if observables:
|
|
545
|
+
for observable, observable_value in vars(observables).items():
|
|
546
|
+
if observable_value:
|
|
547
|
+
leef_log += f" {observable}={random.choice(observable_value)}"
|
|
548
|
+
leef_messages.append(leef_log)
|
|
513
549
|
return leef_messages
|
|
514
550
|
|
|
515
551
|
@classmethod
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rosetta-ce
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
4
4
|
Summary: Rosetta is a Python package that can be used to fake security logs and alerts for testing different detection and response use cases.
|
|
5
5
|
Home-page: https://github.com/ayman-m/rosetta
|
|
6
6
|
Author: Ayman Mahmoud
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
rosetta/__init__.py,sha256=9rqZF7bpDMRN5H-rjNRUfzQAOIqyc21hTTZfYufTy04,92
|
|
2
2
|
rosetta/rconverter.py,sha256=oPdWMtO6_aeQC8PqCl4nHKEpVb1kaBACSaNXsz-o00Q,3008
|
|
3
|
-
rosetta/rfaker.py,sha256=
|
|
3
|
+
rosetta/rfaker.py,sha256=rwRZ3v_DfiHcsAygZkCE6UkCJsghC3vISS8IZNbECFI,41965
|
|
4
4
|
rosetta/rsender.py,sha256=j3hhINnTwqT15uCLb__bDGp7pGwgj-EDRn5ZeLWrMVU,8572
|
|
5
5
|
rosetta/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
rosetta/constants/sensors.py,sha256=ZxPWFrNqDFKRVn9ai-5vtvIiU4-3FAXQIRj7gFoBRPk,1936
|
|
7
7
|
rosetta/constants/sources.py,sha256=b3ynlKGw1gw7VBA4yCYkJ7aq4vVPfypqA8W_kuAZaBA,1658
|
|
8
8
|
rosetta/constants/systems.py,sha256=WHOD21CaBgVm3IiF1m-RY2pFRNRaGMZ18pIf0q6ekOI,6697
|
|
9
|
-
rosetta_ce-1.3.
|
|
10
|
-
rosetta_ce-1.3.
|
|
11
|
-
rosetta_ce-1.3.
|
|
12
|
-
rosetta_ce-1.3.
|
|
13
|
-
rosetta_ce-1.3.
|
|
9
|
+
rosetta_ce-1.3.6.dist-info/LICENSE,sha256=jF5fCbmI1A-yyvPAEeQ5VHM094tRLlWsMyun-UlX-pQ,1070
|
|
10
|
+
rosetta_ce-1.3.6.dist-info/METADATA,sha256=g1zG2KR0iyeekox5V1OdJ1qtJG04SbnoHLh5o4P-aJw,11321
|
|
11
|
+
rosetta_ce-1.3.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
12
|
+
rosetta_ce-1.3.6.dist-info/top_level.txt,sha256=HLxDc6BJxHZDzVIlOwpCGH0DqIf65OhZcHniRDaUUZc,8
|
|
13
|
+
rosetta_ce-1.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|