Skip to content

Commit

Permalink
Corrected Tag Space Issue #253
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMcGrath committed May 16, 2024
1 parent b446293 commit aee87eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tenb2jira/tenable/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ def tvm_merged_data(assets_iter: 'ExportsIterator',
# other asset attributes available within the finding for the Jira ticket
# without build a database to match everything up into.
assets = {}
def spf(value: str) -> str:
return value.replace(' ', '_')
for asset in assets_iter:
assets[asset['id']] = {
'tags': [f'{t["key"]}:{t["value"]}' for t in asset['tags']],
'tags': [f'{spf(t["key"])}:{spf(t["value"])}'
for t in asset['tags']],
'ipv4': asset['ipv4s'],
'ipv6': asset['ipv6s'],
}
Expand Down
2 changes: 1 addition & 1 deletion tenb2jira/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '2.0.1'
version = '2.0.2'
6 changes: 4 additions & 2 deletions tests/tenable/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tvm_assets():
'value': 'Illinois',
},
{
'key': 'Test',
'key': 'Test Value',
'value': 'Something'
}
],
Expand Down Expand Up @@ -150,7 +150,9 @@ def test_tvm_merged_data(tvm_assets, tvm_finding):
)
finding = next(tvm_generator)
assert finding['asset.uuid'] == '7f68f334-17ba-4ba0-b057-b77ddd783e60'
assert finding['asset.tags'] == ['Location:Illinois', 'Test:Something']
assert finding['asset.tags'] == ['Location:Illinois',
'Test_Value:Something'
]
assert finding['integration_finding_id'] == test_uuid
assert finding['integration_pid_updated'] == pmoddate
assert finding['asset.test'] == 'value'
Expand Down

0 comments on commit aee87eb

Please sign in to comment.