synapse 2.195.1__py311-none-any.whl → 2.197.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 (60) hide show
  1. synapse/axon.py +72 -5
  2. synapse/common.py +23 -0
  3. synapse/cortex.py +13 -8
  4. synapse/cryotank.py +2 -2
  5. synapse/daemon.py +1 -0
  6. synapse/lib/aha.py +159 -4
  7. synapse/lib/cell.py +133 -8
  8. synapse/lib/config.py +3 -3
  9. synapse/lib/jsonstor.py +2 -1
  10. synapse/lib/modelrev.py +5 -1
  11. synapse/lib/multislabseqn.py +2 -2
  12. synapse/lib/nexus.py +4 -1
  13. synapse/lib/reflect.py +4 -5
  14. synapse/lib/schemas.py +478 -1
  15. synapse/lib/snap.py +14 -7
  16. synapse/lib/storm.py +12 -394
  17. synapse/lib/stormlib/aha.py +351 -1
  18. synapse/lib/stormlib/graph.py +0 -61
  19. synapse/lib/stormlib/index.py +52 -0
  20. synapse/lib/stormlib/utils.py +37 -0
  21. synapse/lib/stormtypes.py +121 -1
  22. synapse/lib/task.py +13 -2
  23. synapse/lib/urlhelp.py +1 -1
  24. synapse/lib/version.py +2 -2
  25. synapse/models/base.py +3 -0
  26. synapse/models/doc.py +62 -0
  27. synapse/models/infotech.py +55 -16
  28. synapse/models/orgs.py +20 -14
  29. synapse/models/risk.py +23 -10
  30. synapse/models/transport.py +8 -3
  31. synapse/telepath.py +12 -0
  32. synapse/tests/test_axon.py +23 -0
  33. synapse/tests/test_common.py +28 -0
  34. synapse/tests/test_datamodel.py +15 -0
  35. synapse/tests/test_lib_aha.py +201 -0
  36. synapse/tests/test_lib_boss.py +15 -6
  37. synapse/tests/test_lib_cell.py +104 -0
  38. synapse/tests/test_lib_jsonstor.py +1 -0
  39. synapse/tests/test_lib_modelrev.py +6 -0
  40. synapse/tests/test_lib_stormlib_aha.py +188 -0
  41. synapse/tests/test_lib_stormlib_index.py +39 -0
  42. synapse/tests/test_lib_stormlib_utils.py +14 -0
  43. synapse/tests/test_lib_stormtypes.py +90 -3
  44. synapse/tests/test_lib_task.py +31 -13
  45. synapse/tests/test_model_base.py +2 -0
  46. synapse/tests/test_model_doc.py +38 -0
  47. synapse/tests/test_model_infotech.py +28 -1
  48. synapse/tests/test_model_orgs.py +9 -0
  49. synapse/tests/test_model_risk.py +2 -0
  50. synapse/tests/test_model_transport.py +1 -0
  51. synapse/tests/test_telepath.py +26 -0
  52. synapse/tests/test_tools_aha.py +192 -0
  53. synapse/tools/aha/mirror.py +193 -0
  54. synapse/tools/changelog.py +32 -27
  55. synapse/tools/genpkg.py +2 -2
  56. {synapse-2.195.1.dist-info → synapse-2.197.0.dist-info}/METADATA +1 -1
  57. {synapse-2.195.1.dist-info → synapse-2.197.0.dist-info}/RECORD +60 -55
  58. {synapse-2.195.1.dist-info → synapse-2.197.0.dist-info}/LICENSE +0 -0
  59. {synapse-2.195.1.dist-info → synapse-2.197.0.dist-info}/WHEEL +0 -0
  60. {synapse-2.195.1.dist-info → synapse-2.197.0.dist-info}/top_level.txt +0 -0
synapse/lib/stormtypes.py CHANGED
@@ -2381,6 +2381,50 @@ class LibAxon(Lib):
2381
2381
  {'name': 'sha256', 'type': 'str', 'desc': 'The sha256 value to calculate hashes for.', },
2382
2382
  ),
2383
2383
  'returns': {'type': 'dict', 'desc': 'A dictionary of additional hashes.', }}},
