# API - get alerts for a process group third-party vul

**URL:** <https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765>\
**Category:** Dynatrace API\
**Tags:** application-security, dynatrace-api\
**Created:** [December 20, 2022, 9:24pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765 "2022-12-20T21:24:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sami](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sami](https://community.dynatrace.com/u/Sami)\
**Post date:** [December 20, 2022, 9:24pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/1 "2022-12-20T21:24:26Z")

</div>

Hi,

In an effort to pull the alerts for a process including the environmental specific factors (exposed, first seen for this process, data ) we have to do the following:

1. Pull all the alerts with the query parameter&nbsp;affectedPgNameContains&nbsp;using “[GET all problems](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/application-security/security-problems/get-all)”
2. iterate over all the results to get the specifics for a process - using multiple other calls to "[GET problem events"](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/application-security/security-problems/get-problem-events)

A process that is not practical to scale !!

Is there a single API call that returns the alerts for a specific process ?

Ex. Get security alerts for&nbsp;affectedPgNameContains='something ’

Thanks,

Sami

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [December 21, 2022, 8:29am UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/2 "2022-12-21T08:29:41Z")

</div>

Hello&nbsp;[@Sami](https://community.dynatrace.com/user/55266),

I recommend checking the Dynatrace Api explorer “Environment API V2” in the endpoint “/securityProblems”.

You could use the parameter “securityProblemSelector” to filter on the entity of your choice, for example :

 ![AurelienGravier_0-1671611289365.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/e/aea06209246f5b92f99c036365f527cb22146f51.png)

Curl command generated :

curl -X GET “https://{environmentid}.live.dynatrace.com/api/v2/securityProblems? **securityProblemSelector=affectedPgNameContains%28%22something%22%29** &from=-3d” -H “accept: application/json; charset=utf-8”

Regards Aurélien.

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [December 21, 2022, 8:31am UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/3 "2022-12-21T08:31:16Z")

</div>

Dynatrace API Explorer is accessible here for SaaS Environment :

https://{environmentid}.live.dynatrace.com/rest-api-doc/index.jsp

---

<div class="post-metadata">

**Author:** ![Sami](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sami](https://community.dynatrace.com/u/Sami)\
**Post date:** [December 21, 2022, 5:41pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/4 "2022-12-21T17:41:47Z")

</div>

Hi Aurélien,

Unfortunately this is not what I am hoping for.

For this endpoint

input: process group name

output: all security alerts where this process is affected (no specifics if the process is exposed or the first detected timestamp for this process)

what I am looking for

input: process group name

output: list of security problems and the specifics for this process (exposure, when each security alert was first detected for this process, )

error: if the process searched for is not running or never ran return an error accordingly

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [December 22, 2022, 9:09am UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/5 "2022-12-22T09:09:20Z")

</div>

Hi&nbsp;[@Sami](https://community.dynatrace.com/user/55266)

Have you try to add addditionnal fields like&nbsp;+riskAssessment,+codeLevelVulnerabilityDetails :

 ![AurelienGravier_0-1671699941583.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d2bc977814f5643eecbbc9ddc24c912ba0fff307.png)

curl -X GET “https://{environmentid}.live.dynatrace.com/api/v2/securityProblems?securityProblemSelector=affectedPgNameContains%28%22something%22%29&fields=%2BriskAssessment%2C%2BcodeLevelVulnerabilityDetails” -H “accept: application/json; charset=utf-8”

If you don’t have information expected with these additional fields, you will need to iterate&nbsp;[GET problem events](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/application-security/security-problems/get-problem-events?_ga=2.14538999.1532754876.1671447652-178904142.1671447652&_gac=1.125487608.1671015835.CjwKCAiAheacBhB8EiwAItVO258OB2uFbFQONB6UiDKLBg6gim46md3yV55VsQKIxqzTzFtdc_5pRRoCIEkQAvD_BwE) with each Problem ID.

Regards

---

<div class="post-metadata">

**Author:** ![Sami](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sami](https://community.dynatrace.com/u/Sami)\
**Post date:** [December 23, 2022, 3:51pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/6 "2022-12-23T15:51:29Z")

</div>

Hi&nbsp;&nbsp;[@AurelienGravier](https://community.dynatrace.com/user/44995)&nbsp;,

Unfortunately this does not help, codeanalysis is not of concern. and&nbsp;riskAssessment: A risk assessment of the security problem not specific to the process.

The only workaround is the iteration, but it is very api calls intensive to be used for automation, we need a new endpoint that directly provide the result.

+ [@susanst00](https://community.dynatrace.com/user/51336)

Regards,

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [December 23, 2022, 4:07pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/7 "2022-12-23T16:07:11Z")

</div>

OK I understand.  
Personnaly, I often iterate easily a lot of entities on more than 1500 Hosts with ansible jobs for a client environment to automatically switch hosts from full stack monitoring to infra-only based on process group technologies detected on hosts. And it works like a charm.

Regards.

---

<div class="post-metadata">

**Author:** ![Sami](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sami](https://community.dynatrace.com/u/Sami)\
**Post date:** [December 23, 2022, 4:12pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/8 "2022-12-23T16:12:59Z")

</div>

Could you please help suggest this as a product idea ?

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [December 26, 2022, 9:12am UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/9 "2022-12-26T09:12:55Z")

</div>

Sure, you can submit it yourself here :&nbsp;[https://community.dynatrace.com/t5/forums/postpage/board-id/DynatraceProductIdeas](https://community.dynatrace.com/t5/forums/postpage/board-id/DynatraceProductIdeas)

---

<div class="post-metadata">

**Author:** ![susanst00](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@susanst00](https://community.dynatrace.com/u/susanst00)\
**Post date:** [December 28, 2022, 3:52pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/10 "2022-12-28T15:52:01Z")

</div>

[@Sami](https://community.dynatrace.com/user/55266)&nbsp;- As mentioned below, I don’t think this is possible today, but I’ve created a product idea on your behalf.

-susan

---

<div class="post-metadata">

**Author:** ![Sami](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sami](https://community.dynatrace.com/u/Sami)\
**Post date:** [January 9, 2023, 3:52pm UTC](https://community.dynatrace.com/t/api-get-alerts-for-a-process-group-third-party-vul/37765/11 "2023-01-09T15:52:14Z")

</div>

Much appreciated&nbsp;[@susanst00](https://community.dynatrace.com/user/51336)&nbsp;you rock&nbsp;:rocket:
