synapse 2.193.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.

Files changed (83) hide show
  1. synapse/cortex.py +9 -7
  2. synapse/datamodel.py +9 -6
  3. synapse/exc.py +1 -1
  4. synapse/lib/agenda.py +17 -4
  5. synapse/lib/ast.py +217 -86
  6. synapse/lib/auth.py +5 -2
  7. synapse/lib/link.py +33 -19
  8. synapse/lib/modelrev.py +6 -1
  9. synapse/lib/parser.py +4 -0
  10. synapse/lib/scrape.py +18 -1
  11. synapse/lib/snap.py +40 -11
  12. synapse/lib/storm.lark +16 -1
  13. synapse/lib/storm.py +6 -4
  14. synapse/lib/storm_format.py +1 -0
  15. synapse/lib/stormctrl.py +88 -6
  16. synapse/lib/stormlib/auth.py +15 -1
  17. synapse/lib/stormlib/cache.py +6 -2
  18. synapse/lib/stormlib/cell.py +11 -0
  19. synapse/lib/stormlib/infosec.py +2 -0
  20. synapse/lib/stormlib/scrape.py +1 -1
  21. synapse/lib/stormlib/stix.py +8 -8
  22. synapse/lib/stormtypes.py +13 -5
  23. synapse/lib/version.py +2 -2
  24. synapse/lib/view.py +20 -3
  25. synapse/models/geopol.py +1 -0
  26. synapse/models/geospace.py +53 -10
  27. synapse/models/inet.py +3 -0
  28. synapse/models/infotech.py +12 -5
  29. synapse/models/material.py +67 -8
  30. synapse/models/orgs.py +11 -3
  31. synapse/models/person.py +28 -17
  32. synapse/models/risk.py +4 -1
  33. synapse/models/syn.py +3 -0
  34. synapse/models/telco.py +10 -3
  35. synapse/models/transport.py +382 -49
  36. synapse/tests/test_axon.py +6 -6
  37. synapse/tests/test_cortex.py +134 -12
  38. synapse/tests/test_exc.py +1 -0
  39. synapse/tests/test_lib_agenda.py +125 -1
  40. synapse/tests/test_lib_aha.py +13 -6
  41. synapse/tests/test_lib_ast.py +258 -9
  42. synapse/tests/test_lib_auth.py +6 -7
  43. synapse/tests/test_lib_cell.py +10 -0
  44. synapse/tests/test_lib_grammar.py +14 -0
  45. synapse/tests/test_lib_layer.py +1 -1
  46. synapse/tests/test_lib_link.py +6 -1
  47. synapse/tests/test_lib_lmdbslab.py +3 -3
  48. synapse/tests/test_lib_modelrev.py +7 -0
  49. synapse/tests/test_lib_scrape.py +8 -0
  50. synapse/tests/test_lib_storm.py +201 -25
  51. synapse/tests/test_lib_stormctrl.py +65 -0
  52. synapse/tests/test_lib_stormhttp.py +5 -5
  53. synapse/tests/test_lib_stormlib_auth.py +31 -5
  54. synapse/tests/test_lib_stormlib_cache.py +38 -6
  55. synapse/tests/test_lib_stormlib_cell.py +3 -0
  56. synapse/tests/test_lib_stormlib_modelext.py +3 -3
  57. synapse/tests/test_lib_stormlib_scrape.py +4 -4
  58. synapse/tests/test_lib_stormlib_spooled.py +1 -1
  59. synapse/tests/test_lib_stormlib_xml.py +5 -5
  60. synapse/tests/test_lib_stormtypes.py +54 -57
  61. synapse/tests/test_lib_view.py +1 -1
  62. synapse/tests/test_model_base.py +1 -2
  63. synapse/tests/test_model_geopol.py +4 -0
  64. synapse/tests/test_model_geospace.py +43 -4
  65. synapse/tests/test_model_inet.py +3 -0
  66. synapse/tests/test_model_infotech.py +31 -4
  67. synapse/tests/test_model_material.py +18 -0
  68. synapse/tests/test_model_orgs.py +25 -3
  69. synapse/tests/test_model_person.py +26 -1
  70. synapse/tests/test_model_risk.py +11 -0
  71. synapse/tests/test_model_syn.py +9 -3
  72. synapse/tests/test_model_transport.py +168 -0
  73. synapse/tests/test_telepath.py +24 -5
  74. synapse/tests/test_tools_healthcheck.py +4 -4
  75. synapse/tests/test_utils.py +17 -18
  76. synapse/tests/utils.py +0 -35
  77. synapse/tools/changelog.py +14 -5
  78. synapse/tools/storm.py +1 -1
  79. {synapse-2.193.0.dist-info → synapse-2.195.0.dist-info}/METADATA +5 -5
  80. {synapse-2.193.0.dist-info → synapse-2.195.0.dist-info}/RECORD +83 -82
  81. {synapse-2.193.0.dist-info → synapse-2.195.0.dist-info}/WHEEL +1 -1
  82. {synapse-2.193.0.dist-info → synapse-2.195.0.dist-info}/LICENSE +0 -0
  83. {synapse-2.193.0.dist-info → synapse-2.195.0.dist-info}/top_level.txt +0 -0
