synapse 2.202.0__py311-none-any.whl → 2.203.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/axon.py +4 -4
- synapse/cmds/cortex.py +4 -6
- synapse/cmds/hive.py +10 -10
- synapse/common.py +17 -58
- synapse/cortex.py +6 -6
- synapse/data/__init__.py +3 -2
- synapse/data/iana.uris.mpk +1 -0
- synapse/lib/autodoc.py +3 -3
- synapse/lib/cli.py +2 -2
- synapse/lib/config.py +2 -2
- synapse/lib/encoding.py +4 -3
- synapse/lib/httpapi.py +7 -11
- synapse/lib/json.py +224 -0
- synapse/lib/lmdbslab.py +1 -1
- synapse/lib/oauth.py +176 -54
- synapse/lib/rstorm.py +18 -14
- synapse/lib/schemas.py +87 -1
- synapse/lib/scrape.py +35 -13
- synapse/lib/snap.py +2 -1
- synapse/lib/storm.py +2 -2
- synapse/lib/stormhttp.py +11 -13
- synapse/lib/stormlib/aha.py +4 -4
- synapse/lib/stormlib/auth.py +1 -1
- synapse/lib/stormlib/cache.py +2 -2
- synapse/lib/stormlib/cortex.py +5 -5
- synapse/lib/stormlib/graph.py +1 -1
- synapse/lib/stormlib/imap.py +1 -1
- synapse/lib/stormlib/json.py +8 -11
- synapse/lib/stormlib/model.py +1 -1
- synapse/lib/stormlib/notifications.py +2 -2
- synapse/lib/stormlib/oauth.py +105 -2
- synapse/lib/stormlib/stats.py +4 -0
- synapse/lib/stormlib/stix.py +3 -4
- synapse/lib/stormlib/vault.py +6 -6
- synapse/lib/stormlib/xml.py +2 -2
- synapse/lib/stormtypes.py +19 -28
- synapse/lib/structlog.py +3 -3
- synapse/lib/types.py +2 -1
- synapse/lib/version.py +2 -2
- synapse/lib/view.py +7 -3
- synapse/models/base.py +51 -2
- synapse/telepath.py +5 -3
- synapse/tests/files/__init__.py +0 -1
- synapse/tests/test_axon.py +1 -1
- synapse/tests/test_cmds_cortex.py +3 -2
- synapse/tests/test_cmds_hive.py +4 -4
- synapse/tests/test_common.py +29 -19
- synapse/tests/test_cortex.py +5 -5
- synapse/tests/test_lib_ast.py +3 -3
- synapse/tests/test_lib_autodoc.py +5 -5
- synapse/tests/test_lib_base.py +1 -1
- synapse/tests/test_lib_cell.py +16 -10
- synapse/tests/test_lib_config.py +2 -2
- synapse/tests/test_lib_encoding.py +2 -2
- synapse/tests/test_lib_grammar.py +64 -64
- synapse/tests/test_lib_httpapi.py +13 -13
- synapse/tests/test_lib_json.py +219 -0
- synapse/tests/test_lib_multislabseqn.py +2 -1
- synapse/tests/test_lib_node.py +2 -2
- synapse/tests/test_lib_scrape.py +50 -0
- synapse/tests/test_lib_storm.py +6 -6
- synapse/tests/test_lib_stormhttp.py +4 -4
- synapse/tests/test_lib_stormlib_auth.py +3 -2
- synapse/tests/test_lib_stormlib_cortex.py +10 -12
- synapse/tests/test_lib_stormlib_infosec.py +2 -3
- synapse/tests/test_lib_stormlib_json.py +18 -21
- synapse/tests/test_lib_stormlib_log.py +1 -1
- synapse/tests/test_lib_stormlib_oauth.py +603 -1
- synapse/tests/test_lib_stormlib_stats.py +13 -3
- synapse/tests/test_lib_stormlib_stix.py +5 -5
- synapse/tests/test_lib_stormtypes.py +4 -4
- synapse/tests/test_lib_structlog.py +5 -6
- synapse/tests/test_lib_view.py +8 -0
- synapse/tests/test_model_base.py +32 -0
- synapse/tests/test_model_infotech.py +2 -2
- synapse/tests/test_telepath.py +0 -1
- synapse/tests/test_tools_cryo_cat.py +4 -3
- synapse/tests/test_tools_docker_validate.py +4 -2
- synapse/tests/test_tools_feed.py +30 -2
- synapse/tests/test_tools_genpkg.py +1 -1
- synapse/tests/test_tools_healthcheck.py +8 -7
- synapse/tests/test_utils.py +2 -2
- synapse/tests/utils.py +3 -3
- synapse/tools/autodoc.py +3 -3
- synapse/tools/changelog.py +2 -2
- synapse/tools/cryo/cat.py +3 -3
- synapse/tools/csvtool.py +2 -3
- synapse/tools/docker/validate.py +5 -5
- synapse/tools/feed.py +2 -1
- synapse/tools/genpkg.py +3 -2
- synapse/tools/healthcheck.py +2 -3
- synapse/tools/json2mpk.py +2 -2
- synapse/utils/getrefs.py +6 -6
- synapse/vendor/cpython/lib/json.py +35 -0
- synapse/vendor/cpython/lib/test/test_json.py +22 -0
- {synapse-2.202.0.dist-info → synapse-2.203.0.dist-info}/METADATA +2 -1
- {synapse-2.202.0.dist-info → synapse-2.203.0.dist-info}/RECORD +100 -95
- {synapse-2.202.0.dist-info → synapse-2.203.0.dist-info}/WHEEL +1 -1
- {synapse-2.202.0.dist-info → synapse-2.203.0.dist-info}/LICENSE +0 -0
- {synapse-2.202.0.dist-info → synapse-2.203.0.dist-info}/top_level.txt +0 -0
synapse/tests/test_lib_ast.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import json
|
|
2
1
|
import math
|
|
3
2
|
import asyncio
|
|
4
3
|
|
|
@@ -9,6 +8,7 @@ import synapse.common as s_common
|
|
|
9
8
|
import synapse.datamodel as s_datamodel
|
|
10
9
|
|
|
11
10
|
import synapse.lib.ast as s_ast
|
|
11
|
+
import synapse.lib.json as s_json
|
|
12
12
|
import synapse.lib.snap as s_snap
|
|
13
13
|
|
|
14
14
|
import synapse.tests.utils as s_test
|
|
@@ -1523,7 +1523,7 @@ class AstTest(s_test.SynTest):
|
|
|
1523
1523
|
self.stormIsInPrint('stormpkg', msgs)
|
|
1524
1524
|
|
|
1525
1525
|
# Make sure a JSON package loads
|
|
1526
|
-
jsonpkg =
|
|
1526
|
+
jsonpkg = s_json.loads(s_json.dumps(jsonpkg))
|
|
1527
1527
|
await core.stormlist('$lib.pkg.add($pkg)',
|
|
1528
1528
|
opts={'vars': {'pkg': jsonpkg}})
|
|
1529
1529
|
msgs = await core.stormlist('pkg.list')
|
|
@@ -1731,7 +1731,7 @@ class AstTest(s_test.SynTest):
|
|
|
1731
1731
|
prints = list(filter(lambda m: m[0] == 'print', msgs))
|
|
1732
1732
|
self.eq(len(prints), 3)
|
|
1733
1733
|
|
|
1734
|
-
jmsgs = list(map(lambda m:
|
|
1734
|
+
jmsgs = list(map(lambda m: s_json.loads(m[1]['mesg']), prints))
|
|
1735
1735
|
omsgs = sorted(jmsgs, key=lambda m: m[0])
|
|
1736
1736
|
self.eq(omsgs[0][1], 'this should be first')
|
|
1737
1737
|
self.eq(omsgs[1][1], 'toreturn called')
|
|
@@ -56,7 +56,7 @@ shave'''
|
|
|
56
56
|
)
|
|
57
57
|
}
|
|
58
58
|
callsig = s_autodoc.genCallsig(rtype)
|
|
59
|
-
self.eq(callsig, '(foo, bar
|
|
59
|
+
self.eq(callsig, '(foo, bar=(null), **kwargs)')
|
|
60
60
|
self.eq(s_autodoc.genCallsig({}), '()')
|
|
61
61
|
self.eq(s_autodoc.genCallsig({'args': ({'name': 'beep'},)}), '(beep)')
|
|
62
62
|
|
|
@@ -176,8 +176,8 @@ Returns:
|
|
|
176
176
|
|
|
177
177
|
.. _test-lib-test-someargs:
|
|
178
178
|
|
|
179
|
-
someargs(valu, bar
|
|
180
|
-
|
|
179
|
+
someargs(valu, bar=(true), faz=(null))
|
|
180
|
+
======================================
|
|
181
181
|
|
|
182
182
|
.. warning::
|
|
183
183
|
``$lib.test.someargs`` has been deprecated and will be removed in version v3.0.0.
|
|
@@ -252,8 +252,8 @@ Returns:
|
|
|
252
252
|
|
|
253
253
|
.. _test-lib-test-someargs:
|
|
254
254
|
|
|
255
|
-
$lib.test.someargs(valu, bar
|
|
256
|
-
|
|
255
|
+
$lib.test.someargs(valu, bar=(true), faz=(null))
|
|
256
|
+
================================================
|
|
257
257
|
|
|
258
258
|
.. warning::
|
|
259
259
|
``$lib.test.someargs`` has been deprecated and will be removed in version v3.0.0.
|
synapse/tests/test_lib_base.py
CHANGED
synapse/tests/test_lib_cell.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import ssl
|
|
3
3
|
import sys
|
|
4
|
-
import json
|
|
5
4
|
import time
|
|
6
5
|
import base64
|
|
7
6
|
import signal
|
|
@@ -26,6 +25,7 @@ import synapse.lib.auth as s_auth
|
|
|
26
25
|
import synapse.lib.base as s_base
|
|
27
26
|
import synapse.lib.cell as s_cell
|
|
28
27
|
import synapse.lib.coro as s_coro
|
|
28
|
+
import synapse.lib.json as s_json
|
|
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
|
|
@@ -1822,10 +1822,13 @@ class CellTest(s_t_utils.SynTest):
|
|
|
1822
1822
|
|
|
1823
1823
|
async def streamdone():
|
|
1824
1824
|
while core.backupstreaming:
|
|
1825
|
-
await asyncio.sleep(0)
|
|
1825
|
+
await asyncio.sleep(0.1)
|
|
1826
1826
|
|
|
1827
1827
|
task = core.schedCoro(streamdone())
|
|
1828
|
-
|
|
1828
|
+
try:
|
|
1829
|
+
await asyncio.wait_for(task, 5)
|
|
1830
|
+
except TimeoutError:
|
|
1831
|
+
raise TimeoutError('Timeout waiting for streaming backup cleanup of bkup3 to complete.')
|
|
1829
1832
|
|
|
1830
1833
|
self.eq(('bkup', 'bkup2'), sorted(await proxy.getBackups()))
|
|
1831
1834
|
self.false(os.path.isdir(os.path.join(backdirn, 'bkup3')))
|
|
@@ -1839,7 +1842,10 @@ class CellTest(s_t_utils.SynTest):
|
|
|
1839
1842
|
bkup4.write(msg)
|
|
1840
1843
|
|
|
1841
1844
|
task = core.schedCoro(streamdone())
|
|
1842
|
-
|
|
1845
|
+
try:
|
|
1846
|
+
await asyncio.wait_for(task, 5)
|
|
1847
|
+
except TimeoutError:
|
|
1848
|
+
raise TimeoutError('Timeout waiting for streaming backup cleanup of bkup4 to complete.')
|
|
1843
1849
|
|
|
1844
1850
|
self.eq(('bkup', 'bkup2'), sorted(await proxy.getBackups()))
|
|
1845
1851
|
|
|
@@ -3128,13 +3134,13 @@ class CellTest(s_t_utils.SynTest):
|
|
|
3128
3134
|
self.nn(node.getTagProp('test', 'score'), 6)
|
|
3129
3135
|
|
|
3130
3136
|
self.maxDiff = None
|
|
3131
|
-
roles = s_t_utils.deguidify('[{"type":
|
|
3132
|
-
users = s_t_utils.deguidify('[{"type":
|
|
3133
|
-
gates = s_t_utils.deguidify('[{"iden":
|
|
3137
|
+
roles = s_t_utils.deguidify('[{"type":"role","iden":"e1ef725990aa62ae3c4b98be8736d89f","name":"all","rules":[],"authgates":{"46cfde2c1682566602860f8df7d0cc83":{"rules":[[true,["layer","read"]]]},"4d50eb257549436414643a71e057091a":{"rules":[[true,["view","read"]]]}}}]')
|
|
3138
|
+
users = s_t_utils.deguidify('[{"type":"user","iden":"a357138db50780b62093a6ce0d057fd8","name":"root","rules":[],"roles":[],"admin":true,"email":null,"locked":false,"archived":false,"authgates":{"46cfde2c1682566602860f8df7d0cc83":{"admin":true},"4d50eb257549436414643a71e057091a":{"admin":true}}},{"type":"user","iden":"f77ac6744671a845c27e571071877827","name":"visi","rules":[[true,["cron","add"]],[true,["dmon","add"]],[true,["trigger","add"]]],"roles":[{"type":"role","iden":"e1ef725990aa62ae3c4b98be8736d89f","name":"all","rules":[],"authgates":{"46cfde2c1682566602860f8df7d0cc83":{"rules":[[true,["layer","read"]]]},"4d50eb257549436414643a71e057091a":{"rules":[[true,["view","read"]]]}}}],"admin":false,"email":null,"locked":false,"archived":false,"authgates":{"f21b7ae79c2dacb89484929a8409e5d8":{"admin":true},"d7d0380dd4e743e35af31a20d014ed48":{"admin":true}}}]')
|
|
3139
|
+
gates = s_t_utils.deguidify('[{"iden":"46cfde2c1682566602860f8df7d0cc83","type":"layer","users":[{"iden":"a357138db50780b62093a6ce0d057fd8","rules":[],"admin":true}],"roles":[{"iden":"e1ef725990aa62ae3c4b98be8736d89f","rules":[[true,["layer","read"]]],"admin":false}]},{"iden":"d7d0380dd4e743e35af31a20d014ed48","type":"trigger","users":[{"iden":"f77ac6744671a845c27e571071877827","rules":[],"admin":true}],"roles":[]},{"iden":"f21b7ae79c2dacb89484929a8409e5d8","type":"cronjob","users":[{"iden":"f77ac6744671a845c27e571071877827","rules":[],"admin":true}],"roles":[]},{"iden":"4d50eb257549436414643a71e057091a","type":"view","users":[{"iden":"a357138db50780b62093a6ce0d057fd8","rules":[],"admin":true}],"roles":[{"iden":"e1ef725990aa62ae3c4b98be8736d89f","rules":[[true,["view","read"]]],"admin":false}]},{"iden":"cortex","type":"cortex","users":[],"roles":[]}]')
|
|
3134
3140
|
|
|
3135
|
-
self.eq(roles, s_t_utils.deguidify(
|
|
3136
|
-
self.eq(users, s_t_utils.deguidify(
|
|
3137
|
-
self.eq(gates, s_t_utils.deguidify(
|
|
3141
|
+
self.eq(roles, s_t_utils.deguidify(s_json.dumps(await core.callStorm('return($lib.auth.roles.list())')).decode()))
|
|
3142
|
+
self.eq(users, s_t_utils.deguidify(s_json.dumps(await core.callStorm('return($lib.auth.users.list())')).decode()))
|
|
3143
|
+
self.eq(gates, s_t_utils.deguidify(s_json.dumps(await core.callStorm('return($lib.auth.gates.list())')).decode()))
|
|
3138
3144
|
|
|
3139
3145
|
with self.raises(s_exc.BadTypeValu):
|
|
3140
3146
|
await core.nodes('[ it:dev:str=foo +#test.newp ]')
|
synapse/tests/test_lib_config.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import copy
|
|
2
|
-
import json
|
|
3
2
|
import regex
|
|
4
3
|
import pathlib
|
|
5
4
|
import argparse
|
|
@@ -11,6 +10,7 @@ import synapse.data as s_data
|
|
|
11
10
|
import synapse.common as s_common
|
|
12
11
|
|
|
13
12
|
import synapse.lib.cell as s_cell
|
|
13
|
+
import synapse.lib.json as s_json
|
|
14
14
|
import synapse.lib.config as s_config
|
|
15
15
|
|
|
16
16
|
import synapse.tests.utils as s_test
|
|
@@ -396,7 +396,7 @@ class ConfTest(s_test.SynTest):
|
|
|
396
396
|
self.true(filename.exists())
|
|
397
397
|
|
|
398
398
|
with filename.open() as fp:
|
|
399
|
-
schema =
|
|
399
|
+
schema = s_json.load(fp)
|
|
400
400
|
|
|
401
401
|
self.eq(schema, s_config.localSchemaRefHandler(
|
|
402
402
|
"http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/common/core.json"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import io
|
|
2
|
-
import json
|
|
3
2
|
|
|
4
3
|
import synapse.common as s_common
|
|
5
4
|
|
|
5
|
+
import synapse.lib.json as s_json
|
|
6
6
|
import synapse.lib.msgpack as s_msgpack
|
|
7
7
|
import synapse.lib.encoding as s_encoding
|
|
8
8
|
|
|
@@ -190,7 +190,7 @@ class EncTest(s_t_utils.SynTest):
|
|
|
190
190
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
buf = io.BytesIO(
|
|
193
|
+
buf = io.BytesIO(s_json.dumps(data))
|
|
194
194
|
|
|
195
195
|
lines = list(s_encoding.iterdata(buf, format='json'))
|
|
196
196
|
self.len(1, lines)
|
|
@@ -192,17 +192,17 @@ Queries = [
|
|
|
192
192
|
'[ test:str=woot .seen=(2014,2015) ]',
|
|
193
193
|
'[ test:str=woot .seen=20 ]',
|
|
194
194
|
'[-#foo]',
|
|
195
|
-
'[meta:
|
|
196
|
-
'[meta:
|
|
197
|
-
'[meta:
|
|
198
|
-
'[meta:
|
|
199
|
-
'[meta:
|
|
195
|
+
'[meta:source=((test:str, foobar), (test:str, foo))]',
|
|
196
|
+
'[meta:source=((test:comp, (2048, horton)), (test:comp, (4096, whoville)))]',
|
|
197
|
+
'[meta:source=((test:comp, (9001, "A mean one")), (test:comp, (40000, greeneggs)))]',
|
|
198
|
+
'[meta:source=((test:int, 16), (test:comp, (9999, greenham)))]',
|
|
199
|
+
'[meta:source=((test:str, 123), (test:int, 123))]',
|
|
200
200
|
'[inet:dns:query=(tcp://1.2.3.4, "", 1)]',
|
|
201
201
|
'[inet:dns:query=(tcp://1.2.3.4, "foo*.haha.com", 1)]',
|
|
202
202
|
'[inet:ipv4=1.2.3.1-1.2.3.3]',
|
|
203
|
-
'[inet:ipv4=1.2.3.4 :asn=10] [meta:
|
|
204
|
-
'[meta:
|
|
205
|
-
'[meta:source=abcd +#omit.nopiv] [meta:
|
|
203
|
+
'[inet:ipv4=1.2.3.4 :asn=10] [meta:source=(abcd, (inet:asn, 10))]',
|
|
204
|
+
'[meta:source=(abcd, (test:str, pennywise))]',
|
|
205
|
+
'[meta:source=abcd +#omit.nopiv] [meta:source=(abcd, (test:pivtarg, foo))]',
|
|
206
206
|
'[test:comp=(1234, 5678)]',
|
|
207
207
|
'[test:comp=(3, foob) +#meep.gorp +#bleep.zlorp +#cond]',
|
|
208
208
|
'[test:guid="*" :tick=2001]',
|
|
@@ -220,8 +220,8 @@ Queries = [
|
|
|
220
220
|
'[test:str=foo :tick=201808021201]',
|
|
221
221
|
'[test:str=hehe] | iden abcd | count',
|
|
222
222
|
'[test:str=hello]',
|
|
223
|
-
'meta:
|
|
224
|
-
'meta:
|
|
223
|
+
'meta:source +:node*range=((test:comp, (1000, green)), (test:comp, (3000, ham)))',
|
|
224
|
+
'meta:source',
|
|
225
225
|
'file:bytes:size=4',
|
|
226
226
|
'for $fqdn in $fqdns { [ inet:fqdn=$fqdn ] }',
|
|
227
227
|
'for ($fqdn, $ipv4) in $dnsa { [ inet:dns:a=($fqdn,$ipv4) ] }',
|
|
@@ -232,8 +232,8 @@ Queries = [
|
|
|
232
232
|
'geo:place:latlong*near=(("34.118560", "-118.300370"), 50m)',
|
|
233
233
|
'geo:place:latlong*near=((0, 0), 50m)',
|
|
234
234
|
'geo:place:latlong*near=((34.1, -118.3), 10km)',
|
|
235
|
-
'geo:place=$place <- meta:
|
|
236
|
-
'geo:place=$place <- meta:
|
|
235
|
+
'geo:place=$place <- meta:source <- *',
|
|
236
|
+
'geo:place=$place <- meta:source <- ps:person',
|
|
237
237
|
'geo:place=abcd $latlong=:latlong $radius=:radius | spin | tel:mob:telem:latlong*near=($latlong, 3km)',
|
|
238
238
|
'meta:note=abcd | noderefs -d 2 --join',
|
|
239
239
|
'help',
|
|
@@ -285,16 +285,16 @@ Queries = [
|
|
|
285
285
|
'inet:user | limit 10 | +inet:user=visi',
|
|
286
286
|
'inet:user | limit 10 | [ +#foo.bar ]',
|
|
287
287
|
'media:news = 00a1f0d928e25729b9e86e2d08c127ce [ :summary = \"\" ]',
|
|
288
|
-
'meta:
|
|
289
|
-
'meta:
|
|
288
|
+
'meta:source:meta:source=$sorc -> *',
|
|
289
|
+
'meta:source:meta:source=$sorc :node -> *',
|
|
290
290
|
'meta:source=8f1401de15918358d5247e21ca29a814',
|
|
291
291
|
'movetag a.b a.m',
|
|
292
292
|
'movetag hehe woot',
|
|
293
|
-
'ps:person=$pers -> meta:
|
|
294
|
-
'ps:person=$pers -> meta:
|
|
295
|
-
'ps:person=$pers -> meta:
|
|
296
|
-
'ps:person=$pers -> meta:
|
|
297
|
-
'ps:person=$pers -> meta:
|
|
293
|
+
'ps:person=$pers -> meta:source -> *',
|
|
294
|
+
'ps:person=$pers -> meta:source -> geo:place',
|
|
295
|
+
'ps:person=$pers -> meta:source +:time@=(2014,2017) -> geo:place',
|
|
296
|
+
'ps:person=$pers -> meta:source -> *',
|
|
297
|
+
'ps:person=$pers -> meta:source :node -> *',
|
|
298
298
|
'reindex --form-counts',
|
|
299
299
|
'sudo | [ inet:ipv4=1.2.3.4 ]',
|
|
300
300
|
'sudo | [ test:cycle0=foo :test:cycle1=bar ]',
|
|
@@ -444,12 +444,12 @@ Queries = [
|
|
|
444
444
|
'test:str=bar <- *',
|
|
445
445
|
'test:str=bar test:pivcomp=(foo,bar) [+#test.bar]',
|
|
446
446
|
'test:str=foo +#lol@=2016',
|
|
447
|
-
'test:str=foo <+- meta:
|
|
448
|
-
'test:str=foo <- meta:
|
|
447
|
+
'test:str=foo <+- meta:source',
|
|
448
|
+
'test:str=foo <- meta:source',
|
|
449
449
|
'test:str=foo | delnode',
|
|
450
|
-
'test:str=foobar -+> meta:
|
|
451
|
-
'test:str=foobar -> meta:
|
|
452
|
-
'test:str=foobar -> meta:
|
|
450
|
+
'test:str=foobar -+> meta:source',
|
|
451
|
+
'test:str=foobar -> meta:source <+- test:str',
|
|
452
|
+
'test:str=foobar -> meta:source <- test:str',
|
|
453
453
|
'test:str=hello [:tick="2001"]',
|
|
454
454
|
'test:str=hello [:tick="2002"]',
|
|
455
455
|
'test:str=pennywise | noderefs --join -d 9 --traverse-edge',
|
|
@@ -476,7 +476,7 @@ Queries = [
|
|
|
476
476
|
inet:fqdn | graph
|
|
477
477
|
--degrees 2
|
|
478
478
|
--filter { -#nope }
|
|
479
|
-
--pivot { <- meta:
|
|
479
|
+
--pivot { <- meta:source <- meta:source }
|
|
480
480
|
--form-pivot inet:fqdn {<- * | limit 20}
|
|
481
481
|
--form-pivot inet:fqdn {-> * | limit 20}
|
|
482
482
|
--form-filter inet:fqdn {-inet:fqdn:issuffix=1}
|
|
@@ -514,7 +514,7 @@ Queries = [
|
|
|
514
514
|
|
|
515
515
|
{[ inet:email:message:attachment=($node, "*") ] -inet:email:message [ :name=sploit.exe ]}
|
|
516
516
|
|
|
517
|
-
{[ meta:
|
|
517
|
+
{[ meta:source=($node, ('inet:email:header', ('to', 'Visi Kensho <visi@vertex.link>'))) ]}
|
|
518
518
|
''',
|
|
519
519
|
'$x = $(1 / 3)',
|
|
520
520
|
'$x = $(1 * 3)',
|
|
@@ -690,18 +690,18 @@ Queries = [
|
|
|
690
690
|
'reverse(*$form=$valu)',
|
|
691
691
|
'test:str=foobar -> inet:dns*',
|
|
692
692
|
'test:str=foobar -> inet:dns:*',
|
|
693
|
-
'test:str=foobar -> (meta:
|
|
694
|
-
'test:str=foobar -> (meta:
|
|
693
|
+
'test:str=foobar -> (meta:source, inet:dns:a)',
|
|
694
|
+
'test:str=foobar -> (meta:source, inet:dns*)',
|
|
695
695
|
'test:str=foobar -> $foo',
|
|
696
696
|
'test:str=foobar -+> inet:dns*',
|
|
697
697
|
'test:str=foobar -+> inet:dns:*',
|
|
698
|
-
'test:str=foobar -+> (meta:
|
|
699
|
-
'test:str=foobar -+> (meta:
|
|
698
|
+
'test:str=foobar -+> (meta:source, inet:dns:a)',
|
|
699
|
+
'test:str=foobar -+> (meta:source, inet:dns*)',
|
|
700
700
|
'test:str=foobar -+> $foo',
|
|
701
701
|
'test:str=foobar -(refs)> inet:dns:*',
|
|
702
|
-
'inet:fqdn=foo.com :zone -> (meta:
|
|
702
|
+
'inet:fqdn=foo.com :zone -> (meta:source, inet:dns:a)',
|
|
703
703
|
'inet:fqdn=foo.com :zone -> $foo',
|
|
704
|
-
'inet:fqdn=foo.com :zone -+> (meta:
|
|
704
|
+
'inet:fqdn=foo.com :zone -+> (meta:source, inet:dns:a)',
|
|
705
705
|
'inet:fqdn=foo.com :zone -+> $foo',
|
|
706
706
|
'test:*#foo',
|
|
707
707
|
'test:*#foo@=2016',
|
|
@@ -933,17 +933,17 @@ _ParseResults = [
|
|
|
933
933
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: woot], EditPropSet: [UnivProp: [Const: .seen], Const: =, List: [Const: 2014, Const: 2015]]]',
|
|
934
934
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: woot], EditPropSet: [UnivProp: [Const: .seen], Const: =, Const: 20]]',
|
|
935
935
|
'Query: [EditTagDel: [TagName: [Const: foo]]]',
|
|
936
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
937
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
938
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
939
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
940
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
936
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [List: [Const: test:str, Const: foobar], List: [Const: test:str, Const: foo]]]]',
|
|
937
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [List: [Const: test:comp, List: [Const: 2048, Const: horton]], List: [Const: test:comp, List: [Const: 4096, Const: whoville]]]]]',
|
|
938
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [List: [Const: test:comp, List: [Const: 9001, Const: A mean one]], List: [Const: test:comp, List: [Const: 40000, Const: greeneggs]]]]]',
|
|
939
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [List: [Const: test:int, Const: 16], List: [Const: test:comp, List: [Const: 9999, Const: greenham]]]]]',
|
|
940
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [List: [Const: test:str, Const: 123], List: [Const: test:int, Const: 123]]]]',
|
|
941
941
|
'Query: [EditNodeAdd: [FormName: [Const: inet:dns:query], Const: =, List: [Const: tcp://1.2.3.4, Const: , Const: 1]]]',
|
|
942
942
|
'Query: [EditNodeAdd: [FormName: [Const: inet:dns:query], Const: =, List: [Const: tcp://1.2.3.4, Const: foo*.haha.com, Const: 1]]]',
|
|
943
943
|
'Query: [EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.1-1.2.3.3]]',
|
|
944
|
-
'Query: [EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.4], EditPropSet: [RelProp: [Const: asn], Const: =, Const: 10], EditNodeAdd: [FormName: [Const: meta:
|
|
945
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
946
|
-
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, Const: abcd], EditTagAdd: [TagName: [Const: omit, Const: nopiv]], EditNodeAdd: [FormName: [Const: meta:
|
|
944
|
+
'Query: [EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.4], EditPropSet: [RelProp: [Const: asn], Const: =, Const: 10], EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [Const: abcd, List: [Const: inet:asn, Const: 10]]]]',
|
|
945
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [Const: abcd, List: [Const: test:str, Const: pennywise]]]]',
|
|
946
|
+
'Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, Const: abcd], EditTagAdd: [TagName: [Const: omit, Const: nopiv]], EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [Const: abcd, List: [Const: test:pivtarg, Const: foo]]]]',
|
|
947
947
|
'Query: [EditNodeAdd: [FormName: [Const: test:comp], Const: =, List: [Const: 1234, Const: 5678]]]',
|
|
948
948
|
'Query: [EditNodeAdd: [FormName: [Const: test:comp], Const: =, List: [Const: 3, Const: foob]], EditTagAdd: [TagName: [Const: meep, Const: gorp]], EditTagAdd: [TagName: [Const: bleep, Const: zlorp]], EditTagAdd: [TagName: [Const: cond]]]',
|
|
949
949
|
'Query: [EditNodeAdd: [FormName: [Const: test:guid], Const: =, Const: *], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 2001]]',
|
|
@@ -961,8 +961,8 @@ _ParseResults = [
|
|
|
961
961
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: foo], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 201808021201]]',
|
|
962
962
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: hehe], CmdOper: [Const: iden, List: [Const: abcd]], CmdOper: [Const: count, Const: ()]]',
|
|
963
963
|
'Query: [EditNodeAdd: [FormName: [Const: test:str], Const: =, Const: hello]]',
|
|
964
|
-
'Query: [LiftProp: [Const: meta:
|
|
965
|
-
'Query: [LiftProp: [Const: meta:
|
|
964
|
+
'Query: [LiftProp: [Const: meta:source], FiltOper: [Const: +, RelPropCond: [RelPropValue: [RelProp: [Const: node]], Const: range=, List: [List: [Const: test:comp, List: [Const: 1000, Const: green]], List: [Const: test:comp, List: [Const: 3000, Const: ham]]]]]]',
|
|
965
|
+
'Query: [LiftProp: [Const: meta:source]]',
|
|
966
966
|
'Query: [LiftPropBy: [Const: file:bytes:size, Const: =, Const: 4]]',
|
|
967
967
|
'Query: [ForLoop: [Const: fqdn, VarValue: [Const: fqdns], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:fqdn], Const: =, VarValue: [Const: fqdn]]]]]]',
|
|
968
968
|
"Query: [ForLoop: [VarList: ['fqdn', 'ipv4'], VarValue: [Const: dnsa], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:dns:a], Const: =, List: [VarValue: [Const: fqdn], VarValue: [Const: ipv4]]]]]]]",
|
|
@@ -973,8 +973,8 @@ _ParseResults = [
|
|
|
973
973
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 34.118560, Const: -118.300370], Const: 50m]]]',
|
|
974
974
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 0, Const: 0], Const: 50m]]]',
|
|
975
975
|
'Query: [LiftPropBy: [Const: geo:place:latlong, Const: near=, List: [List: [Const: 34.1, Const: -118.3], Const: 10km]]]',
|
|
976
|
-
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:
|
|
977
|
-
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:
|
|
976
|
+
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:source], isjoin=False, PivotIn: [], isjoin=False]',
|
|
977
|
+
'Query: [LiftPropBy: [Const: geo:place, Const: =, VarValue: [Const: place]], PivotInFrom: [Const: meta:source], isjoin=False, PivotInFrom: [Const: ps:person], isjoin=False]',
|
|
978
978
|
'Query: [LiftPropBy: [Const: geo:place, Const: =, Const: abcd], SetVarOper: [Const: latlong, RelPropValue: [Const: latlong]], SetVarOper: [Const: radius, RelPropValue: [Const: radius]], CmdOper: [Const: spin, Const: ()], LiftPropBy: [Const: tel:mob:telem:latlong, Const: near=, List: [VarValue: [Const: latlong], Const: 3km]]]',
|
|
979
979
|
'Query: [LiftPropBy: [Const: meta:note, Const: =, Const: abcd], CmdOper: [Const: noderefs, List: [Const: -d, Const: 2, Const: --join]]]',
|
|
980
980
|
'Query: [CmdOper: [Const: help, Const: ()]]',
|
|
@@ -1026,16 +1026,16 @@ _ParseResults = [
|
|
|
1026
1026
|
'Query: [LiftProp: [Const: inet:user], CmdOper: [Const: limit, List: [Const: 10]], FiltOper: [Const: +, AbsPropCond: [Const: inet:user, Const: =, Const: visi]]]',
|
|
1027
1027
|
'Query: [LiftProp: [Const: inet:user], CmdOper: [Const: limit, List: [Const: 10]], EditTagAdd: [TagName: [Const: foo, Const: bar]]]',
|
|
1028
1028
|
'Query: [LiftPropBy: [Const: media:news, Const: =, Const: 00a1f0d928e25729b9e86e2d08c127ce], EditPropSet: [RelProp: [Const: summary], Const: =, Const: ]]',
|
|
1029
|
-
'Query: [LiftPropBy: [Const: meta:
|
|
1030
|
-
'Query: [LiftPropBy: [Const: meta:
|
|
1029
|
+
'Query: [LiftPropBy: [Const: meta:source:meta:source, Const: =, VarValue: [Const: sorc]], PivotOut: [], isjoin=False]',
|
|
1030
|
+
'Query: [LiftPropBy: [Const: meta:source:meta:source, Const: =, VarValue: [Const: sorc]], PropPivotOut: [RelProp: [Const: node]], isjoin=False]',
|
|
1031
1031
|
'Query: [LiftPropBy: [Const: meta:source, Const: =, Const: 8f1401de15918358d5247e21ca29a814]]',
|
|
1032
1032
|
'Query: [CmdOper: [Const: movetag, List: [Const: a.b, Const: a.m]]]',
|
|
1033
1033
|
'Query: [CmdOper: [Const: movetag, List: [Const: hehe, Const: woot]]]',
|
|
1034
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:
|
|
1035
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:
|
|
1036
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:
|
|
1037
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:
|
|
1038
|
-
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:
|
|
1034
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:source], isjoin=False, PivotOut: [], isjoin=False]',
|
|
1035
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:source], isjoin=False, FormPivot: [Const: geo:place], isjoin=False]',
|
|
1036
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:source], isjoin=False, FiltOper: [Const: +, RelPropCond: [RelPropValue: [RelProp: [Const: time]], Const: @=, List: [Const: 2014, Const: 2017]]], FormPivot: [Const: geo:place], isjoin=False]',
|
|
1037
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:source], isjoin=False, PivotOut: [], isjoin=False]',
|
|
1038
|
+
'Query: [LiftPropBy: [Const: ps:person, Const: =, VarValue: [Const: pers]], FormPivot: [Const: meta:source], isjoin=False, PropPivotOut: [RelProp: [Const: node]], isjoin=False]',
|
|
1039
1039
|
'Query: [CmdOper: [Const: reindex, List: [Const: --form-counts]]]',
|
|
1040
1040
|
'Query: [CmdOper: [Const: sudo, Const: ()], EditNodeAdd: [FormName: [Const: inet:ipv4], Const: =, Const: 1.2.3.4]]',
|
|
1041
1041
|
'Query: [CmdOper: [Const: sudo, Const: ()], EditNodeAdd: [FormName: [Const: test:cycle0], Const: =, Const: foo], EditPropSet: [RelProp: [Const: test:cycle1], Const: =, Const: bar]]',
|
|
@@ -1185,12 +1185,12 @@ _ParseResults = [
|
|
|
1185
1185
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: bar], PivotIn: [], isjoin=False]',
|
|
1186
1186
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: bar], LiftPropBy: [Const: test:pivcomp, Const: =, List: [Const: foo, Const: bar]], EditTagAdd: [TagName: [Const: test, Const: bar]]]',
|
|
1187
1187
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], FiltOper: [Const: +, TagValuCond: [TagMatch: [Const: lol], Const: @=, Const: 2016]]]',
|
|
1188
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:
|
|
1189
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:
|
|
1188
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:source], isjoin=True]',
|
|
1189
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], PivotInFrom: [Const: meta:source], isjoin=False]',
|
|
1190
1190
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foo], CmdOper: [Const: delnode, Const: ()]]',
|
|
1191
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:
|
|
1192
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:
|
|
1193
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:
|
|
1191
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:source], isjoin=True]',
|
|
1192
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:source], isjoin=False, PivotInFrom: [Const: test:str], isjoin=True]',
|
|
1193
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: meta:source], isjoin=False, PivotInFrom: [Const: test:str], isjoin=False]',
|
|
1194
1194
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: hello], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 2001]]',
|
|
1195
1195
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: hello], EditPropSet: [RelProp: [Const: tick], Const: =, Const: 2002]]',
|
|
1196
1196
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: pennywise], CmdOper: [Const: noderefs, List: [Const: --join, Const: -d, Const: 9, Const: --traverse-edge]]]',
|
|
@@ -1206,11 +1206,11 @@ _ParseResults = [
|
|
|
1206
1206
|
'Query: [LiftProp: [Const: test:int]]',
|
|
1207
1207
|
'Query: [LiftProp: [Const: test:int]]',
|
|
1208
1208
|
'Query: [LiftProp: [Const: test:int]]',
|
|
1209
|
-
'Query: [LiftProp: [Const: inet:fqdn], CmdOper: [Const: graph, List: [Const: --degrees, Const: 2, Const: --filter, ArgvQuery: [Query: [FiltOper: [Const: -, TagCond: [TagMatch: [Const: nope]]]]], Const: --pivot, ArgvQuery: [Query: [PivotInFrom: [Const: meta:
|
|
1209
|
+
'Query: [LiftProp: [Const: inet:fqdn], CmdOper: [Const: graph, List: [Const: --degrees, Const: 2, Const: --filter, ArgvQuery: [Query: [FiltOper: [Const: -, TagCond: [TagMatch: [Const: nope]]]]], Const: --pivot, ArgvQuery: [Query: [PivotInFrom: [Const: meta:source], isjoin=False, PivotInFrom: [Const: meta:source], isjoin=False]], Const: --form-pivot, Const: inet:fqdn, ArgvQuery: [Query: [PivotIn: [], isjoin=False, CmdOper: [Const: limit, List: [Const: 20]]]], Const: --form-pivot, Const: inet:fqdn, ArgvQuery: [Query: [PivotOut: [], isjoin=False, CmdOper: [Const: limit, List: [Const: 20]]]], Const: --form-filter, Const: inet:fqdn, ArgvQuery: [Query: [FiltOper: [Const: -, AbsPropCond: [Const: inet:fqdn:issuffix, Const: =, Const: 1]]]], Const: --form-pivot, Const: syn:tag, ArgvQuery: [Query: [PivotOut: [], isjoin=False]], Const: --form-pivot, Const: *, ArgvQuery: [Query: [PivotToTags: [TagMatch: []], isjoin=False]]]]]',
|
|
1210
1210
|
"Query: [ForLoop: [Const: foo, VarValue: [Const: foos], SubQuery: [Query: [VarListSetOper: [VarList: ['fqdn', 'ipv4'], FuncCall: [VarDeref: [VarValue: [Const: foo], Const: split], CallArgs: [Const: |], CallKwargs: []]], EditNodeAdd: [FormName: [Const: inet:dns:a], Const: =, List: [VarValue: [Const: fqdn], VarValue: [Const: ipv4]]]]]]]",
|
|
1211
1211
|
'Query: [ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [], CallKwargs: []], SubQuery: [Query: [FormPivot: [Const: test:int], isjoin=False, EditTagAdd: [TagName: [VarValue: [Const: tag]]]]]]]',
|
|
1212
1212
|
'Query: [ForLoop: [Const: tag, FuncCall: [VarDeref: [VarValue: [Const: node], Const: tags], CallArgs: [Const: fo*], CallKwargs: []], SubQuery: [Query: [FormPivot: [Const: test:int], isjoin=False, EditTagDel: [TagName: [VarValue: [Const: tag]]]]]]]',
|
|
1213
|
-
'Query: [EditNodeAdd: [FormName: [Const: inet:email:message], Const: =, Const: *], EditPropSet: [RelProp: [Const: to], Const: =, Const: woot@woot.com], EditPropSet: [RelProp: [Const: from], Const: =, Const: visi@vertex.link], EditPropSet: [RelProp: [Const: replyto], Const: =, Const: root@root.com], EditPropSet: [RelProp: [Const: subject], Const: =, Const: hi there], EditPropSet: [RelProp: [Const: date], Const: =, Const: 2015], EditPropSet: [RelProp: [Const: body], Const: =, Const: there are mad sploitz here!], EditPropSet: [RelProp: [Const: bytes], Const: =, Const: *], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:link], Const: =, List: [VarValue: [Const: node], Const: https://www.vertex.link]]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:attachment], Const: =, List: [VarValue: [Const: node], Const: *]], FiltOper: [Const: -, HasAbsPropCond: [Const: inet:email:message]], EditPropSet: [RelProp: [Const: name], Const: =, Const: sploit.exe]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: meta:
|
|
1213
|
+
'Query: [EditNodeAdd: [FormName: [Const: inet:email:message], Const: =, Const: *], EditPropSet: [RelProp: [Const: to], Const: =, Const: woot@woot.com], EditPropSet: [RelProp: [Const: from], Const: =, Const: visi@vertex.link], EditPropSet: [RelProp: [Const: replyto], Const: =, Const: root@root.com], EditPropSet: [RelProp: [Const: subject], Const: =, Const: hi there], EditPropSet: [RelProp: [Const: date], Const: =, Const: 2015], EditPropSet: [RelProp: [Const: body], Const: =, Const: there are mad sploitz here!], EditPropSet: [RelProp: [Const: bytes], Const: =, Const: *], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:link], Const: =, List: [VarValue: [Const: node], Const: https://www.vertex.link]]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: inet:email:message:attachment], Const: =, List: [VarValue: [Const: node], Const: *]], FiltOper: [Const: -, HasAbsPropCond: [Const: inet:email:message]], EditPropSet: [RelProp: [Const: name], Const: =, Const: sploit.exe]]], SubQuery: [Query: [EditNodeAdd: [FormName: [Const: meta:source], Const: =, List: [VarValue: [Const: node], List: [Const: inet:email:header, List: [Const: to, Const: Visi Kensho <visi@vertex.link>]]]]]]]',
|
|
1214
1214
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [Const: 1, Const: /, Const: 3]]]]',
|
|
1215
1215
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [Const: 1, Const: *, Const: 3]]]]',
|
|
1216
1216
|
'Query: [SetVarOper: [Const: x, DollarExpr: [ExprNode: [ExprNode: [Const: 1, Const: *, Const: 3], Const: +, Const: 2]]]]',
|
|
@@ -1340,18 +1340,18 @@ _ParseResults = [
|
|
|
1340
1340
|
'Query: [LiftPropBy: [VarValue: [Const: form], Const: =, VarValue: [Const: valu]]]',
|
|
1341
1341
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns*], isjoin=False]',
|
|
1342
1342
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns:*], isjoin=False]',
|
|
1343
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:
|
|
1344
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:
|
|
1343
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:source, Const: inet:dns:a]], isjoin=False]',
|
|
1344
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:source, Const: inet:dns*]], isjoin=False]',
|
|
1345
1345
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [VarValue: [Const: foo]], isjoin=False]',
|
|
1346
1346
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns*], isjoin=True]',
|
|
1347
1347
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [Const: inet:dns:*], isjoin=True]',
|
|
1348
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:
|
|
1349
|
-
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:
|
|
1348
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:source, Const: inet:dns:a]], isjoin=True]',
|
|
1349
|
+
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [List: [Const: meta:source, Const: inet:dns*]], isjoin=True]',
|
|
1350
1350
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], FormPivot: [VarValue: [Const: foo]], isjoin=True]',
|
|
1351
1351
|
'Query: [LiftPropBy: [Const: test:str, Const: =, Const: foobar], N1Walk: [Const: refs, Const: inet:dns:*], isjoin=False]',
|
|
1352
|
-
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:
|
|
1352
|
+
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:source, Const: inet:dns:a]], isjoin=False]',
|
|
1353
1353
|
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], VarValue: [Const: foo]], isjoin=False]',
|
|
1354
|
-
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:
|
|
1354
|
+
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], List: [Const: meta:source, Const: inet:dns:a]], isjoin=True]',
|
|
1355
1355
|
'Query: [LiftPropBy: [Const: inet:fqdn, Const: =, Const: foo.com], PropPivot: [RelPropValue: [RelProp: [Const: zone]], VarValue: [Const: foo]], isjoin=True]',
|
|
1356
1356
|
'Query: [LiftFormTag: [Const: test:*, TagName: [Const: foo]]]',
|
|
1357
1357
|
'Query: [LiftFormTag: [Const: test:*, TagName: [Const: foo], Const: @=, Const: 2016]]',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ssl
|
|
2
|
-
import json
|
|
3
2
|
|
|
4
3
|
import aiohttp
|
|
5
4
|
import aiohttp.client_exceptions as a_exc
|
|
@@ -8,6 +7,7 @@ import synapse.common as s_common
|
|
|
8
7
|
import synapse.tools.backup as s_backup
|
|
9
8
|
|
|
10
9
|
import synapse.lib.coro as s_coro
|
|
10
|
+
import synapse.lib.json as s_json
|
|
11
11
|
import synapse.lib.link as s_link
|
|
12
12
|
import synapse.lib.httpapi as s_httpapi
|
|
13
13
|
import synapse.lib.version as s_version
|
|
@@ -671,7 +671,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
671
671
|
if not byts:
|
|
672
672
|
break
|
|
673
673
|
|
|
674
|
-
podes.append(
|
|
674
|
+
podes.append(s_json.loads(byts))
|
|
675
675
|
|
|
676
676
|
self.eq(podes[0][0], ('inet:ipv4', 0x01020304))
|
|
677
677
|
|
|
@@ -685,7 +685,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
685
685
|
if not byts:
|
|
686
686
|
break
|
|
687
687
|
|
|
688
|
-
msgs.append(
|
|
688
|
+
msgs.append(s_json.loads(byts))
|
|
689
689
|
podes = [m[1] for m in msgs if m[0] == 'node']
|
|
690
690
|
self.eq(podes[0][0], ('inet:ipv4', 0x05050505))
|
|
691
691
|
|
|
@@ -1322,7 +1322,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1322
1322
|
if not byts:
|
|
1323
1323
|
break
|
|
1324
1324
|
|
|
1325
|
-
mesg =
|
|
1325
|
+
mesg = s_json.loads(byts)
|
|
1326
1326
|
|
|
1327
1327
|
if mesg[0] == 'node':
|
|
1328
1328
|
node = mesg[1]
|
|
@@ -1337,7 +1337,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1337
1337
|
if not byts:
|
|
1338
1338
|
break
|
|
1339
1339
|
|
|
1340
|
-
mesg =
|
|
1340
|
+
mesg = s_json.loads(byts)
|
|
1341
1341
|
|
|
1342
1342
|
if mesg[0] == 'node':
|
|
1343
1343
|
node = mesg[1]
|
|
@@ -1354,7 +1354,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1354
1354
|
if not byts:
|
|
1355
1355
|
break
|
|
1356
1356
|
|
|
1357
|
-
node =
|
|
1357
|
+
node = s_json.loads(byts)
|
|
1358
1358
|
|
|
1359
1359
|
self.eq(0x01020304, node[0][1])
|
|
1360
1360
|
|
|
@@ -1365,7 +1365,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1365
1365
|
if not byts:
|
|
1366
1366
|
break
|
|
1367
1367
|
|
|
1368
|
-
node =
|
|
1368
|
+
node = s_json.loads(byts)
|
|
1369
1369
|
|
|
1370
1370
|
self.eq(0x01020304, node[0][1])
|
|
1371
1371
|
|
|
@@ -1385,8 +1385,8 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1385
1385
|
break
|
|
1386
1386
|
|
|
1387
1387
|
try:
|
|
1388
|
-
node =
|
|
1389
|
-
except
|
|
1388
|
+
node = s_json.loads(byts)
|
|
1389
|
+
except s_exc.BadJsonText:
|
|
1390
1390
|
bufr = jstr
|
|
1391
1391
|
break
|
|
1392
1392
|
|
|
@@ -1407,8 +1407,8 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1407
1407
|
break
|
|
1408
1408
|
|
|
1409
1409
|
try:
|
|
1410
|
-
mesg =
|
|
1411
|
-
except
|
|
1410
|
+
mesg = s_json.loads(byts)
|
|
1411
|
+
except s_exc.BadJsonText:
|
|
1412
1412
|
bufr = jstr
|
|
1413
1413
|
break
|
|
1414
1414
|
|
|
@@ -1427,7 +1427,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1427
1427
|
if not byts:
|
|
1428
1428
|
break
|
|
1429
1429
|
|
|
1430
|
-
mesg =
|
|
1430
|
+
mesg = s_json.loads(byts)
|
|
1431
1431
|
if mesg[0] == 'node':
|
|
1432
1432
|
task = core.boss.tasks.get(list(core.boss.tasks.keys())[0])
|
|
1433
1433
|
self.eq(core.view.iden, task.info.get('view'))
|
|
@@ -1445,7 +1445,7 @@ class HttpApiTest(s_tests.SynTest):
|
|
|
1445
1445
|
if not byts:
|
|
1446
1446
|
break
|
|
1447
1447
|
|
|
1448
|
-
mesg =
|
|
1448
|
+
mesg = s_json.loads(byts)
|
|
1449
1449
|
self.len(2, mesg) # Is if roughly shaped like a node?
|
|
1450
1450
|
task = core.boss.tasks.get(list(core.boss.tasks.keys())[0])
|
|
1451
1451
|
break
|