Returning List of Applications #1026
-
Hello! I'm looking to pull a list of application details via the API but I'm running into some issues. My initial thought was to use the I'm familiar with pagination in the Crowdstrike APIs but what I'm finding is that since applications are returned (seemingly) in a Should I be thinking about this in a different way? Happy to provide any specifics that might be more helpful in understanding what I'm doing. Specific error message the API is returning:
Which based on some code examples I've found in this repo seems to be expected, I'm correctly paginating out to 10K, but that seems to be the hard limit. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @mtobias-getty - I checked the Spyglass sample we have posted, and it approaches this problem in a similar fashion. (The example does support filtering, but the default behavior is to pull everything available which will hit the limit in large environments.) Digging into the Thinking through this, it may make more sense to move this logic to right before enrichment happens so we potentially reduce API calls for extended detail. The query result maximum is a hard limit in this specific API, so filtering may be our only option if we're going the API route at that scale.
|
Beta Was this translation helpful? Give feedback.
-
Nothing super elegant I'm afraid. As we prepare the terminal display output in the
Depending on the size of your environment, this may take some experimentation. There should be a combination of filters that can help us get this dataset size down. (Don't forget about FQL complex expressions.)
Happy to assist! 😃 |
Beta Was this translation helpful? Give feedback.
-
Alright! I have my solution.This was complicated to initially get my head around but I've done something similar for pulling Spotlight data. I think the Crowdstrike APIs excel when you have specific data you are looking for, they are a bit more restrictive when wanting to pull broad bits of information that you don't know in advance (per the earlier suggestions, if I knew specific applications I wanted to report on, creating a report in Crowdstrike and just pulling that data would be a much better solution, but I didn't want to assume any knowledge of what was in my environment). One of the BEST things about the Crowdstrike API is that the rate limit is very forgiving. I have ~6,000 calls to play with and throughout all of this, which results in about 500K total application IDs, since application IDs are per application per host, I never dipped below ~5,500 API calls available at any time since they replenish so quickly. I'm positive that there is optimization I can include in my process as well, I'm approaching this from a very conservative list size perspective and doing way more file write operations than I likely need to, this drastically slows down the run. In my testing I can get a full listing of every application installed on every host in about 30 minutes, which for a repository of data I'll probably pull once per day, is really not a bad thing. Thank you @jshcodes as always for your very quick and very helpful feedback! We can consider this question closed from my perspective. Sort of accurate breakdown of how I'm approaching this problem
And a terrible Mermaid doc (I think) illustrating my flowgraph TD
A[Loop list of CIDs] --> B[Auth to Falcon API]
B --> C[Loop Platform List Windows,Mac,Linux]
C --> D[Query Hosts API with recently seen filter and Platform, return Host IDs]
D --> E[Host IDs to get host AID via get_hosts Discovery API]
E --> F[AIDs to get List of Application IDs via query_applications Discovery API]
F --> G[Write App IDs to CSV]
G --> A
H[Read Application IDS from App ID file]
H --> I[Use App IDs to query get_applications Discovery API to get app metadata]
|
Beta Was this translation helpful? Give feedback.
Alright! I have my solution.
This was complicated to initially get my head around but I've done something similar for pulling Spotlight data. I think the Crowdstrike APIs excel when you have specific data you are looking for, they are a bit more restrictive when wanting to pull broad bits of information that you don't know in advance (per the earlier suggestions, if I knew specific applications I wanted to report on, creating a report in Crowdstrike and just pulling that data would be a much better solution, but I didn't want to assume any knowledge of what was in my environment).
One of the BEST things about the Crowdstrike API is that the rate limit is very forgiving. I have ~6,000 call…