synapse/lib/stormtypes.py CHANGED
@@ -575,7 +575,7 @@ class StormType:
575
575
  raise s_exc.NoSuchName(name=name, mesg=mesg)
576
576
 
577
577
  if s_scope.get('runt').readonly and not getattr(stor, '_storm_readonly', False):
578
- mesg = f'Function ({stor.__name__}) is not marked readonly safe.'
578
+ mesg = f'Setting {name} on {self._storm_typename} is not marked readonly safe.'
579
579
  raise s_exc.IsReadOnly(mesg=mesg, name=name, valu=valu)
580
580
 
581
581
  await s_coro.ornot(stor, valu)
@@ -1247,7 +1247,8 @@ class LibBase(Lib):
1247
1247
  'desc': 'Additional keyword arguments containing data to add to the event.', },
1248
1248
  ),
1249
1249
  'returns': {'type': 'null', }}},
1250
- {'name': 'list', 'desc': 'Get a Storm List object.',
1250
+ {'name': 'list', 'desc': 'Get a Storm List object. This is deprecated, use ([]) to declare a list instead.',
1251
+ 'deprecated': {'eolvers': 'v3.0.0'},
1251
1252
  'type': {'type': 'function', '_funcname': '_list',
1252
1253
  'args': (
1253
1254
  {'name': '*vals', 'type': 'any', 'desc': 'Initial values to place in the list.', },
@@ -1307,7 +1308,8 @@ class LibBase(Lib):
1307
1308
  cli> storm if $lib.false { $lib.print('Is True') } else { $lib.print('Is False') }
1308
1309
  Is False''',
1309
1310
  'type': 'boolean', },
1310
- {'name': 'text', 'desc': 'Get a Storm Text object.',
1311
+ {'name': 'text', 'desc': 'Get a Storm Text object. This is deprecated; please use a list to append strings to, and then use ``$lib.str.join()`` to join them on demand.',
1312
+ 'deprecated': {'eolvers': '3.0.0'},
1311
1313
  'type': {'type': 'function', '_funcname': '_text',
1312
1314
  'args': (
1313
1315
  {'name': '*args', 'type': 'str',
@@ -1663,7 +1665,7 @@ class LibBase(Lib):
1663
1665
  if mesg:
1664
1666
  mesg = await self._get_mesg(mesg, **kwargs)
1665
1667
  await self.runt.warn(mesg, log=False)
1666
- raise s_stormctrl.StormExit(mesg)
1668
+ raise s_stormctrl.StormExit(mesg=mesg)
1667
1669
  raise s_stormctrl.StormExit()
1668
1670
 
1669
1671
  @stormfunc(readonly=True)
@@ -1680,10 +1682,16 @@ class LibBase(Lib):
1680
1682
 
1681
1683
  @stormfunc(readonly=True)
1682
1684
  async def _list(self, *vals):
1685
+ s_common.deprecated('$lib.list()', curv='2.194.0')
1686
+ await self.runt.snap.warnonce('$lib.list() is deprecated. Use ([]) instead.')
1683
1687
  return List(list(vals))
1684
1688
 
1685
1689
  @stormfunc(readonly=True)
1686
1690
  async def _text(self, *args):
1691
+ s_common.deprecated('$lib.text()', curv='2.194.0')
1692
+ runt = s_scope.get('runt')
1693
+ if runt:
1694
+ await runt.snap.warnonce('$lib.text() is deprecated. Please use a list to append strings to, and then use ``$lib.str.join()`` to join them on demand.')
1687
1695
  valu = ''.join(args)
1688
1696
  return Text(valu)
1689
1697
 
@@ -5177,7 +5185,7 @@ class List(Prim):
5177
5185
  Examples:
5178
5186
  Populate a list by extending it with to other lists::
5179
5187
 
5180
- $list = $lib.list()
5188
+ $list = ()
5181
5189
 
5182
5190
  $foo = (f, o, o)
5183
5191
  $bar = (b, a, r)
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, 193, 0)
226
+ version = (2, 195, 0)
227
227
  verstring = '.'.join([str(x) for x in version])
228
- commit = 'ad17bf2e740ba11453b7827ce70c140f969a1430'
228
+ commit = 'dc93864afdb2150e6d83ac4ed426c8e99bb3a448'
synapse/lib/view.py CHANGED
@@ -635,7 +635,6 @@ class View(s_nexus.Pusher): # type: ignore
635
635
  async def _calcForkLayers(self):
636
636
  # recompute the proper set of layers for a forked view
637
637
  # (this may only be called from within a nexus handler)
638
-
639
638
  '''
640
639
  We spent a lot of time thinking/talking about this so some hefty
641
640
  comments are in order:
@@ -953,6 +952,15 @@ class View(s_nexus.Pusher): # type: ignore
953
952
  extra={'synapse': {'text': text, 'username': user.name, 'user': user.iden}})
954
953
  raise
955
954
 
955
+ except (s_stormctrl.StormLoopCtrl, s_stormctrl.StormGenrCtrl) as e:
956
+ if isinstance(e, s_stormctrl.StormLoopCtrl):
957
+ mesg = f'Loop control statement "{e.statement}" used outside of a loop.'
958
+ else:
959
+ mesg = f'Generator control statement "{e.statement}" used outside of a generator function.'
960
+ logmesg = f'Error during storm execution for {{ {text} }} - {mesg}'
961
+ logger.exception(logmesg, extra={'synapse': {'text': text, 'username': user.name, 'user': user.iden}})
962
+ raise s_exc.StormRuntimeError(mesg=mesg, statement=e.statement, highlight=e.get('highlight')) from e
963
+
956
964
  except Exception:
957
965
  logger.exception(f'Error during callStorm execution for {{ {text} }}',
958
966
  extra={'synapse': {'text': text, 'username': user.name, 'user': user.iden}})
@@ -1055,8 +1063,17 @@ class View(s_nexus.Pusher): # type: ignore
1055
1063
  raise
1056
1064
 
1057
1065
  except Exception as e:
1058
- logger.exception(f'Error during storm execution for {{ {text} }}',
1059
- extra={'synapse': {'text': text, 'username': user.name, 'user': user.iden}})
1066
+ mesg = ''
1067
+ if isinstance(e, s_stormctrl.StormLoopCtrl):
1068
+ mesg = f'Loop control statement "{e.statement}" used outside of a loop.'
1069
+ e = s_exc.StormRuntimeError(mesg=mesg, statement=e.statement, highlight=e.get('highlight'))
1070
+ elif isinstance(e, s_stormctrl.StormGenrCtrl):
1071
+ mesg = f'Generator control statement "{e.statement}" used outside of a generator function.'
1072
+ e = s_exc.StormRuntimeError(mesg=mesg, statement=e.statement, highlight=e.get('highlight'))
1073
+ logmesg = f'Error during storm execution for {{ {text} }}'
1074
+ if mesg:
1075
+ logmesg = f'{logmesg} - {mesg}'
1076
+ logger.exception(logmesg, extra={'synapse': {'text': text, 'username': user.name, 'user': user.iden}})
1060
1077
  enfo = s_common.err(e)
1061
1078
  enfo[1].pop('esrc', None)
1062
1079
  enfo[1].pop('ename', None)
synapse/models/geopol.py CHANGED
@@ -69,6 +69,7 @@ class PolModule(s_module.CoreModule):
69
69
  ('tld', ('inet:fqdn', {}), {}),
70
70
 
71
71
  ('name', ('geo:name', {}), {
72
+ 'alts': ('names',),
72
73
  'doc': 'The name of the country.'}),
73
74
 
74
75
  ('names', ('array', {'type': 'geo:name', 'uniq': True, 'sorted': True}), {
@@ -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
- 'doc': 'A geospatial position of a node at a given time. The node should be linked via -(seenat)> edges.',
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 ``geo:telem:node``.'}),
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 node was at the position.'}),
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
- 'doc': 'The latitude/longitude reading at the time.'}),
522
+ 'deprecated': True,
523
+ 'doc': 'Deprecated. Please use :place:latlong.'}),
524
+
484
525
  ('accuracy', ('geo:dist', {}), {
485
- 'doc': 'The reported accuracy of the latlong telemetry reading.'}),
486
- ('place', ('geo:place', {}), {
487
- 'doc': 'The place which includes the latlong value.'}),
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,7 +533,11 @@ 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', {}), {
540
+ 'alts': ('names',),
498
541
  'doc': 'The name of the place.'}),
