synapse 2.194.0__py311-none-any.whl → 2.195.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.
- synapse/cortex.py +6 -0
- synapse/datamodel.py +3 -3
- synapse/lib/auth.py +4 -2
- synapse/lib/link.py +33 -19
- synapse/lib/modelrev.py +6 -1
- synapse/lib/scrape.py +18 -1
- synapse/lib/stormlib/auth.py +15 -1
- synapse/lib/stormlib/cell.py +11 -0
- synapse/lib/stormlib/infosec.py +2 -0
- synapse/lib/version.py +2 -2
- synapse/models/geospace.py +52 -10
- synapse/models/infotech.py +2 -3
- synapse/models/material.py +67 -8
- synapse/models/orgs.py +4 -1
- synapse/models/person.py +13 -13
- synapse/models/risk.py +1 -1
- synapse/models/syn.py +3 -0
- synapse/models/transport.py +382 -49
- synapse/tests/test_cortex.py +4 -1
- synapse/tests/test_lib_cell.py +10 -0
- synapse/tests/test_lib_link.py +6 -1
- synapse/tests/test_lib_modelrev.py +7 -0
- synapse/tests/test_lib_scrape.py +8 -0
- synapse/tests/test_lib_stormlib_auth.py +26 -0
- synapse/tests/test_lib_stormlib_cell.py +3 -0
- synapse/tests/test_model_geospace.py +37 -4
- synapse/tests/test_model_infotech.py +21 -3
- synapse/tests/test_model_material.py +18 -0
- synapse/tests/test_model_orgs.py +8 -1
- synapse/tests/test_model_person.py +3 -0
- synapse/tests/test_model_syn.py +9 -3
- synapse/tests/test_model_transport.py +168 -0
- synapse/tests/test_telepath.py +24 -5
- synapse/tools/changelog.py +8 -1
- {synapse-2.194.0.dist-info → synapse-2.195.0.dist-info}/METADATA +1 -1
- {synapse-2.194.0.dist-info → synapse-2.195.0.dist-info}/RECORD +39 -39
- {synapse-2.194.0.dist-info → synapse-2.195.0.dist-info}/LICENSE +0 -0
- {synapse-2.194.0.dist-info → synapse-2.195.0.dist-info}/WHEEL +0 -0
- {synapse-2.194.0.dist-info → synapse-2.195.0.dist-info}/top_level.txt +0 -0
synapse/cortex.py
CHANGED
|
@@ -2860,6 +2860,12 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
|
|
|
2860
2860
|
cmdtext = cdef.get('storm')
|
|
2861
2861
|
await self.getStormQuery(cmdtext)
|
|
2862
2862
|
|
|
2863
|
+
if cdef.get('forms') is not None:
|
|
2864
|
+
name = cdef.get('name')
|
|
2865
|
+
mesg = f"Storm command definition 'forms' key is deprecated and will be removed " \
|
|
2866
|
+
f"in 3.0.0 (command {name} in package {pkgname})"
|
|
2867
|
+
logger.warning(mesg, extra=await self.getLogExtra(name=name, pkgname=pkgname))
|
|
2868
|
+
|
|
2863
2869
|
for gdef in pkgdef.get('graphs', ()):
|
|
2864
2870
|
gdef['iden'] = s_common.guid((pkgname, gdef.get('name')))
|
|
2865
2871
|
gdef['scope'] = 'power-up'
|
synapse/datamodel.py
CHANGED
|
@@ -583,11 +583,11 @@ class Model:
|
|
|
583
583
|
item = s_types.Array(self, 'array', info, {'type': 'int'})
|
|
584
584
|
self.addBaseType(item)
|
|
585
585
|
|
|
586
|
-
info = {'doc': 'An digraph edge base type.'}
|
|
586
|
+
info = {'doc': 'An digraph edge base type.', 'deprecated': True}
|
|
587
587
|
item = s_types.Edge(self, 'edge', info, {})
|
|
588
588
|
self.addBaseType(item)
|
|
589
589
|
|
|
590
|
-
info = {'doc': 'An digraph edge base type with a unique time.'}
|
|
590
|
+
info = {'doc': 'An digraph edge base type with a unique time.', 'deprecated': True}
|
|
591
591
|
item = s_types.TimeEdge(self, 'timeedge', info, {})
|
|
592
592
|
self.addBaseType(item)
|
|
593
593
|
|
|
@@ -1122,7 +1122,7 @@ class Model:
|
|
|
1122
1122
|
# warn but do not blow up. there may be extended model elements
|
|
1123
1123
|
# with {}s which are not used for templates...
|
|
1124
1124
|
if item.find('{') != -1: # pragma: no cover
|
|
1125
|
-
logger.warning(f'Missing template specifier in: {item}')
|
|
1125
|
+
logger.warning(f'Missing template specifier in: {item} on {form.name}')
|
|
1126
1126
|
|
|
1127
1127
|
return item
|
|
1128
1128
|
|
synapse/lib/auth.py
CHANGED
|
@@ -881,13 +881,14 @@ class Role(Ruler):
|
|
|
881
881
|
set of rules can be applied to multiple users.
|
|
882
882
|
'''
|
|
883
883
|
def pack(self):
|
|
884
|
-
|
|
884
|
+
ret = {
|
|
885
885
|
'type': 'role',
|
|
886
886
|
'iden': self.iden,
|
|
887
887
|
'name': self.name,
|
|
888
888
|
'rules': self.info.get('rules'),
|
|
889
889
|
'authgates': self.authgates,
|
|
890
890
|
}
|
|
891
|
+
return s_msgpack.deepcopy(ret)
|
|
891
892
|
|
|
892
893
|
async def _setRulrInfo(self, name, valu, gateiden=None, nexs=True, mesg=None):
|
|
893
894
|
if nexs:
|
|
@@ -956,7 +957,7 @@ class User(Ruler):
|
|
|
956
957
|
_roles.append(role.pack())
|
|
957
958
|
roles = _roles
|
|
958
959
|
|
|
959
|
-
|
|
960
|
+
ret = {
|
|
960
961
|
'type': 'user',
|
|
961
962
|
'iden': self.iden,
|
|
962
963
|
'name': self.name,
|
|
@@ -968,6 +969,7 @@ class User(Ruler):
|
|
|
968
969
|
'archived': self.info.get('archived'),
|
|
969
970
|
'authgates': self.authgates,
|
|
970
971
|
}
|
|
972
|
+
return s_msgpack.deepcopy(ret)
|
|
971
973
|
|
|
972
974
|
async def _setRulrInfo(self, name, valu, gateiden=None, nexs=True, mesg=None):
|
|
973
975
|
if nexs:
|
synapse/lib/link.py
CHANGED
|
@@ -15,7 +15,8 @@ import synapse.lib.base as s_base
|
|
|
15
15
|
import synapse.lib.const as s_const
|
|
16
16
|
import synapse.lib.msgpack as s_msgpack
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
READSIZE = 16 * s_const.mebibyte
|
|
19
|
+
MAXWRITE = 64 * s_const.mebibyte
|
|
19
20
|
|
|
20
21
|
async def connect(host, port, ssl=None, hostname=None, linkinfo=None):
|
|
21
22
|
'''
|
|
@@ -114,8 +115,8 @@ class Link(s_base.Base):
|
|
|
114
115
|
self.sock = self.writer.get_extra_info('socket')
|
|
115
116
|
self.peercert = self.writer.get_extra_info('peercert')
|
|
116
117
|
|
|
118
|
+
self._txlock = asyncio.Lock()
|
|
117
119
|
self._forceclose = forceclose
|
|
118
|
-
self._drain_lock = asyncio.Lock()
|
|
119
120
|
|
|
120
121
|
if info is None:
|
|
121
122
|
info = {}
|
|
@@ -234,11 +235,18 @@ class Link(s_base.Base):
|
|
|
234
235
|
return dict(self._addrinfo)
|
|
235
236
|
|
|
236
237
|
async def send(self, byts):
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
|
|
239
|
+
offs = 0
|
|
240
|
+
size = len(byts)
|
|
241
|
+
|
|
242
|
+
async with self._txlock:
|
|
243
|
+
|
|
244
|
+
while offs < size:
|
|
245
|
+
|
|
246
|
+
self.writer.write(byts[offs:offs + MAXWRITE])
|
|
247
|
+
offs += MAXWRITE
|
|
248
|
+
|
|
249
|
+
await self.writer.drain()
|
|
242
250
|
|
|
243
251
|
async def tx(self, mesg):
|
|
244
252
|
'''
|
|
@@ -247,23 +255,29 @@ class Link(s_base.Base):
|
|
|
247
255
|
if self.isfini:
|
|
248
256
|
raise s_exc.IsFini()
|
|
249
257
|
|
|
258
|
+
offs = 0
|
|
250
259
|
byts = s_msgpack.en(mesg)
|
|
251
|
-
|
|
260
|
+
size = len(byts)
|
|
252
261
|
|
|
253
|
-
|
|
254
|
-
# Avoid Python bug. See https://github.com/python/cpython/issues/74116
|
|
255
|
-
# TODO Remove drain lock in 3.10+
|
|
256
|
-
async with self._drain_lock:
|
|
257
|
-
await self.writer.drain()
|
|
262
|
+
async with self._txlock:
|
|
258
263
|
|
|
259
|
-
|
|
264
|
+
try:
|
|
265
|
+
|
|
266
|
+
while offs < size:
|
|
260
267
|
|
|
261
|
-
|
|
268
|
+
self.writer.write(byts[offs:offs + MAXWRITE])
|
|
269
|
+
offs += MAXWRITE
|
|
262
270
|
|
|
263
|
-
|
|
264
|
-
logger.debug('link.tx connection trouble %s', einfo)
|
|
271
|
+
await self.writer.drain()
|
|
265
272
|
|
|
266
|
-
|
|
273
|
+
except (asyncio.CancelledError, Exception) as e:
|
|
274
|
+
|
|
275
|
+
await self.fini()
|
|
276
|
+
|
|
277
|
+
einfo = s_common.retnexc(e)
|
|
278
|
+
logger.debug('link.tx connection trouble %s', einfo)
|
|
279
|
+
|
|
280
|
+
raise
|
|
267
281
|
|
|
268
282
|
def txfini(self):
|
|
269
283
|
self.sock.shutdown(1)
|
|
@@ -294,7 +308,7 @@ class Link(s_base.Base):
|
|
|
294
308
|
|
|
295
309
|
try:
|
|
296
310
|
|
|
297
|
-
byts = await self.reader.read(
|
|
311
|
+
byts = await self.reader.read(READSIZE)
|
|
298
312
|
if not byts:
|
|
299
313
|
await self.fini()
|
|
300
314
|
return None
|
synapse/lib/modelrev.py
CHANGED
|
@@ -13,7 +13,7 @@ import synapse.models.infotech as s_infotech
|
|
|
13
13
|
|
|
14
14
|
logger = logging.getLogger(__name__)
|
|
15
15
|
|
|
16
|
-
maxvers = (0, 2,
|
|
16
|
+
maxvers = (0, 2, 32)
|
|
17
17
|
|
|
18
18
|
class ModelRev:
|
|
19
19
|
|
|
@@ -50,6 +50,7 @@ class ModelRev:
|
|
|
50
50
|
((0, 2, 29), self.revModel_0_2_29),
|
|
51
51
|
((0, 2, 30), self.revModel_0_2_30),
|
|
52
52
|
((0, 2, 31), self.revModel_0_2_31),
|
|
53
|
+
((0, 2, 32), self.revModel_0_2_32),
|
|
53
54
|
)
|
|
54
55
|
|
|
55
56
|
async def _uniqSortArray(self, todoprops, layers):
|
|
@@ -815,6 +816,10 @@ class ModelRev:
|
|
|
815
816
|
await migr.revModel_0_2_31()
|
|
816
817
|
await self._normFormSubs(layers, 'it:sec:cpe')
|
|
817
818
|
|
|
819
|
+
async def revModel_0_2_32(self, layers):
|
|
820
|
+
await self._normPropValu(layers, 'transport:air:craft:model')
|
|
821
|
+
await self._normPropValu(layers, 'transport:sea:vessel:model')
|
|
822
|
+
|
|
818
823
|
async def runStorm(self, text, opts=None):
|
|
819
824
|
'''
|
|
820
825
|
Run storm code in a schedcoro and log the output messages.
|
synapse/lib/scrape.py
CHANGED
|
@@ -128,6 +128,8 @@ _cpe23_regex = r'''(?P<valu>cpe:2\.3:[aho\*-]
|
|
|
128
128
|
(?::(([?]+|\*)?([a-z0-9-._]|\\[\\?*!"#$%&\'()+,/:;<=>@\[\]^`{|}~])+([?]+|\*)?|[*-])){4})
|
|
129
129
|
'''
|
|
130
130
|
|
|
131
|
+
path_parts_limit = 1024
|
|
132
|
+
|
|
131
133
|
linux_path_regex = r'''
|
|
132
134
|
(?<![\w\d]+)
|
|
133
135
|
(?P<valu>
|
|
@@ -142,17 +144,23 @@ linux_path_rootdirs = (
|
|
|
142
144
|
'sys', 'tmp', 'usr', 'var'
|
|
143
145
|
)
|
|
144
146
|
|
|
147
|
+
# https://docs.kernel.org/filesystems/path-lookup.html#the-symlink-stack
|
|
148
|
+
linux_path_limit = 4096
|
|
149
|
+
|
|
145
150
|
def linux_path_check(match: regex.Match):
|
|
146
151
|
mnfo = match.groupdict()
|
|
147
152
|
valu = mnfo.get('valu')
|
|
148
153
|
|
|
154
|
+
if len(valu) > linux_path_limit:
|
|
155
|
+
return None, {}
|
|
156
|
+
|
|
149
157
|
path = pathlib.PurePosixPath(valu)
|
|
150
158
|
parts = path.parts
|
|
151
159
|
|
|
152
160
|
if parts[0] != '/':
|
|
153
161
|
return None, {}
|
|
154
162
|
|
|
155
|
-
if len(parts) < 2:
|
|
163
|
+
if len(parts) < 2 or len(parts) > path_parts_limit:
|
|
156
164
|
return None, {}
|
|
157
165
|
|
|
158
166
|
if parts[1] not in linux_path_rootdirs:
|
|
@@ -177,17 +185,26 @@ windows_path_reserved = (
|
|
|
177
185
|
|
|
178
186
|
windows_drive_paths = [f'{letter}:\\' for letter in string.ascii_lowercase]
|
|
179
187
|
|
|
188
|
+
# https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
|
|
189
|
+
windows_path_limit = 32_767
|
|
190
|
+
|
|
180
191
|
# https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
|
|
181
192
|
def windows_path_check(match: regex.Match):
|
|
182
193
|
mnfo = match.groupdict()
|
|
183
194
|
valu = mnfo.get('valu')
|
|
184
195
|
|
|
196
|
+
if len(valu) > windows_path_limit:
|
|
197
|
+
return None, {}
|
|
198
|
+
|
|
185
199
|
path = pathlib.PureWindowsPath(valu)
|
|
186
200
|
parts = path.parts
|
|
187
201
|
|
|
188
202
|
if parts[0].lower() not in windows_drive_paths:
|
|
189
203
|
return None, {}
|
|
190
204
|
|
|
205
|
+
if len(parts) > path_parts_limit:
|
|
206
|
+
return None, {}
|
|
207
|
+
|
|
191
208
|
for part in parts:
|
|
192
209
|
if part in windows_path_reserved:
|
|
193
210
|
return None, {}
|
synapse/lib/stormlib/auth.py
CHANGED
|
@@ -583,12 +583,26 @@ stormcmds = (
|
|
|
583
583
|
{
|
|
584
584
|
'name': 'auth.perms.list',
|
|
585
585
|
'descr': 'Display a list of the current permissions defined within the Cortex.',
|
|
586
|
-
'cmdargs': (
|
|
586
|
+
'cmdargs': (
|
|
587
|
+
('--find', {'type': 'str', 'help': 'A search string for permissions.'}),
|
|
588
|
+
),
|
|
587
589
|
'storm': '''
|
|
588
590
|
|
|
589
591
|
for $pdef in $lib.auth.getPermDefs() {
|
|
590
592
|
$perm = $lib.str.join(".", $pdef.perm)
|
|
591
593
|
|
|
594
|
+
if $cmdopts.find {
|
|
595
|
+
$find = $cmdopts.find.lower()
|
|
596
|
+
$match = (
|
|
597
|
+
$perm.lower().find($find) != (null) or
|
|
598
|
+
$pdef.desc.lower().find($find) != (null) or
|
|
599
|
+
$pdef.gate.lower().find($find) != (null) or
|
|
600
|
+
($pdef.ex and $pdef.ex.lower().find($find) != (null))
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
if (not $match) { continue }
|
|
604
|
+
}
|
|
605
|
+
|
|
592
606
|
$lib.print($perm)
|
|
593
607
|
$lib.print(` {$pdef.desc}`)
|
|
594
608
|
$lib.print(` gate: {$pdef.gate}`)
|
synapse/lib/stormlib/cell.py
CHANGED
|
@@ -120,6 +120,9 @@ class CellLib(s_stormtypes.Lib):
|
|
|
120
120
|
A Storm Library for interacting with the Cortex.
|
|
121
121
|
'''
|
|
122
122
|
_storm_locals = (
|
|
123
|
+
{'name': 'iden', 'desc': 'The Cortex service identifier.',
|
|
124
|
+
'type': {'type': 'gtor', '_gtorfunc': '_getCellIden',
|
|
125
|
+
'returns': {'type': 'str', 'desc': 'The Cortex service identifier.'}}},
|
|
123
126
|
{'name': 'getCellInfo', 'desc': 'Return metadata specific for the Cortex.',
|
|
124
127
|
'type': {'type': 'function', '_funcname': '_getCellInfo', 'args': (),
|
|
125
128
|
'returns': {'type': 'dict', 'desc': 'A dictionary containing metadata.', }}},
|
|
@@ -174,6 +177,10 @@ class CellLib(s_stormtypes.Lib):
|
|
|
174
177
|
)
|
|
175
178
|
_storm_lib_path = ('cell',)
|
|
176
179
|
|
|
180
|
+
def __init__(self, runt, name=()):
|
|
181
|
+
s_stormtypes.Lib.__init__(self, runt, name=name)
|
|
182
|
+
self.gtors['iden'] = self._getCellIden
|
|
183
|
+
|
|
177
184
|
def getObjLocals(self):
|
|
178
185
|
return {
|
|
179
186
|
'getCellInfo': self._getCellInfo,
|
|
@@ -187,6 +194,10 @@ class CellLib(s_stormtypes.Lib):
|
|
|
187
194
|
'uptime': self._uptime,
|
|
188
195
|
}
|
|
189
196
|
|
|
197
|
+
@s_stormtypes.stormfunc(readonly=True)
|
|
198
|
+
async def _getCellIden(self):
|
|
199
|
+
return self.runt.snap.core.getCellIden()
|
|
200
|
+
|
|
190
201
|
async def _hotFixesApply(self):
|
|
191
202
|
if not self.runt.isAdmin():
|
|
192
203
|
mesg = '$lib.cell.stormFixesApply() requires admin privs.'
|
synapse/lib/stormlib/infosec.py
CHANGED
|
@@ -515,6 +515,7 @@ class CvssLib(s_stormtypes.Lib):
|
|
|
515
515
|
'''
|
|
516
516
|
_storm_locals = (
|
|
517
517
|
{'name': 'calculate', 'desc': 'Calculate the CVSS score values for an input risk:vuln node.',
|
|
518
|
+
'deprecated': {'eolvers': 'v3.0.0'},
|
|
518
519
|
'type': {'type': 'function', '_funcname': 'calculate',
|
|
519
520
|
'args': (
|
|
520
521
|
{'name': 'node', 'type': 'node',
|
|
@@ -527,6 +528,7 @@ class CvssLib(s_stormtypes.Lib):
|
|
|
527
528
|
'returns': {'type': 'dict', 'desc': 'A dictionary containing the computed score and subscores.', }
|
|
528
529
|
}},
|
|
529
530
|
{'name': 'calculateFromProps', 'desc': 'Calculate the CVSS score values from a props dict.',
|
|
531
|
+
'deprecated': {'eolvers': 'v3.0.0'},
|
|
530
532
|
'type': {'type': 'function', '_funcname': 'calculateFromProps',
|
|
531
533
|
'args': (
|
|
532
534
|
{'name': 'props', 'type': 'dict',
|
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,
|
|
226
|
+
version = (2, 195, 0)
|
|
227
227
|
verstring = '.'.join([str(x) for x in version])
|
|
228
|
-
commit = '
|
|
228
|
+
commit = 'dc93864afdb2150e6d83ac4ed426c8e99bb3a448'
|
synapse/models/geospace.py
CHANGED
|
@@ -390,15 +390,49 @@ class GeoModule(s_module.CoreModule):
|
|
|
390
390
|
}),
|
|
391
391
|
),
|
|
392
392
|
|
|
393
|
+
'interfaces': (
|
|
394
|
+
('geo:locatable', {
|
|
395
|
+
'doc': 'Properties common to items and events which may be geolocated.',
|
|
396
|
+
'template': {'geo:locatable': 'item'},
|
|
397
|
+
'props': (
|
|
398
|
+
('place', ('geo:place', {}), {
|
|
399
|
+
'doc': 'The place where the {geo:locatable} was located.'}),
|
|
400
|
+
|
|
401
|
+
('place:loc', ('loc', {}), {
|
|
402
|
+
'doc': 'The geopolitical location of the {geo:locatable}.'}),
|
|
403
|
+
|
|
404
|
+
('place:name', ('geo:name', {}), {
|
|
405
|
+
'doc': 'The name of the place where the {geo:locatable} was located.'}),
|
|
406
|
+
|
|
407
|
+
('place:address', ('geo:address', {}), {
|
|
408
|
+
'doc': 'The postal address of the place where the {geo:locatable} was located.'}),
|
|
409
|
+
|
|
410
|
+
('place:latlong', ('geo:latlong', {}), {
|
|
411
|
+
'doc': 'The latlong where the {geo:locatable} was located.'}),
|
|
412
|
+
|
|
413
|
+
('place:latlong:accuracy', ('geo:dist', {}), {
|
|
414
|
+
'doc': 'The accuracy of the latlong where the {geo:locatable} was located.'}),
|
|
415
|
+
|
|
416
|
+
('place:country', ('pol:country', {}), {
|
|
417
|
+
'doc': 'The country where the {geo:locatable} was located.'}),
|
|
418
|
+
|
|
419
|
+
('place:country:code', ('pol:iso2', {}), {
|
|
420
|
+
'doc': 'The country code where the {geo:locatable} was located.'}),
|
|
421
|
+
),
|
|
422
|
+
}),
|
|
423
|
+
),
|
|
424
|
+
|
|
393
425
|
'types': (
|
|
394
426
|
|
|
395
427
|
('geo:nloc', ('comp', {'fields': (('ndef', 'ndef'), ('latlong', 'geo:latlong'), ('time', 'time'))}), {
|
|
396
428
|
'deprecated': True,
|
|
397
429
|
'doc': 'Records a node latitude/longitude in space-time.'
|
|
398
430
|
}),
|
|
431
|
+
|
|
399
432
|
('geo:telem', ('guid', {}), {
|
|
400
|
-
'
|
|
401
|
-
|
|
433
|
+
'interfaces': ('phys:object', 'geo:locatable'),
|
|
434
|
+
'template': {'phys:object': 'object', 'geo:locatable': 'object'},
|
|
435
|
+
'doc': 'The geospatial position and physical characteristics of a node at a given time.'}),
|
|
402
436
|
|
|
403
437
|
('geo:json', ('data', {'schema': geojsonschema}), {
|
|
404
438
|
'doc': 'GeoJSON structured JSON data.'}),
|
|
@@ -441,9 +475,11 @@ class GeoModule(s_module.CoreModule):
|
|
|
441
475
|
),
|
|
442
476
|
|
|
443
477
|
'edges': (
|
|
478
|
+
|
|
444
479
|
((None, 'seenat', 'geo:telem'), {
|
|
445
480
|
'deprecated': True,
|
|
446
|
-
'doc': 'Deprecated. Please use
|
|
481
|
+
'doc': 'Deprecated. Please use geo:telem:node.'}),
|
|
482
|
+
|
|
447
483
|
(('geo:place', 'contains', 'geo:place'), {
|
|
448
484
|
'doc': 'The source place completely contains the target place.'}),
|
|
449
485
|
),
|
|
@@ -475,18 +511,21 @@ class GeoModule(s_module.CoreModule):
|
|
|
475
511
|
)),
|
|
476
512
|
|
|
477
513
|
('geo:telem', {}, (
|
|
514
|
+
|
|
478
515
|
('time', ('time', {}), {
|
|
479
|
-
'doc': 'The time that the
|
|
516
|
+
'doc': 'The time that the telemetry measurements were taken.'}),
|
|
517
|
+
|
|
480
518
|
('desc', ('str', {}), {
|
|
481
519
|
'doc': 'A description of the telemetry sample.'}),
|
|
520
|
+
|
|
482
521
|
('latlong', ('geo:latlong', {}), {
|
|
483
|
-
'
|
|
522
|
+
'deprecated': True,
|
|
523
|
+
'doc': 'Deprecated. Please use :place:latlong.'}),
|
|
524
|
+
|
|
484
525
|
('accuracy', ('geo:dist', {}), {
|
|
485
|
-
'
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
('place:name', ('geo:name', {}), {
|
|
489
|
-
'doc': 'The purported place name. Used for entity resolution.'}),
|
|
526
|
+
'deprecated': True,
|
|
527
|
+
'doc': 'Deprecated. Please use :place:latlong:accuracy.'}),
|
|
528
|
+
|
|
490
529
|
('node', ('ndef', {}), {
|
|
491
530
|
'doc': 'The node that was observed at the associated time and place.'}),
|
|
492
531
|
)),
|
|
@@ -494,6 +533,9 @@ class GeoModule(s_module.CoreModule):
|
|
|
494
533
|
('geo:place:taxonomy', {}, ()),
|
|
495
534
|
('geo:place', {}, (
|
|
496
535
|
|
|
536
|
+
('id', ('str', {'strip': True}), {
|
|
537
|
+
'doc': 'A type specific identifier such as an airport ID.'}),
|
|
538
|
+
|
|
497
539
|
('name', ('geo:name', {}), {
|
|
498
540
|
'alts': ('names',),
|
|
499
541
|
'doc': 'The name of the place.'}),
|
synapse/models/infotech.py
CHANGED
|
@@ -652,10 +652,9 @@ class ItModule(s_module.CoreModule):
|
|
|
652
652
|
('it:hostname', ('str', {'strip': True, 'lower': True}), {
|
|
653
653
|
'doc': 'The name of a host or system.'}),
|
|
654
654
|
|
|
655
|
-
|
|
656
655
|
('it:host', ('guid', {}), {
|
|
657
|
-
'interfaces': ('inet:service:object',),
|
|
658
|
-
'template': {'service:base': 'host'},
|
|
656
|
+
'interfaces': ('inet:service:object', 'phys:object'),
|
|
657
|
+
'template': {'service:base': 'host', 'phys:object': 'physical host'},
|
|
659
658
|
'doc': 'A GUID that represents a host or system.'}),
|
|
660
659
|
|
|
661
660
|
('it:log:event:type:taxonomy', ('taxonomy', {}), {
|
synapse/models/material.py
CHANGED
|
@@ -31,37 +31,96 @@ class MatModule(s_module.CoreModule):
|
|
|
31
31
|
|
|
32
32
|
def getModelDefs(self):
|
|
33
33
|
modl = {
|
|
34
|
+
|
|
35
|
+
'interfaces': (
|
|
36
|
+
|
|
37
|
+
('phys:object', {
|
|
38
|
+
'doc': 'Properties common to all physical objects.',
|
|
39
|
+
'template': {'phys:object': 'object'},
|
|
40
|
+
'props': (
|
|
41
|
+
|
|
42
|
+
('phys:mass', ('mass', {}), {
|
|
43
|
+
'doc': 'The mass of the {phys:object}.'}),
|
|
44
|
+
|
|
45
|
+
('phys:volume', ('geo:dist', {}), {
|
|
46
|
+
'doc': 'The cubed volume of the {phys:object}.'}),
|
|
47
|
+
|
|
48
|
+
('phys:length', ('geo:dist', {}), {
|
|
49
|
+
'doc': 'The length of the {phys:object}.'}),
|
|
50
|
+
|
|
51
|
+
('phys:width', ('geo:dist', {}), {
|
|
52
|
+
'doc': 'The width of the {phys:object}.'}),
|
|
53
|
+
|
|
54
|
+
('phys:height', ('geo:dist', {}), {
|
|
55
|
+
'doc': 'The height of the {phys:object}.'}),
|
|
56
|
+
),
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
|
|
34
60
|
'types': (
|
|
35
|
-
|
|
61
|
+
|
|
62
|
+
('phys:object', ('ndef', {'interface': 'phys:object'}), {
|
|
63
|
+
'doc': 'A node which represents a physical object.'}),
|
|
64
|
+
|
|
65
|
+
('phys:contained:type:taxonomy', ('taxonomy', {}), {
|
|
66
|
+
'interfaces': ('meta:taxonomy',),
|
|
67
|
+
'doc': 'A taxonomy for types of contained relationships.'}),
|
|
68
|
+
|
|
69
|
+
('phys:contained', ('guid', {}), {
|
|
70
|
+
'doc': 'A node which represents a physical object containing another physical object.'}),
|
|
71
|
+
|
|
72
|
+
('mat:item', ('guid', {}), {
|
|
73
|
+
'interfaces': ('phys:object', 'geo:locatable'),
|
|
74
|
+
'template': {'phys:object': 'item', 'geo:locatable': 'item'},
|
|
75
|
+
'doc': 'A GUID assigned to a material object.'}),
|
|
76
|
+
|
|
36
77
|
('mat:type', ('taxonomy', {}), {
|
|
37
78
|
'doc': 'A taxonomy of material item/specification types.',
|
|
38
|
-
'interfaces': ('meta:taxonomy',),
|
|
39
|
-
|
|
79
|
+
'interfaces': ('meta:taxonomy',)}),
|
|
80
|
+
|
|
40
81
|
('mat:spec', ('guid', {}), {'doc': 'A GUID assigned to a material specification.'}),
|
|
41
82
|
('mat:specimage', ('comp', {'fields': (('spec', 'mat:spec'), ('file', 'file:bytes'))}), {}),
|
|
42
83
|
('mat:itemimage', ('comp', {'fields': (('item', 'mat:item'), ('file', 'file:bytes'))}), {}),
|
|
43
84
|
|
|
44
85
|
('mass', ('hugenum', {'units': massunits}), {
|
|
45
86
|
'doc': 'A mass which converts to grams as a base unit.'}),
|
|
46
|
-
# TODO add base type for volume
|
|
47
87
|
),
|
|
48
88
|
|
|
49
89
|
'forms': (
|
|
50
90
|
|
|
91
|
+
('phys:contained:type:taxonomy', {}, ()),
|
|
92
|
+
('phys:contained', {}, (
|
|
93
|
+
|
|
94
|
+
('type', ('phys:contained:type:taxonomy', {}), {
|
|
95
|
+
'doc': 'The type of container relationship.'}),
|
|
96
|
+
|
|
97
|
+
('period', ('ival', {}), {
|
|
98
|
+
'doc': 'The period where the container held the object.'}),
|
|
99
|
+
|
|
100
|
+
('object', ('phys:object', {}), {
|
|
101
|
+
'doc': 'The object held within the container.'}),
|
|
102
|
+
|
|
103
|
+
('container', ('phys:object', {}), {
|
|
104
|
+
'doc': 'The container which held the object.'}),
|
|
105
|
+
)),
|
|
51
106
|
('mat:item', {}, (
|
|
107
|
+
|
|
52
108
|
('name', ('str', {'lower': True}), {
|
|
53
109
|
'doc': 'The name of the material item.'}),
|
|
110
|
+
|
|
54
111
|
('type', ('mat:type', {}), {
|
|
55
112
|
'doc': 'The taxonomy type of the item.'}),
|
|
113
|
+
|
|
56
114
|
('spec', ('mat:spec', {}), {
|
|
57
115
|
'doc': 'The specification which defines this item.'}),
|
|
58
116
|
|
|
59
|
-
('
|
|
60
|
-
|
|
117
|
+
('latlong', ('geo:latlong', {}), {
|
|
118
|
+
'deprecated': True,
|
|
119
|
+
'doc': 'Deprecated. Please use :place:latlong.'}),
|
|
61
120
|
|
|
62
121
|
('loc', ('loc', {}), {
|
|
63
|
-
'
|
|
64
|
-
|
|
122
|
+
'deprecated': True,
|
|
123
|
+
'doc': 'Deprecated. Please use :place:loc.'}),
|
|
65
124
|
)),
|
|
66
125
|
|
|
67
126
|
('mat:spec', {}, (
|
synapse/models/orgs.py
CHANGED
|
@@ -484,8 +484,11 @@ class OuModule(s_module.CoreModule):
|
|
|
484
484
|
'doc': 'The org which issues id numbers of this type.',
|
|
485
485
|
}),
|
|
486
486
|
('name', ('str', {}), {
|
|
487
|
-
'
|
|
487
|
+
'alts': ('names',),
|
|
488
|
+
'doc': 'The friendly name of the ID number type.',
|
|
488
489
|
}),
|
|
490
|
+
('names', ('array', {'type': 'str', 'sorted': True, 'uniq': True}), {
|
|
491
|
+
'doc': 'An array of alternate names for the ID number type.'}),
|
|
489
492
|
('url', ('inet:url', {}), {
|
|
490
493
|
'doc': 'The official URL of the issuer.',
|
|
491
494
|
}),
|
synapse/models/person.py
CHANGED
|
@@ -22,24 +22,22 @@ class PsModule(s_module.CoreModule):
|
|
|
22
22
|
}),
|
|
23
23
|
('ps:name', ('str', {'lower': True, 'onespace': True}), {
|
|
24
24
|
'doc': 'An arbitrary, lower spaced string with normalized whitespace.',
|
|
25
|
-
'ex': 'robert grey'
|
|
26
|
-
|
|
25
|
+
'ex': 'robert grey'}),
|
|
26
|
+
|
|
27
27
|
('ps:person', ('guid', {}), {
|
|
28
|
-
'doc': 'A GUID for a person.',
|
|
29
|
-
|
|
28
|
+
'doc': 'A GUID for a person.'}),
|
|
29
|
+
|
|
30
30
|
('ps:persona', ('guid', {}), {
|
|
31
31
|
'deprecated': True,
|
|
32
|
-
'doc': '
|
|
33
|
-
|
|
32
|
+
'doc': 'Deprecated. Please use ps:contact.'}),
|
|
33
|
+
|
|
34
34
|
('ps:person:has', ('comp', {'fields': (('person', 'ps:person'), ('node', 'ndef'))}), {
|
|
35
35
|
'deprecated': True,
|
|
36
|
-
'doc': '
|
|
37
|
-
|
|
38
|
-
}),
|
|
36
|
+
'doc': 'Deprecated. Please use ps:person -(has)>.'}),
|
|
37
|
+
|
|
39
38
|
('ps:persona:has', ('comp', {'fields': (('persona', 'ps:persona'), ('node', 'ndef'))}), {
|
|
40
39
|
'deprecated': True,
|
|
41
|
-
'doc': '
|
|
42
|
-
' resource, potentially during a specific period of time.'}),
|
|
40
|
+
'doc': 'Deprecated. Please use ps:contact -(has)>.'}),
|
|
43
41
|
|
|
44
42
|
('ps:contact', ('guid', {}), {
|
|
45
43
|
'doc': 'A GUID for a contact info record.',
|
|
@@ -60,9 +58,11 @@ class PsModule(s_module.CoreModule):
|
|
|
60
58
|
'doc': 'A GUID for a list of associated contacts.',
|
|
61
59
|
}),
|
|
62
60
|
('ps:workhist', ('guid', {}), {
|
|
63
|
-
'doc': "
|
|
64
|
-
|
|
61
|
+
'doc': "An entry in a contact's work history."}),
|
|
62
|
+
|
|
65
63
|
('ps:vitals', ('guid', {}), {
|
|
64
|
+
'interfaces': ('phys:object',),
|
|
65
|
+
'template': {'phys:object': 'person'},
|
|
66
66
|
'doc': 'Statistics and demographic data about a person or contact.'}),
|
|
67
67
|
|
|
68
68
|
('ps:skill', ('guid', {}), {
|
synapse/models/risk.py
CHANGED
|
@@ -88,7 +88,7 @@ class RiskModule(s_module.CoreModule):
|
|
|
88
88
|
'doc': 'An instance of an alert which indicates the presence of a risk.',
|
|
89
89
|
}),
|
|
90
90
|
('risk:compromise', ('guid', {}), {
|
|
91
|
-
'doc': '
|
|
91
|
+
'doc': 'A compromise and its aggregate impact. The compromise is the result of a successful attack.',
|
|
92
92
|
'display': {
|
|
93
93
|
'columns': (
|
|
94
94
|
{'type': 'prop', 'opts': {'name': 'name'}},
|
synapse/models/syn.py
CHANGED
|
@@ -341,10 +341,13 @@ class SynModule(s_module.CoreModule):
|
|
|
341
341
|
('svciden', ('guid', {'strip': True}), {
|
|
342
342
|
'doc': 'Storm service iden which provided the package.'}),
|
|
343
343
|
('input', ('array', {'type': 'syn:form'}), {
|
|
344
|
+
'deprecated': True,
|
|
344
345
|
'doc': 'The list of forms accepted by the command as input.', 'uniq': True, 'sorted': True, 'ro': True}),
|
|
345
346
|
('output', ('array', {'type': 'syn:form'}), {
|
|
347
|
+
'deprecated': True,
|
|
346
348
|
'doc': 'The list of forms produced by the command as output.', 'uniq': True, 'sorted': True, 'ro': True}),
|
|
347
349
|
('nodedata', ('array', {'type': 'syn:nodedata'}), {
|
|
350
|
+
'deprecated': True,
|
|
348
351
|
'doc': 'The list of nodedata that may be added by the command.', 'uniq': True, 'sorted': True, 'ro': True}),
|
|
349
352
|
)),
|
|
350
353
|
),
|