<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DQL  to pull vulnerabilities for each host in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239726#M723</link>
    <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40713"&gt;@PacoPorro&lt;/a&gt;&amp;nbsp;my bad.. i got it. Thanks a lot for providing dql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tijust1_1-1710318881890.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18250i36FFEAA83E9ED746/image-size/large?v=v2&amp;amp;px=999" role="button" title="tijust1_1-1710318881890.png" alt="tijust1_1-1710318881890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 08:33:21 GMT</pubDate>
    <dc:creator>sujit_k_singh</dc:creator>
    <dc:date>2024-03-13T08:33:21Z</dc:date>
    <item>
      <title>DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239697#M720</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do we have DQL functionality available to pull vulnerabilities for each host?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if anyone has done it. I am looking for a DQL query to fetch vulnerabilities for each host along with other details.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tijust1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 05:15:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239697#M720</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2024-03-13T05:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239702#M721</link>
      <description>&lt;LI-CODE lang="php"&gt;fetch events
| filter event.kind == "SECURITY_EVENT"
| filter event.category == "VULNERABILITY_MANAGEMENT"
| filter event.type == "VULNERABILITY_STATE_REPORT_EVENT"
| filter event.level == "ENTITY"
| fieldsAdd vulnerability.id, vulnerability.external_url, vulnerability.external_id, vulnerability.references.owasp, vulnerability.url, vulnerability.display_id, vulnerability.description, vulnerability.references.cve, vulnerability.title, related_entities.services.ids, vulnerability.parent.davis_assessment.exposure_status, vulnerability.davis_assessment.exploit_status, vulnerability.davis_assessment.exposure_status, affected_entities.vulnerable_components.ids, vulnerability.stack, related_entities.databases.ids, vulnerability.parent.davis_assessment.score, vulnerability.technology, vulnerability.references.cwe, related_entities.hosts.ids
| expand related_entities.hosts.ids
| lookup [
    fetch dt.entity.host
    | fieldsAdd entity.name
  ], sourceField:related_entities.hosts.ids, lookupField:id, prefix:"host."&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 07:26:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239702#M721</guid>
      <dc:creator>PacoPorro</dc:creator>
      <dc:date>2024-03-13T07:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239723#M722</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40713"&gt;@PacoPorro&lt;/a&gt;&amp;nbsp;Thanks for quick response. is there way to get in table format as I am getting result like belo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tijust1_0-1710318561693.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18249i1B1C11817BC2FA53/image-size/large?v=v2&amp;amp;px=999" role="button" title="tijust1_0-1710318561693.png" alt="tijust1_0-1710318561693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 08:28:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239723#M722</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2024-03-13T08:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239726#M723</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40713"&gt;@PacoPorro&lt;/a&gt;&amp;nbsp;my bad.. i got it. Thanks a lot for providing dql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tijust1_1-1710318881890.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18250i36FFEAA83E9ED746/image-size/large?v=v2&amp;amp;px=999" role="button" title="tijust1_1-1710318881890.png" alt="tijust1_1-1710318881890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 08:33:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239726#M723</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2024-03-13T08:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239730#M724</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40713"&gt;@PacoPorro&lt;/a&gt;&amp;nbsp;is there way to get details for only one MZ. I mean if there is any filter option to choose certain MZ.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 08:54:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239730#M724</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2024-03-13T08:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239734#M725</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67382"&gt;@sujit_k_singh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the above mentioned query will show you a lot of duplicates, as it shows you all the events from all snapshots, whereas you probably only want the most recent information.&lt;/P&gt;&lt;P&gt;for that you'd need a query similar to the one explained here: &lt;A href="https://docs.dynatrace.com/docs/platform-modules/application-security/security-data-on-grail/examples#vulnerabilities-per-host" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/application-security/security-data-on-grail/examples#vulnerabilities-per-host&lt;/A&gt;&lt;/P&gt;&lt;P&gt;slightly adjusted and adding the host information in the final table could e.g. look like this (changes in &lt;STRONG&gt;bold&lt;/STRONG&gt;) :&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;fetch events&lt;BR /&gt;| filter dt.system.bucket=="default_security_events"&lt;BR /&gt;| filter event.provider=="Dynatrace"&lt;BR /&gt;| filter event.type=="VULNERABILITY_STATE_REPORT_EVENT"&lt;BR /&gt;| filter event.level=="ENTITY"&lt;BR /&gt;// get latest snapshot&lt;BR /&gt;| sort timestamp, direction:"descending"&lt;BR /&gt;| summarize {&lt;BR /&gt;vulnerability.parent.first_seen=takeFirst(vulnerability.parent.first_seen),&lt;BR /&gt;vulnerability.resolution.status=takeFirst(vulnerability.resolution.status),&lt;BR /&gt;vulnerability.mute.status=takeFirst(vulnerability.mute.status),&lt;BR /&gt;vulnerability.parent.resolution.status=takeFirst(vulnerability.parent.resolution.status),&lt;BR /&gt;vulnerability.parent.resolution.change_date=takeFirst(vulnerability.parent.resolution.change_date),&lt;BR /&gt;vulnerability.parent.mute.status=takeFirst(vulnerability.parent.mute.status),&lt;BR /&gt;vulnerability.parent.risk.score=takeFirst(vulnerability.parent.risk.score),&lt;BR /&gt;vulnerability.risk.score=takeFirst(vulnerability.risk.score),&lt;BR /&gt;vulnerability.parent.risk.level=takeFirst(vulnerability.parent.risk.level),&lt;BR /&gt;vulnerability.risk.level=takeFirst(vulnerability.risk.level),&lt;BR /&gt;vulnerability.stack=takeFirst(vulnerability.stack),&lt;BR /&gt;vulnerability.type=takeFirst(vulnerability.type),&lt;BR /&gt;vulnerability.external_id=takeFirst(vulnerability.external_id),&lt;BR /&gt;vulnerability.references.cve=takeFirst(vulnerability.references.cve),&lt;BR /&gt;vulnerability.technology=takeFirst(vulnerability.technology),&lt;BR /&gt;vulnerability.resolution.change_date=takeFirst(vulnerability.resolution.change_date),&lt;BR /&gt;vulnerability.mute.change_date=takeFirst(vulnerability.mute.change_date),&lt;BR /&gt;vulnerability.title=takeFirst(vulnerability.title),&lt;BR /&gt;vulnerability.davis_assessment.exposure_status=takeFirst(vulnerability.davis_assessment.exposure_status),&lt;BR /&gt;vulnerability.davis_assessment.exploit_status=takeFirst(vulnerability.davis_assessment.exploit_status),&lt;BR /&gt;vulnerability.davis_assessment.vulnerable_function_status=takeFirst(vulnerability.davis_assessment.vulnerable_function_status),&lt;BR /&gt;vulnerability.davis_assessment.data_assets_status=takeFirst(vulnerability.davis_assessment.data_assets_status),&lt;BR /&gt;affected_entity.vulnerable_component.name=takeFirst(affected_entity.vulnerable_component.name),&lt;BR /&gt;affected_entity.management_zones.names=takeFirst(affected_entity.management_zones.names),&lt;BR /&gt;affected_entity.name=takeFirst(affected_entity.name),&lt;BR /&gt;related_entities.hosts.names=takeFirst(related_entities.hosts.names),&lt;BR /&gt;related_entities.kubernetes_workloads.names=takeFirst(related_entities.kubernetes_workloads.names),&lt;BR /&gt;related_entities.kubernetes_clusters.names=takeFirst(related_entities.kubernetes_clusters.names),&lt;BR /&gt;related_entities.databases.count=takeFirst(related_entities.databases.count),&lt;BR /&gt;timestamp=takeFirst(timestamp)&lt;BR /&gt;}, by: {vulnerability.display_id, affected_entity.id}&lt;BR /&gt;// end of get latest snapshot&lt;BR /&gt;&lt;STRONG&gt;//| filter iAny(in("i-05f1305a50721e04d",related_entities.hosts.names[])) OR affected_entity.name=="i-05f1305a50721e04d" // filter by name of the related/affected host&lt;/STRONG&gt;&lt;BR /&gt;// now summarize on the vulnerability level&lt;BR /&gt;| summarize{&lt;BR /&gt;vulnerability.parent.first_seen=takeFirst(vulnerability.parent.first_seen),&lt;BR /&gt;vulnerability.parent.resolution.status=takeFirst(vulnerability.parent.resolution.status),&lt;BR /&gt;vulnerability.parent.resolution.change_date=takeFirst(vulnerability.parent.resolution.change_date),&lt;BR /&gt;vulnerability.parent.mute.status=takeFirst(vulnerability.parent.mute.status),&lt;BR /&gt;vulnerability.title=takeFirst(vulnerability.title),&lt;BR /&gt;vulnerability.references.cve=takeFirst(vulnerability.references.cve),&lt;BR /&gt;&lt;STRONG&gt;related_entities.hosts.names=takeFirst(related_entities.hosts.names),&lt;/STRONG&gt;&lt;BR /&gt;affected_entity.vulnerable_component.names=collectDistinct(affected_entity.vulnerable_component.name),&lt;BR /&gt;Critical=countIf(vulnerability.risk.level=="CRITICAL"),&lt;BR /&gt;High=countIf(vulnerability.risk.level=="HIGH"),&lt;BR /&gt;Medium=countIf(vulnerability.risk.level=="MEDIUM"),&lt;BR /&gt;Low=countIf(vulnerability.risk.level=="LOW"),&lt;BR /&gt;vulnerability.risk.score=round(takeMax(vulnerability.risk.score),decimals:1),&lt;BR /&gt;`Affected entities`=arraySize(collectDistinct(affected_entity.id)),&lt;BR /&gt;`# Non-muted entities`=countIf(vulnerability.mute.status=="NOT_MUTED"),&lt;BR /&gt;`# Afftected entities`=countIf(vulnerability.resolution.status=="OPEN"),&lt;BR /&gt;`# Function in use`=countIf(vulnerability.davis_assessment.vulnerable_function_status=="IN_USE"),&lt;BR /&gt;`# Exposure to internet`=countIf(vulnerability.davis_assessment.exposure_status=="PUBLIC_NETWORK"),&lt;BR /&gt;`# Exploit published`=countIf(vulnerability.davis_assessment.exploit_status=="AVAILABLE"),&lt;BR /&gt;`# Reachable databases`=countIf(vulnerability.davis_assessment.data_assets_status=="REACHABLE")&lt;BR /&gt;}, by: {vulnerability.display_id}&lt;BR /&gt;| fieldsAdd vulnerability.risk.level=if(Critical&amp;gt;0,"CRITICAL",&lt;BR /&gt;else:if(High&amp;gt;0,"HIGH",&lt;BR /&gt;else:if(Medium&amp;gt;0,"MEDIUM",&lt;BR /&gt;else:"LOW")))&lt;BR /&gt;| fields&lt;BR /&gt;vulnerability.display_id,&lt;BR /&gt;&lt;STRONG&gt;related_entities.hosts.names,&lt;/STRONG&gt;&lt;BR /&gt;vulnerability.risk.level,&lt;BR /&gt;vulnerability.risk.score,&lt;BR /&gt;vulnerability.title,&lt;BR /&gt;vulnerability.references.cve,&lt;BR /&gt;vulnerability.parent.resolution.status,&lt;BR /&gt;vulnerability.parent.mute.status,&lt;BR /&gt;vulnerability.parent.first_seen,&lt;BR /&gt;status_sort=if(vulnerability.parent.resolution.status=="RESOLVED",3,else:if( vulnerability.parent.mute.status=="MUTED" OR `# Non-muted entities`==0,2,else:1)),&lt;BR /&gt;`# Function in use`,&lt;BR /&gt;`# Afftected entities`,&lt;BR /&gt;`# Exposure to internet`,&lt;BR /&gt;`# Exploit published`,&lt;BR /&gt;`# Reachable databases`&lt;BR /&gt;| sort status_sort, {vulnerability.risk.score, direction:"descending"}, {`# Function in use`, direction:"descending"},&lt;BR /&gt;{`# Exposure to internet`, direction:"descending"}, {`# Exploit published`, direction:"descending"},&lt;BR /&gt;{`# Reachable databases`, direction:"descending"}, {`# Afftected entities`,direction:"descending"}, {vulnerability.parent.first_seen,direction:"descending"}&lt;BR /&gt;| fieldsRemove status_sort&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH,&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 09:42:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/239734#M725</guid>
      <dc:creator>c_schwarzbauer</dc:creator>
      <dc:date>2024-03-13T09:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/240326#M740</link>
      <description>&lt;P&gt;Do we have the option to get the same infomation (vulnerabilities per host) in Dynatrace Managed without DQL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 17:19:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/240326#M740</guid>
      <dc:creator>DamianG</dc:creator>
      <dc:date>2024-03-18T17:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: DQL  to pull vulnerabilities for each host</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/240958#M764</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52344"&gt;@DamianG&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you try using the Environment API v2, as described here: &lt;A href="https://docs.dynatrace.com/docs/dynatrace-api/environment-api/application-security/vulnerabilities/get-vulnerabilities" target="_blank"&gt;https://docs.dynatrace.com/docs/dynatrace-api/environment-api/application-security/vulnerabilities/get-vulnerabilities&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;using the 'relatedHostNames' (or similar) for filtering via the 'securityProblemSelector' should be able to address your use case, I think.&lt;/P&gt;&lt;P&gt;HTH, Chris&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:52:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-pull-vulnerabilities-for-each-host/m-p/240958#M764</guid>
      <dc:creator>c_schwarzbauer</dc:creator>
      <dc:date>2024-03-25T12:52:41Z</dc:date>
    </item>
  </channel>
</rss>