499
542
 
500
543
  ('type', ('geo:place:taxonomy', {}), {
synapse/models/inet.py CHANGED
@@ -3785,6 +3785,9 @@ class InetModule(s_module.CoreModule):
3785
3785
  ('replyto', ('inet:service:message', {}), {
3786
3786
  'doc': 'The message that this message was sent in reply to. Used for message threading.'}),
3787
3787
 
3788
+ ('repost', ('inet:service:message', {}), {
3789
+ 'doc': 'The original message reposted by this message.'}),
3790
+
3788
3791
  ('links', ('array', {'type': 'inet:service:message:link', 'uniq': True, 'sorted': True}), {
3789
3792
  'doc': 'An array of links contained within the message.'}),
3790
3793
 
@@ -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', {}), {
@@ -857,10 +856,12 @@ class ItModule(s_module.CoreModule):
857
856
  }),
858
857
 
859
858
  ('it:os:ios:idfa', ('it:adid', {}), {
860
- 'doc': 'An iOS advertising identification string.'}),
859
+ 'deprecated': True,
860
+ 'doc': 'Deprecated. Please use it:adid.'}),
861
861
 
862
862
  ('it:os:android:aaid', ('it:adid', {}), {
863
- 'doc': 'An android advertising identification string.'}),
863
+ 'deprecated': True,
864
+ 'doc': 'Deprecated. Please use it:adid.'}),
864
865
 
865
866
  ('it:os:android:perm', ('str', {}), {
866
867
  'doc': 'An android permission string.'}),
@@ -2094,7 +2095,12 @@ class ItModule(s_module.CoreModule):
2094
2095
  )),
2095
2096
  ('it:prod:soft:taxonomy', {}, ()),
2096
2097
  ('it:prod:soft', {}, (
2098
+
2099
+ ('id', ('str', {'strip': True}), {
2100
+ 'doc': 'An ID for the software.'}),
2101
+
2097
2102
  ('name', ('it:prod:softname', {}), {
2103
+ 'alts': ('names',),
2098
2104
  'doc': 'Name of the software.',
2099
2105
  }),
2100
2106
  ('type', ('it:prod:soft:taxonomy', {}), {
@@ -2216,6 +2222,7 @@ class ItModule(s_module.CoreModule):
2216
2222
  'doc': 'Deprecated. Please use it:prod:softver:name.',
2217
2223
  }),
2218
2224
  ('name', ('it:prod:softname', {}), {
2225
+ 'alts': ('names',),
2219
2226
  'doc': 'Name of the software version.',
2220
2227
  }),
2221
2228
  ('names', ('array', {'type': 'it:prod:softname', 'uniq': True, 'sorted': True}), {
@@ -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
- ('mat:item', ('guid', {}), {'doc': 'A GUID assigned to a material object.'}),
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
- ('place', ('geo:place', {}), {'doc': 'The most recent place the item is known to reside.'}),
60
- ('latlong', ('geo:latlong', {}), {'doc': 'The last known lat/long location of the node.'}),
117
+ ('latlong', ('geo:latlong', {}), {
118
+ 'deprecated': True,
119
+ 'doc': 'Deprecated. Please use :place:latlong.'}),
61
120
 
62
121
  ('loc', ('loc', {}), {
63
- 'doc': 'The geo-political location string for the node.',
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
- 'doc': 'The friendly name of the id number type.',
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
  }),
@@ -493,10 +496,10 @@ class OuModule(s_module.CoreModule):
493
496
  ('ou:id:number', {}, (
494
497
 
495
498
  ('type', ('ou:id:type', {}), {
496
- 'doc': 'The type of org id', 'ro': True}),
499
+ 'doc': 'The type of org ID.', 'ro': True}),
497
500
 
498
501
  ('value', ('ou:id:value', {}), {
499
- 'doc': 'The value of org id', 'ro': True}),
502
+ 'doc': 'The value of the org ID.', 'ro': True}),
500
503
 
501
504
  ('status', ('str', {'lower': True, 'strip': True}), {
502
505
  'doc': 'A freeform status such as valid, suspended, expired.'}),
@@ -526,6 +529,7 @@ class OuModule(s_module.CoreModule):
526
529
  ('ou:goal', {}, (
527
530
 
528
531
  ('name', ('ou:goalname', {}), {
532
+ 'alts': ('names',),
529
533
  'doc': 'A terse name for the goal.'}),
530
534
 
531
535
  ('names', ('array', {'type': 'ou:goalname', 'sorted': True, 'uniq': True}), {
@@ -570,6 +574,7 @@ class OuModule(s_module.CoreModule):
570
574
  'doc': 'The FQDN of the org responsible for the campaign. Used for entity resolution.'}),
571
575
 
572
576
  ('goal', ('ou:goal', {}), {
577
+ 'alts': ('goals',),
573
578
  'doc': 'The assessed primary goal of the campaign.'}),
574
579
 
575
580
  ('slogan', ('lang:phrase', {}), {
@@ -585,6 +590,7 @@ class OuModule(s_module.CoreModule):
585
590
  'doc': 'Records the success/failure status of the campaign if known.'}),
586
591
 
587
592
  ('name', ('ou:campname', {}), {
593
+ 'alts': ('names',),
588
594
  'ex': 'operation overlord',
589
595
  'doc': 'A terse name of the campaign.'}),
590
596
 
@@ -924,6 +930,7 @@ class OuModule(s_module.CoreModule):
924
930
  ('ou:industry', {}, (
925
931
 
926
932
  ('name', ('ou:industryname', {}), {
933
+ 'alts': ('names',),
927
934
  'doc': 'The name of the industry.'}),
928
935
 
929
936
  ('type', ('ou:industry:type:taxonomy', {}), {
@@ -1176,6 +1183,7 @@ class OuModule(s_module.CoreModule):
1176
1183
  'doc': 'An array of contacts which sponsored the conference.',
1177
1184
  }),
1178
1185
  ('name', ('entity:name', {}), {
1186
+ 'alts': ('names',),
1179
1187
  'doc': 'The full name of the conference.',
1180
1188
  'ex': 'defcon 2017'}),
1181
1189
 
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': 'A GUID for a suspected person.',
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': 'A person owns, controls, or has exclusive use of an object or'
37
- ' resource, potentially during a specific period of time.'
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': 'A persona owns, controls, or has exclusive use of an object or'
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': "A GUID representing entry in a contact's work history.",
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', {}), {
@@ -254,6 +254,7 @@ class PsModule(s_module.CoreModule):
254
254
  'doc': 'The most recent known vitals for the person.',
255
255
  }),
256
256
  ('name', ('ps:name', {}), {
257
+ 'alts': ('names',),
257
258
  'doc': 'The localized name for the person.',
258
259
  }),
259
260
  ('name:sur', ('ps:tokn', {}), {
@@ -350,12 +351,17 @@ class PsModule(s_module.CoreModule):
350
351
  'doc': 'The most recent known vitals for the contact.',
351
352
  }),
352
353
  ('name', ('ps:name', {}), {
353
- 'doc': 'The person name listed for the contact.',
354
- }),
354
+ 'alts': ('names',),
355
+ 'doc': 'The person name listed for the contact.'}),
356
+
357
+ ('bio', ('str', {}), {
358
+ 'doc': 'A brief bio provided for the contact.'}),
359
+
355
360
  ('desc', ('str', {}), {
356
- 'doc': 'A description of this contact.',
357
- }),
361
+ 'doc': 'A description of this contact.'}),
362
+
358
363
  ('title', ('ou:jobtitle', {}), {
364
+ 'alts': ('titles',),
359
365
  'doc': 'The job/org title listed for this contact.'}),
