synapse 2.154.1__py311-none-any.whl → 2.156.0__py311-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 synapse might be problematic. Click here for more details.

Files changed (74) hide show
  1. synapse/cmds/cortex.py +2 -14
  2. synapse/common.py +13 -36
  3. synapse/cortex.py +15 -508
  4. synapse/lib/ast.py +215 -22
  5. synapse/lib/cell.py +35 -8
  6. synapse/lib/certdir.py +11 -0
  7. synapse/lib/cmdr.py +0 -5
  8. synapse/lib/gis.py +2 -2
  9. synapse/lib/httpapi.py +14 -43
  10. synapse/lib/layer.py +64 -201
  11. synapse/lib/lmdbslab.py +11 -0
  12. synapse/lib/node.py +1 -3
  13. synapse/lib/parser.py +10 -0
  14. synapse/lib/slabseqn.py +2 -1
  15. synapse/lib/snap.py +121 -21
  16. synapse/lib/spooled.py +9 -0
  17. synapse/lib/storm.lark +23 -6
  18. synapse/lib/storm.py +16 -339
  19. synapse/lib/storm_format.py +5 -0
  20. synapse/lib/stormhttp.py +10 -1
  21. synapse/lib/stormlib/gen.py +1 -2
  22. synapse/lib/stormlib/gis.py +41 -0
  23. synapse/lib/stormlib/graph.py +2 -1
  24. synapse/lib/stormlib/stats.py +21 -2
  25. synapse/lib/stormlib/storm.py +16 -1
  26. synapse/lib/stormtypes.py +244 -16
  27. synapse/lib/types.py +16 -2
  28. synapse/lib/version.py +2 -2
  29. synapse/lib/view.py +118 -25
  30. synapse/models/base.py +2 -2
  31. synapse/models/inet.py +60 -30
  32. synapse/models/infotech.py +130 -8
  33. synapse/models/orgs.py +3 -0
  34. synapse/models/proj.py +3 -0
  35. synapse/models/risk.py +24 -6
  36. synapse/models/syn.py +0 -38
  37. synapse/tests/test_cmds_cortex.py +1 -1
  38. synapse/tests/test_cortex.py +70 -338
  39. synapse/tests/test_lib_agenda.py +19 -54
  40. synapse/tests/test_lib_aha.py +97 -0
  41. synapse/tests/test_lib_ast.py +596 -0
  42. synapse/tests/test_lib_grammar.py +30 -10
  43. synapse/tests/test_lib_httpapi.py +33 -49
  44. synapse/tests/test_lib_layer.py +19 -234
  45. synapse/tests/test_lib_lmdbslab.py +22 -0
  46. synapse/tests/test_lib_snap.py +9 -0
  47. synapse/tests/test_lib_spooled.py +4 -0
  48. synapse/tests/test_lib_storm.py +16 -309
  49. synapse/tests/test_lib_stormlib_gis.py +21 -0
  50. synapse/tests/test_lib_stormlib_stats.py +107 -20
  51. synapse/tests/test_lib_stormlib_storm.py +25 -0
  52. synapse/tests/test_lib_stormtypes.py +253 -8
  53. synapse/tests/test_lib_types.py +40 -0
  54. synapse/tests/test_lib_view.py +6 -13
  55. synapse/tests/test_model_base.py +1 -1
  56. synapse/tests/test_model_inet.py +15 -0
  57. synapse/tests/test_model_infotech.py +110 -0
  58. synapse/tests/test_model_orgs.py +10 -0
  59. synapse/tests/test_model_person.py +0 -3
  60. synapse/tests/test_model_proj.py +2 -1
  61. synapse/tests/test_model_risk.py +24 -0
  62. synapse/tests/test_model_syn.py +20 -34
  63. synapse/tests/test_tools_csvtool.py +2 -1
  64. synapse/tests/test_tools_feed.py +4 -30
  65. synapse/tools/csvtool.py +2 -1
  66. {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/METADATA +9 -9
  67. {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/RECORD +70 -72
  68. {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/WHEEL +1 -1
  69. synapse/cmds/cron.py +0 -726
  70. synapse/cmds/trigger.py +0 -319
  71. synapse/tests/test_cmds_cron.py +0 -453
  72. synapse/tests/test_cmds_trigger.py +0 -176
  73. {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/LICENSE +0 -0
  74. {synapse-2.154.1.dist-info → synapse-2.156.0.dist-info}/top_level.txt +0 -0
synapse/models/inet.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import socket
2
+ import asyncio
2
3
  import hashlib
3
4
  import logging
4
5
  import ipaddress
@@ -7,6 +8,7 @@ import urllib.parse
7
8
 
8
9
  import idna
9
10
  import regex
11
+ import collections
10
12
  import unicodedata
11
13
 
12
14
  import synapse.exc as s_exc
@@ -479,10 +481,20 @@ class IPv4(s_types.Type):
479
481
  return minv, maxv
480
482
 
481
483
  def getCidrRange(self, text):
482
- addr, mask = text.split('/', 1)
484
+ addr, mask_str = text.split('/', 1)
483
485
  norm, info = self.norm(addr)
484
486
 
485
- mask = cidrmasks[int(mask)]
487
+ try:
488
+ mask_int = int(mask_str)
489
+ except ValueError:
490
+ raise s_exc.BadTypeValu(valu=text, name=self.name,
491
+ mesg=f'Invalid CIDR Mask "{text}"')
492
+
493
+ if mask_int > 32 or mask_int < 0:
494
+ raise s_exc.BadTypeValu(valu=text, name=self.name,
495
+ mesg=f'Invalid CIDR Mask "{text}"')
496
+
497
+ mask = cidrmasks[mask_int]
486
498
 
487
499
  minv = norm & mask[0]
488
500
  return minv, minv + mask[1]
@@ -1008,39 +1020,50 @@ class InetModule(s_module.CoreModule):
1008
1020
  fqdn = node.ndef[1]
1009
1021
  domain = node.get('domain')
1010
1022
 
1011
- if domain is None:
1012
- await node.set('iszone', False)
1013
- await node.set('issuffix', True)
1014
- return
1023
+ async with node.snap.getEditor() as editor:
1024
+ protonode = editor.loadNode(node)
1025
+ if domain is None:
1026
+ await protonode.set('iszone', False)
1027
+ await protonode.set('issuffix', True)
1028
+ return
1015
1029
 
1016
- if node.get('issuffix') is None:
1017
- await node.set('issuffix', False)
1030
+ if protonode.get('issuffix') is None:
1031
+ await protonode.set('issuffix', False)
1018
1032
 
1019
- # almost certainly in the cache anyway....
1020
- parent = await node.snap.addNode('inet:fqdn', domain)
1033
+ parent = await node.snap.getNodeByNdef(('inet:fqdn', domain))
1034
+ if parent is None:
1035
+ parent = await editor.addNode('inet:fqdn', domain)
1021
1036
 
1022
- if parent.get('issuffix'):
1023
- await node.set('iszone', True)
1024
- await node.set('zone', fqdn)
1025
- return
1037
+ if parent.get('issuffix'):
1038
+ await protonode.set('iszone', True)
1039
+ await protonode.set('zone', fqdn)
1040
+ return
1026
1041
 
1027
- await node.set('iszone', False)
1042
+ await protonode.set('iszone', False)
1028
1043
 
1029
- if parent.get('iszone'):
1030
- await node.set('zone', domain)
1031
- return
1044
+ if parent.get('iszone'):
1045
+ await protonode.set('zone', domain)
1046
+ return
1032
1047
 
1033
- zone = parent.get('zone')
1034
- if zone is not None:
1035
- await node.set('zone', zone)
1048
+ zone = parent.get('zone')
1049
+ if zone is not None:
1050
+ await protonode.set('zone', zone)
1036
1051
 
1037
1052
  async def _onSetFqdnIsSuffix(self, node, oldv):
1038
1053
 
1039
1054
  fqdn = node.ndef[1]
1040
1055
 
1041
1056
  issuffix = node.get('issuffix')
1042
- async for child in node.snap.nodesByPropValu('inet:fqdn:domain', '=', fqdn):
1043
- await child.set('iszone', issuffix)
1057
+
1058
+ async with node.snap.getEditor() as editor:
1059
+ async for child in node.snap.nodesByPropValu('inet:fqdn:domain', '=', fqdn):
1060
+ await asyncio.sleep(0)
1061
+
1062
+ if child.get('iszone') == issuffix:
1063
+ continue
1064
+
1065
+ protonode = editor.loadNode(child)
1066
+ await protonode.set('iszone', issuffix)
1044
1067
 
1045
1068
  async def _onSetFqdnIsZone(self, node, oldv):
1046
1069
 
@@ -1069,17 +1092,24 @@ class InetModule(s_module.CoreModule):
1069
1092
 
1070
1093
  async def _onSetFqdnZone(self, node, oldv):
1071
1094
 
1072
- fqdn = node.ndef[1]
1095
+ todo = collections.deque([node.ndef[1]])
1073
1096
  zone = node.get('zone')
1074
1097
 
1075
- async for child in node.snap.nodesByPropValu('inet:fqdn:domain', '=', fqdn):
1098
+ async with node.snap.getEditor() as editor:
1099
+ while todo:
1100
+ fqdn = todo.pop()
1101
+ async for child in node.snap.nodesByPropValu('inet:fqdn:domain', '=', fqdn):
1102
+ await asyncio.sleep(0)
1103
+
1104
+ # if they are their own zone level, skip
1105
+ if child.get('iszone') or child.get('zone') == zone:
1106
+ continue
1076
1107
 
1077
- # if they are their own zone level, skip
1078
- if child.get('iszone'):
1079
- continue
1108
+ # the have the same zone we do
1109
+ protonode = editor.loadNode(child)
1110
+ await protonode.set('zone', zone)
1080
1111
 
1081
- # the have the same zone we do
1082
- await child.set('zone', zone)
1112
+ todo.append(child.ndef[1])
1083
1113
 
1084
1114
  def getModelDefs(self):
1085
1115
  return (
@@ -222,6 +222,13 @@ tlplevels = (
222
222
  (50, 'red'),
223
223
  )
224
224
 
225
+ suslevels = (
226
+ (10, 'benign'),
227
+ (20, 'unknown'),
228
+ (30, 'suspicious'),
229
+ (40, 'malicious'),
230
+ )
231
+
225
232
  # The published Attack Flow json schema at the below URL is horribly
226
233
  # broken. It depends on some custom python scripting to validate each
227
234
  # object individually against the schema for each object's type instead
@@ -401,6 +408,10 @@ class ItModule(s_module.CoreModule):
401
408
  'doc': 'A Mitre ATT&CK Software ID.',
402
409
  'ex': 'S0154',
403
410
  }),
411
+ ('it:mitre:attack:campaign', ('str', {'regex': r'^C[0-9]{4}$'}), {
412
+ 'doc': 'A Mitre ATT&CK Campaign ID.',
413
+ 'ex': 'C0028',
414
+ }),
404
415
  ('it:mitre:attack:flow', ('guid', {}), {
405
416
  'doc': 'A Mitre ATT&CK Flow diagram.',
406
417
  }),
@@ -483,7 +494,8 @@ class ItModule(s_module.CoreModule):
483
494
  ('it:adid', ('str', {'lower': True, 'strip': True}), {
484
495
  'doc': 'An advertising identification string.'}),
485
496
 
486
- ('it:os:windows:sid', ('str', {'regex': r'^S-1-[0-59]-\d{2}-\d{8,10}-\d{8,10}-\d{8,10}-[1-9]\d{3}$'}), {
497
+ # https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/c92a27b1-c772-4fa7-a432-15df5f1b66a1
498
+ ('it:os:windows:sid', ('str', {'regex': r'^S-1-(?:\d{1,10}|0x[0-9a-fA-F]{12})(?:-(?:\d+|0x[0-9a-fA-F]{2,}))*$'}), {
487
499
  'doc': 'A Microsoft Windows Security Identifier.',
488
500
  'ex': 'S-1-5-21-1220945662-1202665555-839525555-5555',
489
501
  }),
@@ -542,18 +554,25 @@ class ItModule(s_module.CoreModule):
542
554
  ('it:hostsoft', ('comp', {'fields': (('host', 'it:host'), ('softver', 'it:prod:softver'))}), {
543
555
  'doc': 'A version of a software product which is present on a given host.',
544
556
  }),
557
+
545
558
  ('it:av:sig', ('comp', {'fields': (('soft', 'it:prod:soft'), ('name', 'it:av:signame'))}), {
546
- 'doc': 'A signature name within the namespace of an antivirus engine name.'
559
+ 'deprecated': True,
560
+ 'doc': 'Deprecated. Please use it:av:scan:result.'
547
561
  }),
548
562
  ('it:av:signame', ('str', {'lower': True}), {
549
- 'doc': 'An antivirus signature name.',
550
- }),
563
+ 'doc': 'An antivirus signature name.'}),
564
+
565
+ ('it:av:scan:result', ('guid', {}), {
566
+ 'doc': 'The result of running an antivirus scanner.'}),
567
+
551
568
  ('it:av:filehit', ('comp', {'fields': (('file', 'file:bytes'), ('sig', 'it:av:sig'))}), {
552
- 'doc': 'A file that triggered an alert on a specific antivirus signature.',
553
- }),
569
+ 'deprecated': True,
570
+ 'doc': 'Deprecated. Please use it:av:scan:result.'}),
571
+
554
572
  ('it:av:prochit', ('guid', {}), {
555
- 'doc': 'An instance of a process triggering an alert on a specific antivirus signature.'
556
- }),
573
+ 'deprecated': True,
574
+ 'doc': 'Deprecated. Please use it:av:scan:result.'}),
575
+
557
576
  ('it:auth:passwdhash', ('guid', {}), {
558
577
  'doc': 'An instance of a password hash.',
559
578
  }),
