creating a Secret leak tool in servicenow using scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:41 AM
Hello all,
I have a use case where I need to look for words like "pwd, pass, secret, secretk, password, login, credential" ...etc, this is to find incidents or tasks where users or the support team wrote the credentials of a user in a ticket,
I started work on it in background script, but I stuck, I don't have idea how I m gonna send to the security team the result which the list of the tickets where the credentials are found
Do you have any idea how can i share the results with the security team by script ?
Thank you for reading me
Best regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:54 AM - edited 03-07-2024 01:55 AM
@Nesrine1 Prepare an array of sys_ids for such incidents where keywords are used. Create a separate event and trigger the event at the end of the script. Prepare a notification which will get triggered via the event created in the step 1.
gs.eventQueue('incident.updated', current, gs.getUserID(), sysIDArray);
Pass sysIDArray as param1 or param 2 in the eventQueue.
Create an email script and capture the sysIDArray from it and fetch the incident details with the help of sys_ids stored in the array.
Prepare the notification using template.print and send that notification to respective group.
Hope this helps.