360
366
 
361
367
  ('titles', ('array', {'type': 'ou:jobtitle', 'sorted': True, 'uniq': True}), {
@@ -365,12 +371,14 @@ class PsModule(s_module.CoreModule):
365
371
  'doc': 'The photo listed for this contact.',
366
372
  }),
367
373
  ('orgname', ('ou:name', {}), {
374
+ 'alts': ('orgnames',),
368
375
  'doc': 'The listed org/company name for this contact.',
369
376
  }),
370
377
  ('orgfqdn', ('inet:fqdn', {}), {
371
378
  'doc': 'The listed org/company FQDN for this contact.',
372
379
  }),
373
380
  ('user', ('inet:user', {}), {
381
+ 'alts': ('users',),
374
382
  'doc': 'The username or handle for this contact.'}),
375
383
 
376
384
  ('service:accounts', ('array', {'type': 'inet:service:account', 'sorted': True, 'uniq': True}), {
@@ -412,6 +420,7 @@ class PsModule(s_module.CoreModule):
412
420
  'doc': 'The home or main site for this contact.',
413
421
  }),
414
422
  ('email', ('inet:email', {}), {
423
+ 'alts': ('emails',),
415
424
  'doc': 'The main email address for this contact.',
416
425
  }),
417
426
  ('email:work', ('inet:email', {}), {
@@ -440,6 +449,7 @@ class PsModule(s_module.CoreModule):
440
449
  'doc': 'The work phone number for this contact.',
441
450
  }),
