Assets
Under Construction. Thanks for your patience.

Generating Report Level Asset Information

The below lists out asset information tied to the report level.1
1
{%p if REPORT_ASSETS %}
2
{%p for assetID, assetData in REPORT_ASSETS.items() %}
3
Asset Info:
4
{%p for key, value in assetData.items() %}
5
{{ key }}: {{ value }}
6
{%p endfor %}
7
{%p endfor %}
8
{%p endif %}
Copied!
The above code spits out a list like below. Not the lack of port, protocol, and service information present at the finding level.
1
Asset Info:
2
id: 1035529d-49ae-496a-8dcd-ebd5b6c67937
3
asset: machine_ip
4
parent_asset:
5
assetCriticality:
6
type:
7
created: 2021-03-03T19:13:43.321Z
8
data_owner:
9
system_owner:
10
physical_location:
11
description:
12
tags: []
Copied!

Display A list Of Assets in Three Columns With Bullets

1
{%p set list1 = [] %}
2
{%p set list2 = [] %}
3
{%p set list3 = [] %}
4
{%p set nn=namespace(index=0) %}
5
{%p set nn.modulo = 0 %}
6
{%p set nn.col2_total = 0 %}
7
{%p set nn.col3_total = 0 %}
8
{%p for group in FINDINGS %}
9
{%p for f in group.FINDINGS %}
10
{%p if f.affected_assets %}
11
{%p for asset_id, values in f.assets.items() %}
12
{%p set nn.index = nn.index + 1 %}
13
{%p set nn.modulo = nn.index - (( nn.index // 3) * 3) %} {# replace “3”s with your denominator #}
14
{%p if nn.modulo == 1 %}
15
{%p if list1.append(REPORT_ASSETS[asset_id].asset) %}
16
{%p endif %}
17
{%p elif nn.modulo == 2 %}
18
{%p if list2.append(REPORT_ASSETS[asset_id].asset) %}
19
{%p endif %}
20
{%p set nn.col2_total = nn.col2_total + 1 %}
21
{%p elif nn.modulo == 0 %}
22
{%p if list3.append(REPORT_ASSETS[asset_id].asset) %}
23
{%p endif %}
24
{%p set nn.col3_total = nn.col3_total + 1 %}
25
{%p endif %}
26
{%p endfor %}
27
{%p endif %}
28
{%p endfor %}
29
{%p endfor %}
30
{%p for item in list1 %}
31
{%p if nn.col3_total - loop.index >= 0 %}
Copied!
  • {{ list1[loop.index0] }}
  • {{ list2[loop.index0] }}
  • {{ list3[loop.index0] }}
1
{%p elif nn.col2_total - loop.index >= 0 %}
Copied!
  • {{ list1[loop.index0] }}
  • {{ list2[loop.index0] }}
1
{%p else %}
Copied!
  • {{ list1[loop.index0] }}
1
{%p endif %}
2
{%p endfor %}
Copied!

References for Affected Asset Data

1
{%p for group in FINDINGS %}
2
{%p for f in group.FINDINGS %}
3
{%p if f.affected_assets %}
4
{%p for asset_id, asset_data in f.assets.items() %}
5
{{ asset_id }} {# the asset_id is the asset name }}
6
{{ asset_data.status }}
7
{{ asset_data.subStatus }}
8
{{ asset_data.name }}
9
{{ asset_data.hostname }
10
{{ asset_data.created_at }} {# epoch time #}
11
{{ asset_data.created_at_us }} {# human readable US timestamp in UTC #}
12
{{ asset_data.created_at_eu }} {# human readable EU timestamp in UTC #}
13
{{ asset_data.netbios_name }}
14
{{ asset_data.mac_address }}
15
{{ asset_data.host_fqdn }}
16
{{ asset_data.host_rdns }}
17
{{ asset_data.total_cves }}
18
{{ asset_data.operating_system }}
19
{%p for port_id, port_data in values.ports.items() %}
20
{{ port_id }} {# the port_id is the port number}
21
{{ port_data.number }} {# port number #} See Note Below
22
{{ port_data.protocol }} {# tcp/udp #}
23
{{ port_data.service }} {# cifs, ntlm, ssh, etc) #}
24
{%p endfor %}
25
{%p endfor %}
26
{%p endif %}
27
{%p endfor %}
28
{%p endfor %}
Copied!
Last modified 4mo ago