@@ -1241,6 +1260,50 @@ class ItModule(s_module.CoreModule):
1241
1260
  'doc': 'An array of ATT&CK technique IDs addressed by the mitigation.',
1242
1261
  }),
1243
1262
  )),
1263
+ ('it:mitre:attack:campaign', {}, (
1264
+ ('name', ('ou:campname', {}), {
1265
+ 'doc': 'The primary name for the ATT&CK campaign.',
1266
+ }),
1267
+ ('names', ('array', {'type': 'ou:campname', 'uniq': True, 'sorted': True}), {
1268
+ 'doc': 'An array of alternate names for the ATT&CK campaign.',
1269
+ }),
1270
+ ('desc', ('str', {'strip': True}), {
1271
+ 'doc': 'A description of the ATT&CK campaign.',
1272
+ 'disp': {'hint': 'text'},
1273
+ }),
1274
+ ('url', ('inet:url', {}), {
1275
+ 'doc': 'The URL that documents the ATT&CK campaign.',
1276
+ }),
1277
+ ('groups', ('array', {'type': 'it:mitre:attack:group',
1278
+ 'uniq': True, 'sorted': True, 'split': ','}), {
1279
+ 'doc': 'An array of ATT&CK group IDs attributed to the campaign.',
1280
+ }),
1281
+ ('software', ('array', {'type': 'it:mitre:attack:software',
1282
+ 'uniq': True, 'sorted': True, 'split': ','}), {
1283
+ 'doc': 'An array of ATT&CK software IDs used in the campaign.',
1284
+ }),
1285
+ ('techniques', ('array', {'type': 'it:mitre:attack:technique',
1286
+ 'uniq': True, 'sorted': True, 'split': ','}), {
1287
+ 'doc': 'An array of ATT&CK technique IDs used in the campaign.',
1288
+ }),
1289
+ ('matrices', ('array', {'type': 'it:mitre:attack:matrix',
1290
+ 'uniq': True, 'sorted': True, 'split': ','}), {
1291
+ 'doc': 'The ATT&CK matrices which define the campaign.',
1292
+ }),
1293
+ ('references', ('array', {'type': 'inet:url', 'uniq': True}), {
1294
+ 'doc': 'An array of URLs that document the ATT&CK campaign.',
1295
+ }),
1296
+ ('period', ('ival', {}), {
1297
+ 'doc': 'The time interval when the campaign was active.'}),
1298
+ ('created', ('time', {}), {
1299
+ 'doc': 'The time that the campaign was created by Mitre.'}),
1300
+ ('updated', ('time', {}), {
1301
+ 'doc': 'The time that the campaign was last updated by Mitre.'}),
1302
+ ('tag', ('syn:tag', {}), {
1303
+ 'doc': 'The synapse tag used to annotate nodes included in this ATT&CK campaign.',
1304
+ 'ex': 'cno.mitre.c0028',
1305
+ }),
1306
+ )),
1244
1307
  ('it:mitre:attack:flow', {}, (
1245
1308
  ('name', ('str', {}), {
1246
1309
  'doc': 'The name of the attack-flow diagram.'}),
@@ -1743,6 +1806,63 @@ class ItModule(s_module.CoreModule):
1743
1806
  )),