442
451
  ('id:number', ('ou:id:number', {}), {
452
+ 'alts': ('id:numbers',),
443
453
  'doc': 'An ID number issued by an org and associated with this contact.',
444
454
  }),
445
455
  ('adid', ('it:adid', {}), {
@@ -479,6 +489,7 @@ class PsModule(s_module.CoreModule):
479
489
  }),
480
490
 
481
491
  ('lang', ('lang:language', {}), {
492
+ 'alts': ('langs',),
482
493
  'doc': 'The language specified for the contact.'}),
483
494
 
484
495
  ('langs', ('array', {'type': 'lang:language'}), {
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': 'An instance of a compromise and its aggregate impact.',
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'}},
@@ -310,6 +310,7 @@ class RiskModule(s_module.CoreModule):
310
310
  'doc': "The reporting organization's assessed location of the threat cluster."}),
311
311
 
312
312
  ('org:name', ('ou:name', {}), {
313
+ 'alts': ('org:names',),
313
314
  'ex': 'apt1',
314
315
  'doc': "The reporting organization's name for the threat cluster."}),
315
316
 
@@ -383,6 +384,7 @@ class RiskModule(s_module.CoreModule):
383
384
  'doc': 'The authoritative software family for the tool.'}),
384
385
 
385
386
  ('soft:name', ('it:prod:softname', {}), {
387
+ 'alts': ('soft:names',),
386
388
  'doc': 'The reporting organization\'s name for the tool.'}),
387
389
 
388
390
  ('soft:names', ('array', {'type': 'it:prod:softname', 'uniq': True, 'sorted': True}), {
@@ -441,6 +443,7 @@ class RiskModule(s_module.CoreModule):
441
443
  ('risk:vuln', {}, (
442
444
 
443
445
  ('name', ('risk:vulnname', {}), {
446
+ 'alts': ('names',),
444
447
  'doc': 'A user specified name for the vulnerability.'}),
445
448
 
446
449
  ('names', ('array', {'type': 'risk:vulnname', 'sorted': True, 'uniq': True}), {
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
  ),