2384
+
2385
+ {'name': 'read', 'desc': '''
2386
+ Read bytes from a file stored in the Axon by its SHA256 hash.
2387
+
2388
+ Examples:
2389
+ Read 100 bytes starting at offset 0::
2390
+
2391
+ $byts = $lib.axon.read($sha256, size=100)
2392
+
2393
+ Read 50 bytes starting at offset 200::
2394
+
2395
+ $byts = $lib.axon.read($sha256, offs=200, size=50)
2396
+ ''',
2397
+ 'type': {'type': 'function', '_funcname': 'read',
2398
+ 'args': (
2399
+ {'name': 'sha256', 'type': 'str', 'desc': 'The SHA256 hash of the file to read.'},
2400
+ {'name': 'offs', 'type': 'int', 'default': 0,
2401
+ 'desc': 'The offset to start reading from.'},
2402
+ {'name': 'size', 'type': 'int', 'default': s_const.mebibyte,
2403
+ 'desc': 'The number of bytes to read. Max is 1 MiB.'},
2404
+ ),
2405
+ 'returns': {'type': 'bytes', 'desc': 'The requested bytes from the file.'}}},
2406
+
2407
+ {'name': 'unpack', 'desc': '''
2408
+ Unpack bytes from a file stored in the Axon into a struct using the specified format.
2409
+
2410
+ Examples:
2411
+ Unpack two 32-bit integers from the start of a file::
2412
+
2413
+ $nums = $lib.axon.unpack($sha256, '<II')
2414
+
2415
+ Unpack a 64-bit float starting at offset 100::
2416
+
2417
+ $float = $lib.axon.unpack($sha256, '<d', offs=100)
2418
+ ''',
2419
+ 'type': {'type': 'function', '_funcname': 'unpack',
2420
+ 'args': (
2421
+ {'name': 'sha256', 'type': 'str', 'desc': 'The SHA256 hash of the file to read.'},
2422
+ {'name': 'fmt', 'type': 'str', 'desc': 'The struct format string.'},
2423
+ {'name': 'offs', 'type': 'int', 'default': 0,
2424
+ 'desc': 'The offset to start reading from.'},
2425
+ ),
2426
+ 'returns': {'type': 'list', 'desc': 'The unpacked values as a tuple.'}}},
2427
+
2384
2428
  {'name': 'upload', 'desc': '''
2385
2429
  Upload a stream of bytes to the Axon as a file.
2386
2430
 
@@ -2426,6 +2470,8 @@ class LibAxon(Lib):
2426
2470
  'size': self.size,
2427
2471
  'upload': self.upload,
2428
2472
  'hashset': self.hashset,
2473
+ 'read': self.read,
2474
+ 'unpack': self.unpack,
2429
2475
  }
2430
2476
 
2431
2477
  @stormfunc(readonly=True)
@@ -2712,6 +2758,48 @@ class LibAxon(Lib):
2712
2758
  await self.runt.snap.core.getAxon()
2713
2759
  return await self.runt.snap.core.axon.hashset(s_common.uhex(sha256))
2714
2760
 
2761
+ @stormfunc(readonly=True)
2762
+ async def read(self, sha256, offs=0, size=s_const.mebibyte):
2763
+ '''
2764
+ Read bytes from a file in the Axon.
2765
+ '''
2766
+ sha256 = await tostr(sha256)
2767
+ size = await toint(size)
2768
+ offs = await toint(offs)
2769
+
2770
+ if size > s_const.mebibyte:
2771
+ mesg = f'Size must be between 1 and {s_const.mebibyte} bytes'
2772
+ raise s_exc.BadArg(mesg=mesg)
2773
+
2774
+ if not self.runt.allowed(('axon', 'get')):
2775
+ self.runt.confirm(('storm', 'lib', 'axon', 'get'))
2776
+
2777
+ await self.runt.snap.core.getAxon()
2778
+
2779
+ byts = b''
2780
+ async for chunk in self.runt.snap.core.axon.get(s_common.uhex(sha256), offs=offs, size=size):
2781
+ byts += chunk
2782
+ return byts
2783
+
2784
+ @stormfunc(readonly=True)
2785
+ async def unpack(self, sha256, fmt, offs=0):
2786
+ '''
2787
+ Unpack bytes from a file in the Axon using struct.
2788
+ '''
2789
+ if self.runt.snap.core.axoninfo.get('features', {}).get('unpack', 0) < 1:
2790
+ mesg = 'The connected Axon does not support the the unpack API. Please update your Axon.'
2791
+ raise s_exc.FeatureNotSupported(mesg=mesg)
2792
+
2793
+ sha256 = await tostr(sha256)
2794
+ fmt = await tostr(fmt)
2795
+ offs = await toint(offs)
2796
+
2797
+ if not self.runt.allowed(('axon', 'get')):
2798
+ self.runt.confirm(('storm', 'lib', 'axon', 'get'))
2799
+
2800
+ await self.runt.snap.core.getAxon()
2801
+ return await self.runt.snap.core.axon.unpack(s_common.uhex(sha256), fmt, offs)
2802
+
2715
2803
  @registry.registerLib
2716
2804
  class LibBytes(Lib):
2717
2805
  '''
@@ -6751,7 +6839,8 @@ class Layer(Prim):
6751
6839
  Implements the Storm api for a layer instance.
6752
6840
  '''
6753
6841
  _storm_locals = (
6754
- {'name': 'iden', 'desc': 'The iden of the Layer.', 'type': 'str', },
6842
+ {'name': 'iden', 'desc': 'The iden of the Layer.', 'type': 'str'},
6843
+ {'name': 'name', 'desc': 'The name of the Layer.', 'type': 'str'},
6755
6844
  {'name': 'set', 'desc': 'Set an arbitrary value in the Layer definition.',
6756
6845
  'type': {'type': 'function', '_funcname': '_methLayerSet',
6757
6846
  'args': (
@@ -6999,6 +7088,22 @@ class Layer(Prim):
6999
7088
  'returns': {'name': 'Yields', 'type': 'node',
7000
7089
  'desc': 'Yields nodes.', }}},
7001
7090
 
7091
+ {'name': 'liftByNodeData', 'desc': '''
7092
+ Lift and yield nodes with the given node data key set within the layer.
7093
+
7094
+ Example:
7095
+ Yield all nodes with the data key zootsuit set in the top layer::
7096
+
7097
+ yield $lib.layer.get().liftByNodeData(zootsuit)
7098
+
7099
+ ''',
7100
+ 'type': {'type': 'function', '_funcname': 'liftByNodeData',
7101
+ 'args': (
7102
+ {'name': 'name', 'type': 'str', 'desc': 'The node data name to lift by.'},
7103
+ ),
7104
+ 'returns': {'name': 'Yields', 'type': 'node',
7105
+ 'desc': 'Yields nodes.', }}},
7106
+
7002
7107
  {'name': 'getEdges', 'desc': '''
7003
7108
  Yield (n1iden, verb, n2iden) tuples for any light edges in the layer.
7004
7109
 
@@ -7090,6 +7195,7 @@ class Layer(Prim):
7090
7195
 
7091
7196
  self.locls.update(self.getObjLocals())
7092
7197
  self.locls['iden'] = self.valu.get('iden')
7198
+ self.locls['name'] = self.valu.get('name')
7093
7199
 
7094
7200
  def __hash__(self):
7095
7201
  return hash((self._storm_typename, self.locls['iden']))
@@ -7110,6 +7216,7 @@ class Layer(Prim):
7110
7216
  'getEdges': self.getEdges,
7111
7217
  'liftByTag': self.liftByTag,
7112
7218
  'liftByProp': self.liftByProp,
7219
+ 'liftByNodeData': self.liftByNodeData,
7113
7220
  'getTagCount': self._methGetTagCount,
7114
7221
  'getPropCount': self._methGetPropCount,
7115
7222
  'getPropValues': self._methGetPropValues,
@@ -7177,6 +7284,19 @@ class Layer(Prim):
7177
7284
  async for _, buid, sode in layr.liftByPropValu(liftform, liftprop, cmprvals):
7178
7285
  yield await self.runt.snap._joinStorNode(buid, {iden: sode})
7179
7286
 
7287
+ @stormfunc(readonly=True)
7288
+ async def liftByNodeData(self, name):
7289
+
7290
+ name = await tostr(name)
7291
+
7292
+ iden = self.valu.get('iden')
7293
+ layr = self.runt.snap.core.getLayer(iden)
7294
+
7295
+ await self.runt.reqUserCanReadLayer(iden)
7296
+
7297
+ async for _, buid, sode in layr.liftByDataName(name):
7298
+ yield await self.runt.snap._joinStorNode(buid, {iden: sode})
7299
+
7180
7300
  @stormfunc(readonly=True)
7181
7301
  async def getMirrorStatus(self):
7182
7302
  iden = self.valu.get('iden')
synapse/lib/task.py CHANGED
@@ -1,4 +1,3 @@
1
- import copy
2
1
  import asyncio
3
2
  import logging
4
3
 
@@ -6,6 +5,7 @@ import synapse.exc as s_exc
6
5
  import synapse.common as s_common
7
6
 
8
7
  import synapse.lib.base as s_base
8
+ import synapse.lib.msgpack as s_msgpack
9
9
 
10
10
  logger = logging.getLogger(__name__)
11
11
 
@@ -104,7 +104,7 @@ class Task(s_base.Base):
104
104
  pask = {
105
105
  'iden': self.iden,
106
106
  'name': self.name,
107
- 'info': copy.deepcopy(self.info),
107
+ 'info': s_msgpack.deepcopy(self.info),
108
108
  'tick': self.tick,
109
109
  'user': 'root',
110
110
  'kids': {i: k.pack() for i, k in self.kids.items()},
@@ -115,6 +115,17 @@ class Task(s_base.Base):
115
115
 
116
116
  return pask
117
117
 
118
+ def packv2(self):
119
+ return {
120
+ 'iden': self.iden,
121
+ 'name': self.name,
122
+ 'info': s_msgpack.deepcopy(self.info),
123
+ 'tick': self.tick,
124
+ 'user': self.user.iden,
125
+ 'username': self.user.name,
126
+ 'kids': {i: k.packv2() for i, k in self.kids.items()},
127
+ }
128
+
118
129
  def loop():
119
130
  try:
120
131
  return asyncio.get_running_loop()
synapse/lib/urlhelp.py CHANGED
@@ -13,7 +13,7 @@ def chopurl(url):
13
13
  '''
14
14
  ret = {}
15
15
  if url.find('://') == -1:
16
- raise s_exc.BadUrl(':// not found in [{}]!'.format(url))
16
+ raise s_exc.BadUrl(mesg=':// not found in [{}]!'.format(url))
17
17
 
18
18
  scheme, remain = url.split('://', 1)
19
19
  ret['scheme'] = scheme.lower()
synapse/lib/version.py CHANGED
@@ -223,6 +223,6 @@ def reqVersion(valu, reqver,
223
223
  ##############################################################################
224
224
  # The following are touched during the release process by bumpversion.
225
225
  # Do not modify these directly.
226
- version = (2, 195, 1)
226
+ version = (2, 197, 0)
227
227
  verstring = '.'.join([str(x) for x in version])
228
- commit = '83cc00aa05086cbc4dfec2f820db8f392c76a012'
228
+ commit = 'c8c758131cae47ef21e23ac8242012459ebfce9d'
synapse/models/base.py CHANGED
@@ -193,6 +193,9 @@ class BaseModule(s_module.CoreModule):
193
193
  ('url', ('inet:url', {}), {
194
194
  'doc': 'A URL which documents the meta source.'}),
195
195
 
196
+ ('ingest:cursor', ('str', {}), {
197
+ 'doc': 'Used by ingest logic to capture the current ingest cursor within a feed.'}),
198
+
196
199
  ('ingest:latest', ('time', {}), {
197
200
  'doc': 'Used by ingest logic to capture the last time a feed ingest ran.'}),
198
201
 
synapse/models/doc.py CHANGED
@@ -77,6 +77,30 @@ class DocModule(s_module.CoreModule):
77
77
  'documents': 'standards',
78
78
  'type': 'doc:standard:type:taxonomy'},
79
79
  'doc': 'A group of requirements which define how to implement a policy or goal.'}),
80
+
81
+ ('doc:requirement:type:taxonomy', ('taxonomy', {}), {
82
+ 'interfaces': ('meta:taxonomy',),
83
+ 'doc': 'A taxonomy of requirement types.'}),
84
+
85
+ ('doc:requirement', ('guid', {}), {
86
+ 'interfaces': ('doc:document',),
87
+ 'template': {
88
+ 'document': 'requirement',
89
+ 'documents': 'requirements',
90
+ 'type': 'doc:requirement:type:taxonomy'},
91
+ 'doc': 'A single requirement, often defined by a standard.'}),
92
+
93
+ ('doc:resume:type:taxonomy', ('taxonomy', {}), {
94
+ 'interfaces': ('meta:taxonomy',),
95
+ 'doc': 'A taxonomy of resume types.'}),
96
+
97
+ ('doc:resume', ('guid', {}), {
98
+ 'interfaces': ('doc:document',),
99
+ 'template': {
100
+ 'document': 'resume',
101
+ 'documents': 'resumes',
102
+ 'type': 'doc:resume:type:taxonomy'},
103
+ 'doc': 'A CV/resume document.'}),
80
104
  ),
81
105
  'forms': (
82
106
 
@@ -88,6 +112,44 @@ class DocModule(s_module.CoreModule):
88
112
  ('policy', ('doc:policy', {}), {
89
113
  'doc': 'The policy which was used to derive the standard.'}),
90
114
  )),
115
+
116
+ ('doc:requirement:type:taxonomy', {}, ()),
117
+ ('doc:requirement', {}, (
118
+
119
+ ('summary', ('str', {}), {
120
+ 'disp': {'hint': 'text'},
121
+ 'doc': 'A summary of the requirement definition.'}),
122
+
123
+ ('optional', ('bool', {}), {
124
+ 'doc': 'Set to true if the requirement is optional as defined by the standard.'}),
125
+
126
+ ('priority', ('meta:priority', {}), {
127
+ 'doc': 'The priority of the requirement as defined by the standard.'}),
128
+
129
+ ('standard', ('doc:standard', {}), {
130
+ 'doc': 'The standard which defined the requirement.'}),
131
+ )),
132
+
133
+ ('doc:resume:type:taxonomy', {}, ()),
134
+ ('doc:resume', {}, (
135
+
136
+ ('contact', ('ps:contact', {}), {
137
+ 'doc': 'Contact information for subject of the resume.'}),
138
+
139
+ ('summary', ('str', {}), {
140
+ 'disp': {'hint': 'text'},
141
+ 'doc': 'The summary of qualifications from the resume.'}),
142
+
143
+ ('workhist', ('array', {'type': 'ps:workhist', 'sorted': True, 'uniq': True}), {
144
+ 'doc': 'Work history described in the resume.'}),
145
+
146
+ ('education', ('array', {'type': 'ps:education', 'sorted': True, 'uniq': True}), {
147
+ 'doc': 'Education experience described in the resume.'}),
148
+
149
+ ('achievements', ('array', {'type': 'ps:achievement', 'sorted': True, 'uniq': True}), {
150
+ 'doc': 'Achievements described in the resume.'}),
151
+
152
+ )),
91
153
  ),
92
154
  'edges': (),
93
155
  }),)
@@ -1417,6 +1417,36 @@ class ItModule(s_module.CoreModule):
1417
1417
  'deprecated': True,
1418
1418
  'doc': 'Deprecated. Please use risk:vuln:cve:references.'}),
1419
1419
 
1420
+ ('nist:nvd:source', ('ou:name', {}), {
1421
+ 'doc': 'The name of the organization which reported the vulnerability to NIST.'}),
1422
+
1423
+ ('nist:nvd:published', ('time', {}), {
1424
+ 'doc': 'The date the vulnerability was first published in the NVD.'}),
1425
+
1426
+ ('nist:nvd:modified', ('time', {"ismax": True}), {
1427
+ 'doc': 'The date the vulnerability was last modified in the NVD.'}),
1428
+
1429
+ ('cisa:kev:name', ('str', {}), {
1430
+ 'doc': 'The name of the vulnerability according to the CISA KEV database.'}),
1431
+
1432
+ ('cisa:kev:desc', ('str', {}), {
1433
+ 'doc': 'The description of the vulnerability according to the CISA KEV database.'}),
1434
+
1435
+ ('cisa:kev:action', ('str', {}), {
1436
+ 'doc': 'The action to mitigate the vulnerability according to the CISA KEV database.'}),
1437
+
1438
+ ('cisa:kev:vendor', ('ou:name', {}), {
1439
+ 'doc': 'The vendor name listed in the CISA KEV database.'}),
1440
+
1441
+ ('cisa:kev:product', ('it:prod:softname', {}), {
1442
+ 'doc': 'The product name listed in the CISA KEV database.'}),
1443
+
1444
+ ('cisa:kev:added', ('time', {}), {
1445
+ 'doc': 'The date the vulnerability was added to the CISA KEV database.'}),
1446
+
1447
+ ('cisa:kev:duedate', ('time', {}), {
1448
+ 'doc': 'The date the action is due according to the CISA KEV database.'}),
1449
+
1420
1450
  )),
1421
1451
  ('it:sec:cpe', {}, (
1422
1452
  ('v2_2', ('it:sec:cpe:v2_2', {}), {
@@ -2248,29 +2278,34 @@ class ItModule(s_module.CoreModule):
2248
2278
  'doc': 'Software architecture.',
2249
2279
  }),
2250
2280
  ('released', ('time', {}), {
2251
- 'doc': 'Timestamp for when this version of the software was released.',
2252
- }),
2281
+ 'doc': 'Timestamp for when this version of the software was released.'}),
2282
+
2253
2283
  ('semver', ('it:semver', {}), {
2254
- 'doc': 'System normalized semantic version number.',
2255
- }),
2284
+ 'doc': 'System normalized semantic version number.'}),
2285
+
2256
2286
  ('semver:major', ('int', {}), {
2257
- 'doc': 'Version major number.',
2258
- }),
2287
+ 'deprecated': True,
2288
+ 'doc': 'Deprecated. Please use semver range queries.'}),
2289
+
2259
2290
  ('semver:minor', ('int', {}), {
2260
- 'doc': 'Version minor number.',
2261
- }),
2291
+ 'deprecated': True,
2292
+ 'doc': 'Deprecated. Please use semver range queries.'}),
2293
+
2262
2294
  ('semver:patch', ('int', {}), {
2263
- 'doc': 'Version patch number.',
2264
- }),
2295
+ 'deprecated': True,
2296
+ 'doc': 'Deprecated. Please use semver range queries.'}),
2297
+
2265
2298
  ('semver:pre', ('str', {}), {
2266
- 'doc': 'Semver prerelease string.',
2267
- }),
2299
+ 'deprecated': True,
2300
+ 'doc': 'Deprecated.'}),
2301
+
2268
2302
  ('semver:build', ('str', {}), {
2269
- 'doc': 'Semver build string.',
2270
- }),
2303
+ 'deprecated': True,
2304
+ 'doc': 'Deprecated.'}),
2305
+
2271
2306
  ('url', ('inet:url', {}), {
2272
- 'doc': 'URL where a specific version of the software is available from.',
2273
- }),
2307
+ 'doc': 'URL where a specific version of the software is available from.'}),
2308
+
2274
2309
  )),
2275
2310
 
2276
2311
  ('it:prod:softlib', {}, (
@@ -2347,6 +2382,10 @@ class ItModule(s_module.CoreModule):
2347
2382
  ('signame', ('it:av:signame', {}), {
2348
2383
  'doc': 'The name of the signature returned by the scanner.'}),
2349
2384
 
2385
+ ('categories', ('array', {'sorted': True, 'uniq': True,
2386
+ 'type': 'str', 'typeopts': {'lower': True, 'onespace': True}}), {
2387
+ 'doc': 'A list of categories for the result returned by the scanner.'}),
2388
+
2350
2389
  ('target:file', ('file:bytes', {}), {
2351
2390
  'doc': 'The file that was scanned to produce the result.'}),
2352
2391
 
synapse/models/orgs.py CHANGED
@@ -93,9 +93,10 @@ class OuModule(s_module.CoreModule):
93
93
  ('ou:industryname', ('str', {'lower': True, 'onespace': True}), {
94
94
  'doc': 'The name of an industry.',
95
95
  }),
96
- ('ou:alias', ('str', {'lower': True, 'regex': r'^[0-9a-z_]+$'}), {
97
- 'doc': 'An alias for the org GUID.',
96
+ ('ou:alias', ('str', {'lower': True, 'regex': r'^[\w0-9_]+$'}), {
97
+ 'deprecated': True,
98
98
  'ex': 'vertexproject',
99
+ 'doc': 'Deprecated. Please use ou:name.',
99
100
  }),
100
101
  ('ou:hasalias', ('comp', {'fields': (('org', 'ou:org'), ('alias', 'ou:alias'))}), {
101
102
  'deprecated': True,
@@ -762,7 +763,8 @@ class OuModule(s_module.CoreModule):
762
763
  'doc': 'A list of alternate names for the organization.',
763
764
  }),
764
765
  ('alias', ('ou:alias', {}), {
765
- 'doc': 'The default alias for an organization.'
766
+ 'deprecated': True,
767
+ 'doc': 'Deprecated. Please use ou:org:names.',
766
768
  }),
767
769
  ('phone', ('tel:phone', {}), {
768
770
  'doc': 'The primary phone number for the organization.',
@@ -1346,30 +1348,34 @@ class OuModule(s_module.CoreModule):
1346
1348
  }),
1347
1349
  )),
1348
1350
  ('ou:contest:result', {}, (
1351
+
1349
1352
  ('contest', ('ou:contest', {}), {
1350
1353
  'ro': True,
1351
- 'doc': 'The contest.',
1352
- }),
1354
+ 'doc': 'The contest that the participant took part in.'}),
1355
+
1353
1356
  ('participant', ('ps:contact', {}), {
1354
1357
  'ro': True,
1355
- 'doc': 'The participant',
1356
- }),
1358
+ 'doc': 'The participant in the contest.'}),
1359
+
1357
1360
  ('rank', ('int', {}), {
1358
- 'doc': 'The rank order of the participant.',
1359
- }),
1361
+ 'doc': "The participant's rank order in the contest."}),
1362
+
1360
1363
  ('score', ('int', {}), {
1361
- 'doc': 'The score of the participant.',
1362
- }),
1364
+ 'doc': "The participant's final score in the contest."}),
1365
+
1366
+ ('period', ('ival', {}), {
1367
+ 'doc': 'The period of time when the participant competed in the contest.'}),
1368
+
1363
1369
  ('url', ('inet:url', {}), {
1364
- 'doc': 'The contest result website URL.',
1365
- }),
1370
+ 'doc': 'The contest result website URL.'}),
1371
+
1366
1372
  )),
1367
1373
  ('ou:enacted:status:taxonomy', {}, ()),
1368
1374
  ('ou:enacted', {}, (
1369
1375
  ('org', ('ou:org', {}), {
1370
1376
  'doc': 'The organization which is enacting the document.'}),
1371
1377
 
1372
- ('doc', ('ndef', {'forms': ('doc:policy', 'doc:standard')}), {
1378
+ ('doc', ('ndef', {'forms': ('doc:policy', 'doc:standard', 'doc:requirement')}), {
1373
1379
  'doc': 'The document enacted by the organization.'}),
1374
1380
 
1375
1381
  ('scope', ('ndef', {}), {
synapse/models/risk.py CHANGED
@@ -492,6 +492,9 @@ class RiskModule(s_module.CoreModule):
492
492
  ('id', ('str', {'strip': True}), {
493
493
  'doc': 'An identifier for the vulnerability.'}),
494
494
 
495
+ ('tag', ('syn:tag', {}), {
496
+ 'doc': 'A tag used to annotate the presence or use of the vulnerability.'}),
497
+
495
498
  ('cve', ('it:sec:cve', {}), {
496
499
  'doc': 'The CVE ID of the vulnerability.'}),
497
500
 
@@ -506,34 +509,44 @@ class RiskModule(s_module.CoreModule):
506
509
  'doc': 'An array of documentation URLs provided by the CVE database.'}),
507
510
 
508
511
  ('nist:nvd:source', ('ou:name', {}), {
509
- 'doc': 'The name of the organization which reported the vulnerability to NIST.'}),
512
+ 'deprecated': True,
513
+ 'doc': 'Deprecated. Please use it:sec:cve:nist:nvd:source.'}),
510
514
 
511
515
  ('nist:nvd:published', ('time', {}), {
512
- 'doc': 'The date the vulnerability was first published in the NVD.'}),
516
+ 'deprecated': True,
517
+ 'doc': 'Deprecated. Please use it:sec:cve:nist:nvd:published.'}),
513
518
 
514
519
  ('nist:nvd:modified', ('time', {"ismax": True}), {
515
- 'doc': 'The date the vulnerability was last modified in the NVD.'}),
520
+ 'deprecated': True,
521
+ 'doc': 'Deprecated. Please use it:sec:cve:nist:nvd:modified.'}),
516
522
 
517
523
  ('cisa:kev:name', ('str', {}), {
518
- 'doc': 'The name of the vulnerability according to the CISA KEV database.'}),
524
+ 'deprecated': True,
525
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:name.'}),
519
526
 
520
527
  ('cisa:kev:desc', ('str', {}), {
521
- 'doc': 'The description of the vulnerability according to the CISA KEV database.'}),
528
+ 'deprecated': True,
529
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:desc.'}),
522
530
 
523
531
  ('cisa:kev:action', ('str', {}), {
524
- 'doc': 'The action to mitigate the vulnerability according to the CISA KEV database.'}),
532
+ 'deprecated': True,
533
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:action.'}),
525
534
 
526
535
  ('cisa:kev:vendor', ('ou:name', {}), {
527
- 'doc': 'The vendor name listed in the CISA KEV database.'}),
536
+ 'deprecated': True,
537
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:vendor.'}),
528
538
 
529
539
  ('cisa:kev:product', ('it:prod:softname', {}), {
530
- 'doc': 'The product name listed in the CISA KEV database.'}),
540
+ 'deprecated': True,
541
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:product.'}),
531
542
 
532
543
  ('cisa:kev:added', ('time', {}), {
533
- 'doc': 'The date the vulnerability was added to the CISA KEV database.'}),
544
+ 'deprecated': True,
545
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:added.'}),
534
546
 
535
547
  ('cisa:kev:duedate', ('time', {}), {
536
- 'doc': 'The date the action is due according to the CISA KEV database.'}),
548
+ 'deprecated': True,
549
+ 'doc': 'Deprecated. Please use it:sec:cve:cisa:kev:duedate.'}),
537
550
 
538
551
  ('cvss:v2', ('cvss:v2', {}), {
539
552
  'doc': 'The CVSS v2 vector for the vulnerability.'}),
@@ -454,21 +454,26 @@ class TransportModule(s_module.CoreModule):
454
454
  ('type', ('transport:sea:vessel:type:taxonomy', {}), {
455
455
  'doc': 'The type of vessel.'}),
456
456
 
457
- # TODO: convert this to an entity:name
458
- ('name', ('str', {'lower': True, 'onespace': True}), {
459
- 'doc': 'The name of the vessel'}),
457
+ ('name', ('entity:name', {}), {
458
+ 'doc': 'The name of the vessel.'}),
459
+
460
460
  ('length', ('geo:dist', {}), {
461
461
  'deprecated': True,
462
462
  'doc': 'Deprecated. Please use :phys:length.'}),
463
+
463
464
  ('beam', ('geo:dist', {}), {
464
465
  'doc': 'The official overall vessel beam'}),
466
+
465
467
  ('flag', ('iso:3166:cc', {}), {
466
468
  'doc': 'The country the vessel is flagged to.'}),
469
+
467
470
  ('mmsi', ('transport:sea:mmsi', {}), {
468
471
  'doc': 'The Maritime Mobile Service Identifier assigned to the vessel.'}),
472
+
469
473
  ('make', ('str', {'lower': True, 'strip': True}), {
470
474
  'deprecated': True,
471
475
  'doc': 'Deprecated. Please use :manufacturer:name.'}),
476
+
472
477
  ('operator', ('ps:contact', {}), {
473
478
  'doc': 'The contact information of the operator.'}),
474
479
  # TODO tonnage / gross tonnage?
synapse/telepath.py CHANGED
@@ -321,6 +321,9 @@ class Aware:
321
321
  '''
322
322
  return self
323
323
 
324
+ async def getTeleFeats(self):
325
+ return {}
326
+
324
327
  def onTeleShare(self, dmon, name):
325
328
  pass
326
329
 
@@ -599,6 +602,8 @@ class Proxy(s_base.Base):
599
602
  self.shares = {}
600
603
 
601
604
  self._ahainfo = {}
605
+ self._features = {}
606
+
602
607
  self.sharinfo = {}
603
608
  self.methinfo = {}
604
609
 
@@ -634,6 +639,12 @@ class Proxy(s_base.Base):
634
639
  self.onfini(fini)
635
640
  self.link.onfini(self.fini)
636
641
 
642
+ def _hasTeleFeat(self, name, vers=1):
643
+ return self._features.get(name, 0) >= vers
644
+
645
+ def _hasTeleMeth(self, name):
646
+ return self.methinfo.get(name) is not None
647
+
637
648
  def _getSynVers(self):
638
649
  '''
639
650
  Helper method to retrieve the remote Synapse version from Proxy.
@@ -906,6 +917,7 @@ class Proxy(s_base.Base):
906
917
 
907
918
  self.sess = self.synack[1].get('sess')
908
919
  self._ahainfo = self.synack[1].get('ahainfo', {})
920
+ self._features = self.synack[1].get('features', {})
909
921
  self.sharinfo = self.synack[1].get('sharinfo', {})
910
922
  self.methinfo = self.sharinfo.get('meths', {})
911
923