1744
1807
  ('it:av:signame', {}, ()),
1745
1808
 
1809
+ ('it:av:scan:result', {}, (
1810
+
1811
+ ('time', ('time', {}), {
1812
+ 'doc': 'The time the scan was run.'}),
1813
+
1814
+ ('verdict', ('int', {'enums': suslevels}), {
1815
+ 'doc': 'The scanner provided verdict for the scan.'}),
1816
+
1817
+ ('scanner', ('it:prod:softver', {}), {
1818
+ 'doc': 'The scanner software used to produce the result.'}),
1819
+
1820
+ ('scanner:name', ('it:prod:softname', {}), {
1821
+ 'doc': 'The name of the scanner software.'}),
1822
+
1823
+ ('signame', ('it:av:signame', {}), {
1824
+ 'doc': 'The name of the signature returned by the scanner.'}),
1825
+
1826
+ ('target:file', ('file:bytes', {}), {
1827
+ 'doc': 'The file that was scanned to produce the result.'}),
1828
+
1829
+ ('target:proc', ('it:exec:proc', {}), {
1830
+ 'doc': 'The process that was scanned to produce the result.'}),
1831
+
1832
+ ('target:host', ('it:host', {}), {
1833
+ 'doc': 'The host that was scanned to produce the result.'}),
1834
+
1835
+ ('target:fqdn', ('inet:fqdn', {}), {
1836
+ 'doc': 'The FQDN that was scanned to produce the result.'}),
1837
+
1838
+ ('target:url', ('inet:url', {}), {
1839
+ 'doc': 'The URL that was scanned to produce the result.'}),
1840
+
1841
+ ('target:ipv4', ('inet:ipv4', {}), {
1842
+ 'doc': 'The IPv4 address that was scanned to produce the result.'}),
1843
+
1844
+ ('target:ipv6', ('inet:ipv6', {}), {
1845
+ 'doc': 'The IPv6 address that was scanned to produce the result.'}),
1846
+
1847
+ ('multi:scan', ('it:av:scan:result', {}), {
1848
+ 'doc': 'Set if this result was part of running multiple scanners.'}),
1849
+
1850
+ ('multi:count', ('int', {'min': 0}), {
1851
+ 'doc': 'The total number of scanners which were run by a multi-scanner'}),
1852
+
1853
+ ('multi:count:benign', ('int', {'min': 0}), {
1854
+ 'doc': 'The number of scanners which returned a benign verdict.'}),
1855
+
1856
+ ('multi:count:unknown', ('int', {'min': 0}), {
1857
+ 'doc': 'The number of scanners which returned a unknown/unsupported verdict.'}),
1858
+
1859
+ ('multi:count:suspicious', ('int', {'min': 0}), {
1860
+ 'doc': 'The number of scanners which returned a suspicious verdict.'}),
1861
+
1862
+ ('multi:count:malicious', ('int', {'min': 0}), {
1863
+ 'doc': 'The number of scanners which returned a malicious verdict.'}),
1864
+ )),
1865
+
1746
1866
  ('it:av:filehit', {}, (
1747
1867
  ('file', ('file:bytes', {}), {
1748
1868
  'ro': True,
@@ -1863,6 +1983,8 @@ class ItModule(s_module.CoreModule):
1863
1983
  'doc': 'The URL of the API endpoint the query was sent to.'}),
1864
1984
  ('language', ('str', {'lower': True, 'onespace': True}), {
1865
1985
  'doc': 'The name of the language that the query is expressed in.'}),
1986
+ ('offset', ('int', {}), {
1987
+ 'doc': 'The offset of the last record consumed from the query.'}),
1866
1988
  )),
1867
1989
  ('it:exec:thread', {}, (
1868
1990
  ('proc', ('it:exec:proc', {}), {
synapse/models/orgs.py CHANGED
@@ -503,6 +503,9 @@ class OuModule(s_module.CoreModule):
503
503
 
504
504
  ('tag', ('syn:tag', {}), {
505
505
  'doc': 'The tag used to annotate nodes that are associated with the campaign.'}),
506
+
507
+ ('mitre:attack:campaign', ('it:mitre:attack:campaign', {}), {
508
+ 'doc': 'A mapping to a Mitre ATT&CK campaign if applicable.'}),
506
509
  )),
507
510
  ('ou:conflict', {}, (
508
511
  ('name', ('str', {'onespace': True}), {
synapse/models/proj.py CHANGED
@@ -185,6 +185,9 @@ class ProjectModule(s_module.CoreModule):
185
185
  ('ext:creator', ('ps:contact', {}), {
186
186
  'doc': 'Ticket creator contact information from an external system.'}),
187
187
 
188
+ ('ext:assignee', ('ps:contact', {}), {
189
+ 'doc': 'Ticket assignee contact information from an external system.'}),
190
+
188
191
  ('epic', ('proj:epic', {}), {
189
192
  'doc': 'The epic that includes the ticket.'}),
190
193
 
synapse/models/risk.py CHANGED
@@ -115,6 +115,8 @@ class RiskModule(s_module.CoreModule):
115
115
  ('risk:extortion:type:taxonomy', ('taxonomy', {}), {
116
116
  'interfaces': ('taxonomy',),
117
117
  'doc': 'A taxonomy of extortion event types.'}),
118
+ ('risk:technique:masquerade', ('guid', {}), {
119
+ 'doc': 'Represents the assessment that a node is designed to resemble another in order to mislead.'}),
118
120
  ),
119
121
  'edges': (
120
122
  # some explicit examples...
@@ -337,6 +339,9 @@ class RiskModule(s_module.CoreModule):
337
339
  ('timeline:exploited', ('time', {"ismin": True}), {
338
340
  'doc': 'The earliest known time when the vulnerability was exploited in the wild.'}),
339
341
 
342
+ ('id', ('str', {'strip': True}), {
343
+ 'doc': 'An identifier for the vulnerability.'}),
344
+
340
345
  ('cve', ('it:sec:cve', {}), {
341
346
  'doc': 'The CVE ID of the vulnerability.'}),
342
347
 
@@ -591,8 +596,11 @@ class RiskModule(s_module.CoreModule):
591
596
  ('benign', ('bool', {}), {
592
597
  'doc': 'Set to true if the alert has been confirmed benign. Set to false if malicious.'}),
593
598
 
594
- ('priority', ('int', {}), {
595
- 'doc': 'A numeric value used to rank alerts by priority.'}),
599
+ ('priority', ('meta:priority', {}), {
600
+ 'doc': 'A priority rank for the alert.'}),
601
+
602
+ ('severity', ('meta:severity', {}), {
603
+ 'doc': 'A severity rank for the alert.'}),
596
604
 
597
605
  ('verdict', ('risk:alert:verdict:taxonomy', {}), {
598
606
  'ex': 'benign.false_positive',
@@ -695,8 +703,8 @@ class RiskModule(s_module.CoreModule):
695
703
  ('econ:currency', ('econ:currency', {}), {
696
704
  'doc': 'The currency type for the econ:price fields.'}),
697
705
 
698
- ('severity', ('int', {}), {
699
- 'doc': 'An integer based relative severity score for the compromise.'}),
706
+ ('severity', ('meta:severity', {}), {
707
+ 'doc': 'A severity rank for the compromise.'}),
700
708
 
701
709
  ('goal', ('ou:goal', {}), {
702
710
  'doc': 'The assessed primary goal of the attacker for the compromise.'}),
@@ -748,8 +756,8 @@ class RiskModule(s_module.CoreModule):
748
756
  ('compromise', ('risk:compromise', {}), {
749
757
  'doc': 'A compromise that this attack contributed to.'}),
750
758
 
751
- ('severity', ('int', {}), {
752
- 'doc': 'An integer based relative severity score for the attack.'}),
759
+ ('severity', ('meta:severity', {}), {
760
+ 'doc': 'A severity rank for the attack.'}),
753
761
 
754
762
  ('sophistication', ('meta:sophistication', {}), {
755
763
  'doc': 'The assessed sophistication of the attack.'}),
@@ -939,6 +947,16 @@ class RiskModule(s_module.CoreModule):
939
947
  'doc': 'The currency in which payment was demanded.'}),
940
948
 
941
949
  )),
950
+ ('risk:technique:masquerade', {}, (
951
+ ('node', ('ndef', {}), {
952
+ 'doc': 'The node masquerading as another.'}),
953
+ ('period', ('ival', {}), {
954
+ 'doc': 'The time period when the masquerading was active.'}),
955
+ ('target', ('ndef', {}), {
956
+ 'doc': 'The being masqueraded as.'}),
957
+ ('technique', ('ou:technique', {}), {
958
+ 'doc': 'The specific technique which describes the type of masquerading.'}),
959
+ )),
942
960
  ),
943
961
  }
944
962
  name = 'risk'
synapse/models/syn.py CHANGED
@@ -127,9 +127,6 @@ class SynModule(s_module.CoreModule):
127
127
  ('syn:cmd', ('str', {'strip': True}), {
128
128
  'doc': 'A Synapse storm command.'
129
129
  }),
130
- ('syn:splice', ('guid', {'strip': True}), {
131
- 'doc': 'A splice from a layer.'
132
- }),
133
130
  ('syn:nodedata', ('comp', {'fields': (('key', 'str'), ('form', 'syn:form'))}), {
134
131
  'doc': 'A nodedata key and the form it may be present on.',
135
132
  }),
@@ -282,40 +279,5 @@ class SynModule(s_module.CoreModule):
282
279
  ('nodedata', ('array', {'type': 'syn:nodedata'}), {
283
280
  'doc': 'The list of nodedata that may be added by the command.', 'uniq': True, 'sorted': True, 'ro': True}),
284
281
  )),
