Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions synapse/models/risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ async def _normPyStr(self, text, view=None):
),
'display': {
'columns': (
{'type': 'prop', 'opts': {'name': 'software:name'}},
{'type': 'prop', 'opts': {'name': 'software:names'}},
{'type': 'prop', 'opts': {'name': 'name'}},
{'type': 'prop', 'opts': {'name': 'names'}},
{'type': 'prop', 'opts': {'name': 'reporter:name'}},
{'type': 'prop', 'opts': {'name': 'tag'}},
),
Expand Down Expand Up @@ -394,16 +394,6 @@ async def _normPyStr(self, text, view=None):
('software', ('it:software', {}), {
'prevnames': ('soft',),
'doc': 'The authoritative software family for the tool.'}),

('software:name', ('meta:name', {}), {
'alts': ('software:names',),
'prevnames': ('soft:name',),
'doc': "The source's name for the tool."}),

('software:names', ('array', {'type': 'meta:name'}), {
'prevnames': ('soft:names',),
'doc': "The source's alternate names for the tool."}),

)),
('risk:mitigation:type:taxonomy', {}, ()),
('risk:mitigation', {}, (
Expand Down
10 changes: 5 additions & 5 deletions synapse/tests/test_model_risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ async def test_model_risk_tool_software(self):
[ risk:tool:software=*
:software=*
:used=(2012,?)
:software:name=cobaltstrike
:software:names=(beacon,)
:name=cobaltstrike
:names=(beacon,)
:reporter={[ ou:org=({"name": "vertex"}) ]}
:reporter:name=vertex
:reporter:discovered=202202
Expand All @@ -506,14 +506,14 @@ async def test_model_risk_tool_software(self):
self.eq(1675209600000000, nodes[0].get('reporter:published'))
self.eq('AAAbbb123', nodes[0].get('id'))

self.eq('cobaltstrike', nodes[0].get('software:name'))
self.eq(('beacon',), nodes[0].get('software:names'))
self.eq('cobaltstrike', nodes[0].get('name'))
self.eq(('beacon',), nodes[0].get('names'))

self.len(1, await core.nodes('risk:tool:software -> ou:org'))
self.len(1, await core.nodes('risk:tool:software -> syn:tag'))
self.len(1, await core.nodes('risk:tool:software -> it:software'))

self.len(1, nodes := await core.nodes('[ risk:tool:software=({"software:name": "beacon"}) ]'))
self.len(1, nodes := await core.nodes('[ risk:tool:software=({"name": "beacon"}) ]'))
self.eq(node.ndef, nodes[0].ndef)

async def test_model_risk_vuln_technique(self):
Expand Down