Mass triaging unmanaged assets #1212
AAuraa
started this conversation in
Show and Tell
Replies: 1 comment 4 replies
-
Hi @AAuraa - Thank you for sharing your solution! 😃 Do you mind if we add this to our sample library? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
Recently within my environment, I have been working on getting a bearing on our unmanaged assets pulled from AD that reportedly have no sensor. After digging around, I realized many of the devices listed actually had an entry in the managed assets section, meaning they did have a sensor, so I could set the status of the corresponding unmanaged asset to reviewed. However, there was no good way for me to mass sort these by hostname, and with around 800, manually doing so was not a great option.
I decided to try and find a better method to approach the issue, and using direct API calls, still had an issue when I was trying to use the exposure-management calls with an internal_id. So I decided to use FalconPy to automate this process from a CSV of hostnames.
This project also requires a workflow component, since I believe the API call that allows for triage of assets via exposure management is either broken, or I am just using it entirely wrong. Whatever the case, the workflow for asset triage works perfectly, I just need to get the right internal_id, and management type.
Idea link
https://us-2.ideas.crowdstrike.com/ideas/IDEA-I-14230
Python script
mass_unmanaged_host_triage.py
Workflow
The workflow can be found below in .txt format, make sure you change it to .yml and when you import it, change the settings to match what you want (edit email fields, etc.).
mass_triage_unmanaged_assets.txt
Runtime
I found when running this with 800 or so assets it took about 7 hours for the workflow iterations to all finish, but when I ran it again with 75 devices, it took about 2 minutes. So your experience may vary, but you can monitor the execution status to ensure its doing something.
If you plan to run this, make sure to read the required arguments for the command-line so it executes properly.
Also, for file input file, a CSV of one hostname per line with no headers is the correct format. See below for example.
hosttest.csv
API Scopes
Lastly, the API client scopes needed to perform these are:
hosts:read
assets:read
workflow:read
workflow:write
Hopefully this provides enough info for anyone looking to do this for their own environment. I do not plan to support this fully, so sorry if you need help, I will occasionally check in though if people do post issues.
Beta Was this translation helpful? Give feedback.
All reactions