synapse 2.188.0__py311-none-any.whl → 2.189.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/lib/drive.py CHANGED
@@ -505,7 +505,7 @@ class Drive(s_base.Base):
505
505
  def getTypeSchema(self, typename):
506
506
  byts = self.slab.get(LKEY_TYPE + typename.encode(), db=self.dbname)
507
507
  if byts is not None:
508
- return s_msgpack.un(byts)
508
+ return s_msgpack.un(byts, use_list=True)
509
509
 
510
510
  def getTypeSchemaVersion(self, typename):
511
511
  verskey = LKEY_TYPE_VERS + typename.encode()
synapse/lib/storm.py CHANGED
@@ -626,7 +626,7 @@ stormcmds = (
626
626
  {
627
627
  'name': 'feed.list',
628
628
  'descr': 'List the feed functions available in the Cortex',
629
- 'cmdrargs': (),
629
+ 'cmdargs': (),
630
630
  'storm': '''
631
631
  $lib.print('Storm feed list:')
632
632
  for $flinfo in $lib.feed.list() {
@@ -824,19 +824,51 @@ stormcmds = (
824
824
  {
825
825
  'name': 'pkg.list',
826
826
  'descr': 'List the storm packages loaded in the cortex.',
827
- 'cmdrargs': (),
827
+ 'cmdargs': (
828
+ ('--verbose', {'default': False, 'action': 'store_true',
829
+ 'help': 'Display build time for each package.'}),
830
+ ),
828
831
  'storm': '''
829
- $pkgs = $lib.pkg.list()
830
-
831
- if $($pkgs.size() = 0) {
832
+ init {
833
+ $conf = ({
834
+ "columns": [
835
+ {"name": "name", "width": 40},
836
+ {"name": "vers", "width": 10},
837
+ ],
838
+ "separators": {
839
+ "row:outline": false,
840
+ "column:outline": false,
841
+ "header:row": "#",
842
+ "data:row": "",
843
+ "column": "",
844
+ },
845
+ })
846
+ if $cmdopts.verbose {
847
+ $conf.columns.append(({"name": "time", "width": 20}))
848
+ }
849
+ $printer = $lib.tabular.printer($conf)
850
+ }
832
851
 
833
- $lib.print('No storm packages installed.')
852
+ $pkgs = $lib.pkg.list()
834
853
 
835
- } else {
854
+ if $($pkgs.size() > 0) {
836
855
  $lib.print('Loaded storm packages:')
856
+ $lib.print($printer.header())
837
857
  for $pkg in $pkgs {
838
- $lib.print("{name}: {vers}", name=$pkg.name.ljust(32), vers=$pkg.version)
858
+ $row = (
859
+ $pkg.name, $pkg.version,
860
+ )
861
+ if $cmdopts.verbose {
862
+ try {
863
+ $row.append($lib.time.format($pkg.build.time, '%Y-%m-%d %H:%M:%S'))
864
+ } catch StormRuntimeError as _ {
865
+ $row.append('not available')
866
+ }
867
+ }
868
+ $lib.print($printer.row($row))
839
869
  }
870
+ } else {
871
+ $lib.print('No storm packages installed.')
840
872
  }
841
873
  '''
842
874
  },
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, 188, 0)
226
+ version = (2, 189, 0)
227
227
  verstring = '.'.join([str(x) for x in version])
228
- commit = '6d1f734406234e3750c72f5bf299f89a13d0825a'
228
+ commit = '0cec341c3b35e19b0cb34c1d5210afb0790cba99'
synapse/models/risk.py CHANGED
@@ -709,6 +709,9 @@ class RiskModule(s_module.CoreModule):
709
709
  ('vuln', ('risk:vuln', {}), {
710
710
  'doc': 'The vulnerability that the node is susceptible to.'}),
711
711
 
712
+ ('technique', ('ou:technique', {}), {
713
+ 'doc': 'The technique that the node is susceptible to.'}),
714
+
712
715
  ('period', ('ival', {}), {
713
716
  'doc': 'The time window where the node was vulnerable.'}),
714
717
 
@@ -1351,7 +1351,7 @@ class AstTest(s_test.SynTest):
1351
1351
  {n.ndef for n in nodes})
1352
1352
 
1353
1353
  msgs = await core.stormlist('pkg.list')
1354
- self.stormIsInPrint('foo : 0.0.1', msgs)
1354
+ self.stormIsInPrint('foo 0.0.1', msgs, whitespace=False)
1355
1355
 
1356
1356
  msgs = await core.stormlist('pkg.del asdf')
1357
1357
  self.stormIsInPrint('No package names match "asdf". Aborting.', msgs)
@@ -29,6 +29,7 @@ import synapse.lib.coro as s_coro
29
29
  import synapse.lib.link as s_link
30
30
  import synapse.lib.drive as s_drive
31
31
  import synapse.lib.nexus as s_nexus
32
+ import synapse.lib.config as s_config
32
33
  import synapse.lib.certdir as s_certdir
33
34
  import synapse.lib.msgpack as s_msgpack
34
35
  import synapse.lib.version as s_version
@@ -160,8 +161,9 @@ testDataSchema_v0 = {
160
161
  'properties': {
161
162
  'type': {'type': 'string'},
162
163
  'size': {'type': 'number'},
164
+ 'stuff': {'type': ['number', 'null'], 'default': None}
163
165
  },
164
- 'required': ['type', 'size'],
166
+ 'required': ['type', 'size', 'stuff'],
165
167
  'additionalProperties': False,
166
168
  }
167
169
 
@@ -170,6 +172,7 @@ testDataSchema_v1 = {
170
172
  'properties': {
171
173
  'type': {'type': 'string'},
172
174
  'size': {'type': 'number'},
175
+ 'stuff': {'type': ['number', 'null'], 'default': None},
173
176
  'woot': {'type': 'string'},
174
177
  },
175
178
  'required': ['type', 'size', 'woot'],
@@ -180,202 +183,210 @@ class CellTest(s_t_utils.SynTest):
180
183
 
181
184
  async def test_cell_drive(self):
182
185
 
183
- async with self.getTestCell() as cell:
184
-
185
- with self.raises(s_exc.BadName):
186
- s_drive.reqValidName('A' * 512)
187
-
188
- info = {'name': 'users'}
189
- pathinfo = await cell.addDriveItem(info)
190
-
191
- info = {'name': 'root'}
192
- pathinfo = await cell.addDriveItem(info, path='users')
193
-
194
- with self.raises(s_exc.DupIden):
195
- await cell.drive.addItemInfo(pathinfo[-1], path='users')
196
-
197
- rootdir = pathinfo[-1].get('iden')
198
- self.eq(0, pathinfo[-1].get('kids'))
199
-
200
- info = {'name': 'win32k.sys', 'type': 'hehe'}
201
- with self.raises(s_exc.NoSuchType):
202
- info = await cell.addDriveItem(info, reldir=rootdir)
186
+ with self.getTestDir() as dirn:
187
+ async with self.getTestCell(dirn=dirn) as cell:
203
188
 
204
- infos = [i async for i in cell.getDriveKids(s_drive.rootdir)]
205
- self.len(1, infos)
206
- self.eq(1, infos[0].get('kids'))
207
- self.eq('users', infos[0].get('name'))
189
+ with self.raises(s_exc.BadName):
190
+ s_drive.reqValidName('A' * 512)
208
191
 
209
- # TODO how to handle iden match with additional property mismatch
192
+ info = {'name': 'users'}
193
+ pathinfo = await cell.addDriveItem(info)
210
194
 
211
- self.true(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=0))
212
- self.true(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=1))
213
- self.false(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=1))
195
+ info = {'name': 'root'}
196
+ pathinfo = await cell.addDriveItem(info, path='users')
214
197
 
215
- with self.raises(s_exc.BadVersion):
216
- await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=0)
198
+ with self.raises(s_exc.DupIden):
199
+ await cell.drive.addItemInfo(pathinfo[-1], path='users')
217
200
 
218
- info = {'name': 'win32k.sys', 'type': 'woot'}
219
- info = await cell.addDriveItem(info, reldir=rootdir)
201
+ rootdir = pathinfo[-1].get('iden')
202
+ self.eq(0, pathinfo[-1].get('kids'))
220
203
 
221
- iden = info[-1].get('iden')
204
+ info = {'name': 'win32k.sys', 'type': 'hehe'}
205
+ with self.raises(s_exc.NoSuchType):
206
+ info = await cell.addDriveItem(info, reldir=rootdir)
222
207
 
223
- tick = s_common.now()
224
- rootuser = cell.auth.rootuser.iden
208
+ infos = [i async for i in cell.getDriveKids(s_drive.rootdir)]
209
+ self.len(1, infos)
210
+ self.eq(1, infos[0].get('kids'))
211
+ self.eq('users', infos[0].get('name'))
225
212
 
226
- with self.raises(s_exc.SchemaViolation):
227
- versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
228
- await cell.setDriveData(iden, versinfo, {'newp': 'newp'})
229
-
230
- versinfo = {'version': (1, 1, 0), 'updated': tick + 10, 'updater': rootuser}
231
- info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'haha', 'size': 20})
232
- self.eq(info.get('version'), (1, 1, 0))
233
- self.eq(versinfo.get('version'), (1, 1, 0))
234
-
235
- versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
236
- info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'hehe', 'size': 0})
237
- self.eq(info.get('version'), (1, 1, 0))
238
- self.eq(versinfo.get('version'), (1, 0, 0))
239
-
240
- versinfo10, data10 = await cell.getDriveData(iden, vers=(1, 0, 0))
241
- self.eq(versinfo10.get('updated'), tick)
242
- self.eq(versinfo10.get('updater'), rootuser)
243
- self.eq(versinfo10.get('version'), (1, 0, 0))
244
-
245
- versinfo11, data11 = await cell.getDriveData(iden, vers=(1, 1, 0))
246
- self.eq(versinfo11.get('updated'), tick + 10)
247
- self.eq(versinfo11.get('updater'), rootuser)
248
- self.eq(versinfo11.get('version'), (1, 1, 0))
249
-
250
- versions = [vers async for vers in cell.getDriveDataVersions(iden)]
251
- self.len(2, versions)
252
- self.eq(versions[0], versinfo11)
253
- self.eq(versions[1], versinfo10)
254
-
255
- info = await cell.delDriveData(iden, vers=(0, 0, 0))
256
-
257
- versions = [vers async for vers in cell.getDriveDataVersions(iden)]
258
- self.len(2, versions)
259
- self.eq(versions[0], versinfo11)
260
- self.eq(versions[1], versinfo10)
261
-
262
- info = await cell.delDriveData(iden, vers=(1, 1, 0))
263
- self.eq(info.get('updated'), tick)
264
- self.eq(info.get('version'), (1, 0, 0))
265
-
266
- info = await cell.delDriveData(iden, vers=(1, 0, 0))
267
- self.eq(info.get('size'), 0)
268
- self.eq(info.get('version'), (0, 0, 0))
269
- self.none(info.get('updated'))
270
- self.none(info.get('updater'))
271
-
272
- # repopulate a couple data versions to test migration and delete
273
- versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
274
- info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'hehe', 'size': 0})
275
- versinfo = {'version': (1, 1, 0), 'updated': tick + 10, 'updater': rootuser}
276
- info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'haha', 'size': 17})
277
- self.eq(versinfo, (await cell.getDriveData(iden))[0])
278
-
279
- # This will be done by the cell in a cell storage version migration...
280
- async def migrate_v1(info, versinfo, data):
281
- data['woot'] = 'woot'
282
- return data
283
-
284
- await cell.drive.setTypeSchema('woot', testDataSchema_v1, migrate_v1)
285
-
286
- versinfo, data = await cell.getDriveData(iden, vers=(1, 0, 0))
287
- self.eq('woot', data.get('woot'))
288
-
289
- versinfo, data = await cell.getDriveData(iden, vers=(1, 1, 0))
290
- self.eq('woot', data.get('woot'))
213
+ # TODO how to handle iden match with additional property mismatch
291
214
 
292
- with self.raises(s_exc.NoSuchIden):
293
- await cell.reqDriveInfo('d7d6107b200e2c039540fc627bc5537d')
215
+ self.true(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=0))
216
+ self.true(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=1))
217
+ self.false(await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=1))
294
218
 
295
- with self.raises(s_exc.TypeMismatch):
296
- await cell.getDriveInfo(iden, typename='newp')
219
+ with self.raises(s_exc.BadVersion):
220
+ await cell.drive.setTypeSchema('woot', testDataSchema_v0, vers=0)
297
221
 
298
- self.nn(await cell.getDriveInfo(iden))
299
- self.len(2, [vers async for vers in cell.getDriveDataVersions(iden)])
222
+ info = {'name': 'win32k.sys', 'type': 'woot'}
223
+ info = await cell.addDriveItem(info, reldir=rootdir)
300
224
 
301
- await cell.delDriveData(iden)
302
- self.len(1, [vers async for vers in cell.getDriveDataVersions(iden)])
225
+ iden = info[-1].get('iden')
303
226
 
304
- await cell.delDriveInfo(iden)
227
+ tick = s_common.now()
228
+ rootuser = cell.auth.rootuser.iden
305
229
 
306
- self.none(await cell.getDriveInfo(iden))
307
- self.len(0, [vers async for vers in cell.getDriveDataVersions(iden)])
230
+ with self.raises(s_exc.SchemaViolation):
231
+ versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
232
+ await cell.setDriveData(iden, versinfo, {'newp': 'newp'})
308
233
 
309
- with self.raises(s_exc.NoSuchPath):
310
- await cell.getDrivePath('users/root/win32k.sys')
234
+ versinfo = {'version': (1, 1, 0), 'updated': tick + 10, 'updater': rootuser}
235
+ info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'haha', 'size': 20, 'stuff': 12})
236
+ self.eq(info.get('version'), (1, 1, 0))
237
+ self.eq(versinfo.get('version'), (1, 1, 0))
311
238
 
312
- pathinfo = await cell.addDrivePath('foo/bar/baz')
313
- self.len(3, pathinfo)
314
- self.eq('foo', pathinfo[0].get('name'))
315
- self.eq(1, pathinfo[0].get('kids'))
316
- self.eq('bar', pathinfo[1].get('name'))
317
- self.eq(1, pathinfo[1].get('kids'))
318
- self.eq('baz', pathinfo[2].get('name'))
319
- self.eq(0, pathinfo[2].get('kids'))
239
+ versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
240
+ info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'hehe', 'size': 0, 'stuff': 13})
241
+ self.eq(info.get('version'), (1, 1, 0))
242
+ self.eq(versinfo.get('version'), (1, 0, 0))
243
+
244
+ versinfo10, data10 = await cell.getDriveData(iden, vers=(1, 0, 0))
245
+ self.eq(versinfo10.get('updated'), tick)
246
+ self.eq(versinfo10.get('updater'), rootuser)
247
+ self.eq(versinfo10.get('version'), (1, 0, 0))
248
+
249
+ versinfo11, data11 = await cell.getDriveData(iden, vers=(1, 1, 0))
250
+ self.eq(versinfo11.get('updated'), tick + 10)
251
+ self.eq(versinfo11.get('updater'), rootuser)
252
+ self.eq(versinfo11.get('version'), (1, 1, 0))
253
+
254
+ versions = [vers async for vers in cell.getDriveDataVersions(iden)]
255
+ self.len(2, versions)
256
+ self.eq(versions[0], versinfo11)
257
+ self.eq(versions[1], versinfo10)
258
+
259
+ info = await cell.delDriveData(iden, vers=(0, 0, 0))
260
+
261
+ versions = [vers async for vers in cell.getDriveDataVersions(iden)]
262
+ self.len(2, versions)
263
+ self.eq(versions[0], versinfo11)
264
+ self.eq(versions[1], versinfo10)
265
+
266
+ info = await cell.delDriveData(iden, vers=(1, 1, 0))
267
+ self.eq(info.get('updated'), tick)
268
+ self.eq(info.get('version'), (1, 0, 0))
269
+
270
+ info = await cell.delDriveData(iden, vers=(1, 0, 0))
271
+ self.eq(info.get('size'), 0)
272
+ self.eq(info.get('version'), (0, 0, 0))
273
+ self.none(info.get('updated'))
274
+ self.none(info.get('updater'))
275
+
276
+ # repopulate a couple data versions to test migration and delete
277
+ versinfo = {'version': (1, 0, 0), 'updated': tick, 'updater': rootuser}
278
+ info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'hehe', 'size': 0, 'stuff': 14})
279
+ versinfo = {'version': (1, 1, 0), 'updated': tick + 10, 'updater': rootuser}
280
+ info, versinfo = await cell.setDriveData(iden, versinfo, {'type': 'haha', 'size': 17, 'stuff': 15})
281
+ self.eq(versinfo, (await cell.getDriveData(iden))[0])
320
282
 
321
- self.eq(pathinfo, await cell.addDrivePath('foo/bar/baz'))
283
+ # This will be done by the cell in a cell storage version migration...
284
+ async def migrate_v1(info, versinfo, data):
285
+ data['woot'] = 'woot'
286
+ return data
322
287
 
323
- baziden = pathinfo[2].get('iden')
324
- self.eq(pathinfo, await cell.drive.getItemPath(baziden))
288
+ await cell.drive.setTypeSchema('woot', testDataSchema_v1, migrate_v1)
325
289
 
326
- info = await cell.setDriveInfoPerm(baziden, {'users': {rootuser: 3}, 'roles': {}})
327
- self.eq(3, info['perm']['users'][rootuser])
290
+ versinfo, data = await cell.getDriveData(iden, vers=(1, 0, 0))
291
+ self.eq('woot', data.get('woot'))
328
292
 
329
- with self.raises(s_exc.NoSuchIden):
330
- # s_drive.rootdir is all 00s... ;)
331
- await cell.setDriveInfoPerm(s_drive.rootdir, {'users': {}, 'roles': {}})
293
+ versinfo, data = await cell.getDriveData(iden, vers=(1, 1, 0))
294
+ self.eq('woot', data.get('woot'))
332
295
 
333
- await cell.addDrivePath('hehe/haha')
334
- pathinfo = await cell.setDriveInfoPath(baziden, 'hehe/haha/hoho')
296
+ with self.raises(s_exc.NoSuchIden):
297
+ await cell.reqDriveInfo('d7d6107b200e2c039540fc627bc5537d')
335
298
 
336
- self.eq('hoho', pathinfo[-1].get('name'))
337
- self.eq(baziden, pathinfo[-1].get('iden'))
299
+ with self.raises(s_exc.TypeMismatch):
300
+ await cell.getDriveInfo(iden, typename='newp')
338
301
 
339
- self.true(await cell.drive.hasPathInfo('hehe/haha/hoho'))
340
- self.false(await cell.drive.hasPathInfo('foo/bar/baz'))
302
+ self.nn(await cell.getDriveInfo(iden))
303
+ self.len(2, [vers async for vers in cell.getDriveDataVersions(iden)])
341
304
 
342
- pathinfo = await cell.getDrivePath('foo/bar')
343
- self.eq(0, pathinfo[-1].get('kids'))
305
+ await cell.delDriveData(iden)
306
+ self.len(1, [vers async for vers in cell.getDriveDataVersions(iden)])
344
307
 
345
- pathinfo = await cell.getDrivePath('hehe/haha')
346
- self.eq(1, pathinfo[-1].get('kids'))
308
+ await cell.delDriveInfo(iden)
347
309
 
348
- with self.raises(s_exc.DupName):
349
- iden = pathinfo[-2].get('iden')
350
- name = pathinfo[-1].get('name')
351
- cell.drive.reqFreeStep(iden, name)
310
+ self.none(await cell.getDriveInfo(iden))
311
+ self.len(0, [vers async for vers in cell.getDriveDataVersions(iden)])
352
312
 
353
- walks = [item async for item in cell.drive.walkPathInfo('hehe')]
354
- self.len(3, walks)
355
- # confirm walked paths are yielded depth first...
356
- self.eq('hoho', walks[0].get('name'))
357
- self.eq('haha', walks[1].get('name'))
358
- self.eq('hehe', walks[2].get('name'))
313
+ with self.raises(s_exc.NoSuchPath):
314
+ await cell.getDrivePath('users/root/win32k.sys')
359
315
 
360
- iden = walks[2].get('iden')
361
- walks = [item async for item in cell.drive.walkItemInfo(iden)]
362
- self.len(3, walks)
363
- self.eq('hoho', walks[0].get('name'))
364
- self.eq('haha', walks[1].get('name'))
365
- self.eq('hehe', walks[2].get('name'))
316
+ pathinfo = await cell.addDrivePath('foo/bar/baz')
317
+ self.len(3, pathinfo)
318
+ self.eq('foo', pathinfo[0].get('name'))
319
+ self.eq(1, pathinfo[0].get('kids'))
320
+ self.eq('bar', pathinfo[1].get('name'))
321
+ self.eq(1, pathinfo[1].get('kids'))
322
+ self.eq('baz', pathinfo[2].get('name'))
323
+ self.eq(0, pathinfo[2].get('kids'))
366
324
 
367
- self.none(cell.drive.getTypeSchema('newp'))
325
+ self.eq(pathinfo, await cell.addDrivePath('foo/bar/baz'))
368
326
 
369
- cell.drive.validators.pop('woot')
370
- self.nn(cell.drive.getTypeValidator('woot'))
327
+ baziden = pathinfo[2].get('iden')
328
+ self.eq(pathinfo, await cell.drive.getItemPath(baziden))
371
329
 
372
- # move to root dir
373
- pathinfo = await cell.setDriveInfoPath(baziden, 'zipzop')
374
- self.len(1, pathinfo)
375
- self.eq(s_drive.rootdir, pathinfo[-1].get('parent'))
330
+ info = await cell.setDriveInfoPerm(baziden, {'users': {rootuser: 3}, 'roles': {}})
331
+ self.eq(3, info['perm']['users'][rootuser])
376
332
 
377
- pathinfo = await cell.setDriveInfoPath(baziden, 'hehe/haha/hoho')
378
- self.len(3, pathinfo)
333
+ with self.raises(s_exc.NoSuchIden):
334
+ # s_drive.rootdir is all 00s... ;)
335
+ await cell.setDriveInfoPerm(s_drive.rootdir, {'users': {}, 'roles': {}})
336
+
337
+ await cell.addDrivePath('hehe/haha')
338
+ pathinfo = await cell.setDriveInfoPath(baziden, 'hehe/haha/hoho')
339
+
340
+ self.eq('hoho', pathinfo[-1].get('name'))
341
+ self.eq(baziden, pathinfo[-1].get('iden'))
342
+
343
+ self.true(await cell.drive.hasPathInfo('hehe/haha/hoho'))
344
+ self.false(await cell.drive.hasPathInfo('foo/bar/baz'))
345
+
346
+ pathinfo = await cell.getDrivePath('foo/bar')
347
+ self.eq(0, pathinfo[-1].get('kids'))
348
+
349
+ pathinfo = await cell.getDrivePath('hehe/haha')
350
+ self.eq(1, pathinfo[-1].get('kids'))
351
+
352
+ with self.raises(s_exc.DupName):
353
+ iden = pathinfo[-2].get('iden')
354
+ name = pathinfo[-1].get('name')
355
+ cell.drive.reqFreeStep(iden, name)
356
+
357
+ walks = [item async for item in cell.drive.walkPathInfo('hehe')]
358
+ self.len(3, walks)
359
+ # confirm walked paths are yielded depth first...
360
+ self.eq('hoho', walks[0].get('name'))
361
+ self.eq('haha', walks[1].get('name'))
362
+ self.eq('hehe', walks[2].get('name'))
363
+
364
+ iden = walks[2].get('iden')
365
+ walks = [item async for item in cell.drive.walkItemInfo(iden)]
366
+ self.len(3, walks)
367
+ self.eq('hoho', walks[0].get('name'))
368
+ self.eq('haha', walks[1].get('name'))
369
+ self.eq('hehe', walks[2].get('name'))
370
+
371
+ self.none(cell.drive.getTypeSchema('newp'))
372
+
373
+ cell.drive.validators.pop('woot')
374
+ self.nn(cell.drive.getTypeValidator('woot'))
375
+
376
+ # move to root dir
377
+ pathinfo = await cell.setDriveInfoPath(baziden, 'zipzop')
378
+ self.len(1, pathinfo)
379
+ self.eq(s_drive.rootdir, pathinfo[-1].get('parent'))
380
+
381
+ pathinfo = await cell.setDriveInfoPath(baziden, 'hehe/haha/hoho')
382
+ self.len(3, pathinfo)
383
+
384
+ async with self.getTestCell(dirn=dirn) as cell:
385
+ data = {'type': 'woot', 'size': 20, 'stuff': 12, 'woot': 'woot'}
386
+ # explicitly clear out the cache JsValidators, otherwise we get the cached, pre-msgpack
387
+ # version of the validator, which will be correct and skip the point of this test.
388
+ s_config._JsValidators.clear()
389
+ cell.drive.reqValidData('woot', data)
379
390
 
380
391
  async def test_cell_auth(self):
381
392
 
@@ -862,8 +862,8 @@ class StormTest(s_t_utils.SynTest):
862
862
  pkg1 = {'name': 'haha', 'version': '1.2.3'}
863
863
  await core.addStormPkg(pkg1)
864
864
  msgs = await core.stormlist('pkg.list')
865
- self.isin('haha', msgs[2][1]['mesg'])
866
- self.isin('hehe', msgs[3][1]['mesg'])
865
+ self.stormIsInPrint('haha', msgs)
866
+ self.stormIsInPrint('hehe', msgs)
867
867
 
868
868
  self.true(await core.callStorm('return($lib.pkg.has(haha))'))
869
869
 
@@ -871,6 +871,15 @@ class StormTest(s_t_utils.SynTest):
871
871
  self.none(await core.callStorm('return($lib.pkg.get(haha))'))
872
872
  self.false(await core.callStorm('return($lib.pkg.has(haha))'))
873
873
 
874
+ msgs = await core.stormlist('pkg.list --verbose')
875
+ self.stormIsInPrint('not available', msgs)
876
+
877
+ pkg2 = {'name': 'hoho', 'version': '4.5.6', 'build': {'time': 1732017600000}}
878
+ await core.addStormPkg(pkg2)
879
+ self.eq('4.5.6', await core.callStorm('return($lib.pkg.get(hoho).version)'))
880
+ msgs = await core.stormlist('pkg.list --verbose')
881
+ self.stormIsInPrint('2024-11-19 12:00:00', msgs)
882
+
874
883
  # test for $lib.queue.gen()
875
884
  self.eq(0, await core.callStorm('return($lib.queue.gen(woot).size())'))
876
885
  # and again to test *not* creating it...
@@ -523,6 +523,7 @@ class RiskModelTest(s_t_utils.SynTest):
523
523
  :period=(2022, ?)
524
524
  :node=(inet:fqdn, vertex.link)
525
525
  :vuln={[ risk:vuln=* :name=redtree ]}
526
+ :technique={[ ou:technique=* :name=foo ]}
526
527
  :mitigated=true
527
528
  :mitigations={[ risk:mitigation=* :name=patchstuff ]}
528
529
  ]
@@ -535,6 +536,7 @@ class RiskModelTest(s_t_utils.SynTest):
535
536
  self.len(1, await core.nodes('risk:vulnerable -> risk:vuln'))
536
537
  self.len(1, await core.nodes('risk:vuln:name=redtree -> risk:vulnerable :node -> *'))
537
538
  self.len(1, await core.nodes('risk:vulnerable -> risk:mitigation'))
539
+ self.len(1, await core.nodes('risk:vulnerable -> ou:technique'))
538
540
 
539
541
  nodes = await core.nodes('''
540
542
  [ risk:outage=*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: synapse
3
- Version: 2.188.0
3
+ Version: 2.189.0
4
4
  Summary: Synapse Intelligence Analysis Framework
5
5
  Author-email: The Vertex Project LLC <root@vertex.link>
6
6
  License: Apache License 2.0
@@ -101,7 +101,7 @@ synapse/lib/config.py,sha256=2EBZcxXFVLBA7x1rtPNGmK91jqcJR-iOVU8rDzKokHQ,15830
101
101
  synapse/lib/const.py,sha256=uf-_iCXcNo85IIZss-yKTkbIe6fBAJ4n5v4Ntf0J104,1274
102
102
  synapse/lib/coro.py,sha256=o-ZrlfJALlCB30PrXOKT_ojjJ51QIezCm0vmDERSqic,11402
103
103
  synapse/lib/datfile.py,sha256=vKqSp7GTMUCYTbthbZ1EaGD8l73LYft6y7hKRuH3T74,620
104
- synapse/lib/drive.py,sha256=j9Z-WVAIXmabT-Y38ofKsJwOBkT83qcXkGMTMD7fNxc,18370
104
+ synapse/lib/drive.py,sha256=8gzzwzmXKRa9xFxruLczFyf-2ik5lJxNkJkKJ2pBNnk,18385
105
105
  synapse/lib/dyndeps.py,sha256=JKN_H3ZiJ831TT59Hdt9Zsif34UteYAfNJAJ0pax5zQ,2168
106
106
  synapse/lib/encoding.py,sha256=sxe1VADjsLJtM0vAKEIb4gHhvnOKI4xr_29da0mQMCM,6015
107
107
  synapse/lib/gis.py,sha256=Roq4dZ35yNyE3sixL-B0yB32GS3Y9sQZdWr2lDLstKQ,2684
@@ -141,7 +141,7 @@ synapse/lib/slabseqn.py,sha256=LJ2SZEsZlROBAD3mdS-3JxNVVPXXkBW8GIJXsW0OGG8,10287
141
141
  synapse/lib/snap.py,sha256=QfNtFHV_76ABrm7Zf7WR5kVBB-MvuZmdmDfy0n1Whlo,59880
142
142
  synapse/lib/spooled.py,sha256=pKPacX-fvZDUTUWPaKgyct_lk_3eoSsF9Ufh_cn_1fQ,5987
143
143
  synapse/lib/storm.lark,sha256=ItEIPItfrCT5VmaoS1vm8FWD8Wv7b7B6ZWucCJCdO6s,26517
144
- synapse/lib/storm.py,sha256=1jvPPyY1-fMYnZSMvvk2-hY4C5lD3z-Y5L6yIVY2MKc,215639
144
+ synapse/lib/storm.py,sha256=lW4f2Qny0jfcclxkWbWlgarD8NdjwFXf955EZjbHATQ,216918
145
145
  synapse/lib/storm_format.py,sha256=Q8mf9QWzPljwp70BC4dYv0MGWB_YUJi3Ul4T7ReqjlQ,4818
146
146
  synapse/lib/stormctrl.py,sha256=XvyZ6M0Ew8sXsjGvRTWbXh0MjktZrGi_zQ9kNa7AWTE,285
147
147
  synapse/lib/stormhttp.py,sha256=tw0LuO0UfxZT50sfF_V9hemudv5yZc2M9nFMkGrRHRw,28884
@@ -157,7 +157,7 @@ synapse/lib/time.py,sha256=FKTYwpdvpuAj8p8sSodRjOxoA7Vu67CIbbXz55gtghk,9231
157
157
  synapse/lib/trigger.py,sha256=mnfkoBHB88JfqPoxb5oflvAaBKZpNvYdxP247YS53fE,20697
158
158
  synapse/lib/types.py,sha256=u89ukW38oDziRzeA6IWrPwwPD0Ds75u-gwJSXsQ4loY,69708
159
159
  synapse/lib/urlhelp.py,sha256=j-DvWGi-xH0TcO0NbCuwG7guUuiV8wxIxfMyJOzDygo,2523
160
- synapse/lib/version.py,sha256=p7BzAg88_ZZWVR9XVKw6HvtegXB96029M0UBILSmR6o,7162
160
+ synapse/lib/version.py,sha256=e55WoEalWhgontsiSsICZ1XYBKyX5yUoK68uJXNWF3w,7162
161
161
  synapse/lib/view.py,sha256=BjIp5tPQhNmVRQ25_BQCwKNTw4xydx24wDl-YSBslAo,60658
162
162
  synapse/lib/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
163
163
  synapse/lib/crypto/coin.py,sha256=_dhlkzIrHT8BvHdJOWK7PDThz3sK3dDRnWAUqjRpZJc,4910
@@ -246,7 +246,7 @@ synapse/models/orgs.py,sha256=hX0bkMK33qCr5vxl2RhaBz1MJFe6Rs3I9C5pANJiliA,70851
246
246
  synapse/models/person.py,sha256=-YJh_KgEvL4a0ArdBX1xirMQy_8YZGyaA04Mq7Hg_VQ,27193
247
247
  synapse/models/planning.py,sha256=vmrY4d3WRxizrNU1YBe36NGZTuuu4lhGS8KI5lCZ5yQ,7302
248
248
  synapse/models/proj.py,sha256=VLqeQGaOT_ZqN5Lh6aTsOvDfBUM4FCUGCgC0jfACA68,9879
249
- synapse/models/risk.py,sha256=xyLJamNJ3k1DcolMDWDkuIdYDIArqDi9aoIN2_aJMZQ,55737
249
+ synapse/models/risk.py,sha256=NUqWGBSTNwuYTXTcuoQQNeTZw5JZwdzJ4SmeP5CDBAE,55879
250
250
  synapse/models/science.py,sha256=oSkKbjmVncYcVkVgx8rhM08XtcsgDgjf3mpunz5kL30,4329
251
251
  synapse/models/syn.py,sha256=oY6NTeDNUw0fv7wku8ieB1PqoZ-3qac0Chmdm8kk5Ds,13565
252
252
  synapse/models/telco.py,sha256=1BdnFr6Cyb1ZPtekIXaoUuRjISfJnIerTklQUEk_MzE,15273
@@ -280,13 +280,13 @@ synapse/tests/test_glob.py,sha256=cSNrtEKWLsZXRhsjxQjRjjMqdgqfpl05yT4S53dC0NU,24
280
280
  synapse/tests/test_init.py,sha256=rHqYBVL_aFf1HO6zCF5akHVcHUP2g1kpJLRdTkV0yys,557
281
281
  synapse/tests/test_lib_agenda.py,sha256=jQe0csMPBCmwojEy0EMtM83DSG96TFPWwptlMu_W7-4,44672
282
282
  synapse/tests/test_lib_aha.py,sha256=nRHs14-LtnsSRi-C7nRu24g3ENN-R3S-0Uk8Oq2LVy4,61945
283
- synapse/tests/test_lib_ast.py,sha256=il-g_TeEkfTSNbw70Ep9aWmuu9jMAesHceRz6sKekFw,180194
283
+ synapse/tests/test_lib_ast.py,sha256=rYYA9JYUSnY29EjHMzm2f5diqyDD5xiGsETHK8whxxg,180182
284
284
  synapse/tests/test_lib_auth.py,sha256=xkKacwMEb5xI9vMJIE4rx9e703xcMyVQsAdkKzIsCbY,38360
285
285
  synapse/tests/test_lib_autodoc.py,sha256=H2XO2_d8FmsHUd-cn7M-LjTX-078xLhMiOGiGGk5Oj0,8381
286
286
  synapse/tests/test_lib_base.py,sha256=0XUGNaXmfDW896gpBTYYd7ovADUD8cyDLkGTefqn1FM,14550
287
287
  synapse/tests/test_lib_boss.py,sha256=gZEuJnMO99Fu9gQ7Ct0g67umBW5XFCs8vcwInB5qr14,1598
288
288
  synapse/tests/test_lib_cache.py,sha256=oQgEBhm8pZFCEvMfcD3znTDQgl8Gv91fEOB-3eb2IIg,8594
289
- synapse/tests/test_lib_cell.py,sha256=e2siUZXF6-rEO9bzDbDdXDIWtlPBttP5AIfCoYyvUMk,143106
289
+ synapse/tests/test_lib_cell.py,sha256=Otc7bnzA8VgYx2ePFr-wS0Gzx6T4T6tsezo2Z-2kNZ4,144403
290
290
  synapse/tests/test_lib_certdir.py,sha256=d5X1lvp0DnBRigXYLbofZAXakZp440-bjaMH30PlGsI,42728
291
291
  synapse/tests/test_lib_chop.py,sha256=LkrM_pQU_KS88aVRPD4DI97qSdhxmw6EUA_jb-UJpww,6238
292
292
  synapse/tests/test_lib_cli.py,sha256=B8qGx9KtTWp31RlCMtfFMzhJ0TzaaO9ph7RCK2jHtx4,9283
@@ -330,7 +330,7 @@ synapse/tests/test_lib_slaboffs.py,sha256=FHQ8mGZ27dGqVwGk6q2UJ4gkPRZN22eIVzS8hM
330
330
  synapse/tests/test_lib_slabseqn.py,sha256=74V6jU7DRTsy_hqUFDuT4C6dPlJ6ObNnjmI9qhbbyVc,5230
331
331
  synapse/tests/test_lib_snap.py,sha256=OviJtj9N5LhBV-56TySkWvRly7f8VH9d-VBcNFLAtmg,27805
332
332
  synapse/tests/test_lib_spooled.py,sha256=fkLuujrDqjeJtyByptmGZvJbM9QiETCAu4r_4PdLfZg,3929
333
- synapse/tests/test_lib_storm.py,sha256=19RKTaoeKzJCTG5scu2hGaHCTU3GDYmiP1RVkAn9t4k,228172
333
+ synapse/tests/test_lib_storm.py,sha256=mATYbEaT0IdG6J0uO3HZSMRpQ_jBZO7essqOTP9Ok08,228626
334
334
  synapse/tests/test_lib_storm_format.py,sha256=tEZgQMmKAeG8FQZE5HUjOT7bnKawVTpNaVQh_3Wa630,277
335
335
  synapse/tests/test_lib_stormhttp.py,sha256=ZS8iONsisWjEi2CXx9AttiQ9bOrPs9x4GCwXlJEB_u0,42592
336
336
  synapse/tests/test_lib_stormlib_aha.py,sha256=2x3KQa64LN86wzSdJwAu3QFb5NNR3WNx1o9aD3N954o,8796
@@ -410,7 +410,7 @@ synapse/tests/test_model_orgs.py,sha256=4ndVUD7mQAQ_FFxj_h3KT-KOD7gEuJxtkV3L9cC6
410
410
  synapse/tests/test_model_person.py,sha256=6Zj_dnOyY4axLvl7VKCEYGtwVlnEYqKSg5kOi3Brp9s,17322
411
411
  synapse/tests/test_model_planning.py,sha256=U2kkE0uBO6CqtTfy7wlnhEIu_NFdSri4I_I5b-mRjBE,5615
412
412
  synapse/tests/test_model_proj.py,sha256=hCuM-CTyCAvqVPy7klP6NXOEtgJ61OyyT0x8mcJsjns,23238
413
- synapse/tests/test_model_risk.py,sha256=bivCsGhYxhXjauXPZIR4-nNt4pDdaBZfHXOFf66yu4Y,29817
413
+ synapse/tests/test_model_risk.py,sha256=6aEpAWWVrBW-m_exNxY88iXR5M793jq1Zfnx3hDjyYI,29956
414
414
  synapse/tests/test_model_science.py,sha256=2T9VxdzpltDufgjkUB95q97TQP9AxH2-T_sBbHfPDRk,2450
415
415
  synapse/tests/test_model_syn.py,sha256=9yWzWRSBI3rjv7hu3MUE9KuE00n4GxxlQmxDvQJj6gw,23028
416
416
  synapse/tests/test_model_telco.py,sha256=5ToiRhCX7faiDx4lDMV6b7E9WteN3PcBlznYF6GA2co,13166
@@ -602,8 +602,8 @@ synapse/vendor/xrpl/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
602
602
  synapse/vendor/xrpl/tests/test_codec.py,sha256=Zwq6A5uZUK_FWDL3BA932c5b-rL3hnC6efobWHSLC4o,6651
603
603
  synapse/vendor/xrpl/tests/test_main.py,sha256=kZQwWk7I6HrP-PMvLdsUUN4POvWD9I-iXDHOwdeF090,4299
604
604
  synapse/vendor/xrpl/tests/test_main_test_cases.py,sha256=vTlUM4hJD2Hd2wCIdd9rfsvcMZZZQmNHWdCTTFeGz2Y,4221
605
- synapse-2.188.0.dist-info/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
606
- synapse-2.188.0.dist-info/METADATA,sha256=Wgx22qd7aAqhxIaQrjm1ImSSlszLCTLhnrbP3Z1Jd-M,4598
607
- synapse-2.188.0.dist-info/WHEEL,sha256=V9njg5PXytSyv_DtLjFqv-lPwlYJ-pVdrLhmVh7fan0,93
608
- synapse-2.188.0.dist-info/top_level.txt,sha256=v_1YsqjmoSCzCKs7oIhzTNmWtSYoORiBMv1TJkOhx8A,8
609
- synapse-2.188.0.dist-info/RECORD,,
605
+ synapse-2.189.0.dist-info/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
606
+ synapse-2.189.0.dist-info/METADATA,sha256=Zkwn98ReEux1V9vICgxWOFPZoeLHw_fxIuyoL7YDn94,4598
607
+ synapse-2.189.0.dist-info/WHEEL,sha256=SzIPD_RU47f7h-36tIDPOo2oz_W3FX5e2XbmWR-qLbQ,93
608
+ synapse-2.189.0.dist-info/top_level.txt,sha256=v_1YsqjmoSCzCKs7oIhzTNmWtSYoORiBMv1TJkOhx8A,8
609
+ synapse-2.189.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py311-none-any
5
5