# Can you Identify Which Synthetic is causing Account Lockout?

**URL:** <https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132>\
**Category:** Synthetic Monitoring\
**Tags:** synthetic-monitoring\
**Created:** [May 12, 2022, 3:12pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132 "2022-05-12T15:12:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [May 12, 2022, 3:12pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/1 "2022-05-12T15:12:47Z")

</div>

Hi everyone,

We allow for our users to create their own synthetics and we believe that someone has created one that uses their personal account to login to their site. Security enforces password changes every x number of days and their password has been changed recently and seems to line up with when their account began being locked out. We believe the synthetic they configured is causing the lockout but don’t know the name of it. My question is if there is somewhere in AG logs that will show the synthetic name. If it is logged then I think we will be setting up some log alerting to get notified of this.

We do have a fair amount of synthetics so I’m looking for a way to easily know the synthetic name rather than checking ones we think may be the culprit.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 12, 2022, 5:30pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/2 "2022-05-12T17:30:12Z")

</div>

Have you tried going the API route?

You should first get the list of all them,

> **[Synthetic monitors API - GET all monitors](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/synthetic/synthetic-monitors/get-all-monitors)**
>
> List all synthetic monitors via the Synthetic v1 API.

then get the properties of each one,

> **[Synthetic monitors API - GET a monitor](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/synthetic/synthetic-monitors/get-a-monitor)**
>
> View a synthetic monitor via the Synthetic v1 API.

and search inside the data collected.

This is also a great way to get backups for all those measurements.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [May 12, 2022, 5:40pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/3 "2022-05-12T17:40:19Z")

</div>

I imagine this would be valid in showing if the username was provided in clear text (not stored in credential vault) but then you would also have to loop through all the configuration. While this could be done, I was hoping to have something logged that can be easily searched an alerted on via a script using cron.

In addition to this, looping through with an api doesn’t account for synthetics that are using credentials in the credential vault. I imagine this would only tell you the credential name in which case you would then have to issue another call to get details about the specific credential associated with what is being used in the credential. On top of that, you won’t be able to see the username associated with that credential, that info is not provided

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 12, 2022, 5:44pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/4 "2022-05-12T17:44:55Z")

</div>

So, basically you want to know which monitors use a certain entry in the Vault?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [May 13, 2022, 10:43am UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/5 "2022-05-13T10:43:05Z")

</div>

Since this is being done when you know the user whose account is being locked you could pull all the monitors that have credentials owned by that person.

> **[Synthetic monitors API - GET all monitors](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/synthetic/synthetic-monitors/get-all-monitors)**
>
> List all synthetic monitors via the Synthetic v1 API.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [May 13, 2022, 1:41pm UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/6 "2022-05-13T13:41:51Z")

</div>

I did exactly that to find a monitor that was causing the exactly issue mentioned on this topic.

To help others, here are the code I used:

```python
dannemca@MBP-de-Danne Scripts-API % cat get-synth.sh 
rm -rf http-synthetic-details-all.csv
curl -X GET "https://${tenant}.live.dynatrace.com/api/v1/synthetic/monitors" -H 'Authorization: Api-token ${token}' > sresponse.json
python3 get-synthetic.py > synthetic_all.csv
for i in `cat synthetic_all.csv`
do
    curl -X GET "https://${tenant}.live.dynatrace.com/api/v1/synthetic/monitors/${i}" -H 'Authorization: Api-token ${token}' > allsynth.json 
    echo `python3 get-synthetic-all.py` >> http-synthetic-details-all.csv
done

dannemca@MBP-de-Danne Scripts-API % cat get-synthetic.py
import json

f = open('sresponse.json',)
data = json.load(f)
for i in data['monitors']:
	print(i['entityId'])

dannemca@MBP-de-Danne Scripts-API % cat get-synthetic-all.py
import json

f = open('allsynth.json',)
data = json.load(f)
print(data)

```

Once done, you can just _cat&nbsp;http-synthetic-details-all__.csv | grep [user@id.com](mailto:user@id.com)_.

If the user ID is into a credential vault, I think is even easier, since you can just list all the vaults from that user and filter the monitors on the Synthetic list.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [June 2, 2022, 1:18am UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/7 "2022-06-02T01:18:54Z")

</div>

It really shouldn’t be isolated to credentials stored in the credential vault. Although of course recommended to store them there, we allow our teams to create their own synthetics and can’t be sure that it is always stored there.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [June 2, 2022, 1:19am UTC](https://community.dynatrace.com/t/can-you-identify-which-synthetic-is-causing-account-lockout/35132/8 "2022-06-02T01:19:29Z")

</div>

Thanks for this, I will give it a try sometime soon