285
- ('syn:splice', {'runt': True}, (
286
- ('type', ('str', {'strip': True}), {
287
- 'doc': 'Type of splice.', 'ro': True
288
- }),
289
- ('iden', ('str', {}), {
290
- 'doc': 'The iden of the node involved in the splice.', 'ro': True,
291
- }),
292
- ('form', ('syn:form', {'strip': True}), {
293
- 'doc': 'The form involved in the splice.', 'ro': True
294
- }),
295
- ('prop', ('syn:prop', {'strip': True}), {
296
- 'doc': 'Property modified in the splice.', 'ro': True
297
- }),
298
- ('tag', ('syn:tag', {'strip': True}), {
299
- 'doc': 'Tag modified in the splice.', 'ro': True
300
- }),
301
- ('valu', ('data', {}), {
302
- 'doc': 'The value being set in the splice.', 'ro': True
303
- }),
304
- ('oldv', ('data', {}), {
305
- 'doc': 'The value before the splice.', 'ro': True
306
- }),
307
- ('user', ('guid', {}), {
308
- 'doc': 'The user who caused the splice.', 'ro': True,
309
- }),
310
- ('prov', ('guid', {}), {
311
- 'doc': 'The provenance stack of the splice.', 'ro': True,
312
- }),
313
- ('time', ('time', {}), {
314
- 'doc': 'The time the splice occurred.', 'ro': True,
315
- }),
316
- ('splice', ('data', {}), {
317
- 'doc': 'The splice.', 'ro': True
318
- }),
319
- )),
320
282
  ),
321
283
  }),)
@@ -245,7 +245,7 @@ class CmdCoreTest(s_t_utils.SynTest):
245
245
  cmdr = await s_cmdr.getItemCmdr(core, outp=outp)
246
246
  await cmdr.runCmdLine('log --on --format jsonl')
247
247
  fp = cmdr.locs.get('log:fp')
248
- await cmdr.runCmdLine('storm --editformat splices [test:str=hi :tick=2018 +#haha.hehe]')
248
+ await cmdr.runCmdLine('storm [test:str=hi :tick=2018 +#haha.hehe]')
249
249
 
250
250
  await cmdr.runCmdLine('storm --editformat nodeedits [test:str=hi2 :tick=2018 +#haha.hehe]')
251
251
  await cmdr.runCmdLine('storm [test:comp=(42, bar)]')