Skip to content

feat: Detect macOS applications in ~/Library/Application Support - #54939

Open
pascalrobert wants to merge 1 commit into
DataDog:mainfrom
CollabInfra:feature/darwin-inventory
Open

feat: Detect macOS applications in ~/Library/Application Support#54939
pascalrobert wants to merge 1 commit into
DataDog:mainfrom
CollabInfra:feature/darwin-inventory

Conversation

@pascalrobert

Copy link
Copy Markdown

Some applications are stored in sub-directories of ~/Library/Application Support, for example:

Those applications are detected by osquery, and the Software Inventory in the DD agent should also detect them.

What does this PR do?

It detects macOS applications in subdirectories of ~/Library/Application Support.

Some examples:

 /Users/myuser/Library/Application Support/JetBrains/Daemon/bundles/current/jetbrainsd.app/Contents/Helpers/JetBrains.app
 /Users/myuser/Library/Application Support/Steam/steamapps/common/AoE2DE/Age Of Empires II.app

Motivation

To get a better inventory (and who wants Steam games on work computers, right?). osquery also detects those applications.

Describe how you validated your changes

Sadly, a build with Omnibus didn't work, I get an unrelated issue:

bundler: failed to load command: omnibus (/opt/homebrew/lib/ruby/gems/4.0.0/bin/omnibus)
/opt/homebrew/lib/ruby/gems/4.0.0/gems/thor-0.20.3/lib/thor/error.rb:109:in '<class:Thor>': uninitialized constant DidYouMean::SPELL_CHECKERS (NameError)

    DidYouMean::SPELL_CHECKERS.merge!(
              ^^^^^^^^^^^^^^^^
Did you mean?  DidYouMean::SpellChecker

@pascalrobert
pascalrobert requested a review from a team as a code owner August 15, 2026 20:07
@pascalrobert
pascalrobert requested a review from jack0x2 August 15, 2026 20:07
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@pascalrobert

pascalrobert commented Aug 15, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@pascalrobert

Copy link
Copy Markdown
Author

recheck

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e486c647d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


// Check if the user's Library/Application Support directory exists and is accessible
if info, err := os.Stat(userLibAppSupportPath); err == nil && info.IsDir() {
appDirs = append(appDirs, userAppDir{path: userLibAppSupportPath, username: username})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound the recursive Application Support scan

When a user’s Application Support contains a large tree such as a Steam library or browser cache, adding its root here makes the existing WalkDir enumerate every entry on each collection, without pruning irrelevant directories or honoring request cancellation. Since check_system_probe_timeout defaults to one minute, sufficiently large profiles can time out the request and discard the entire software inventory while the system-probe continues scanning; restrict the search to bounded candidate subtrees or use indexed discovery.

Useful? React with 👍 / 👎.

@pascalrobert pascalrobert Aug 15, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this, but it would be really hard to target specific directories, or remove specific directories. I will let the Datadog team decide.

Comment thread pkg/inventory/software/collector_darwin_apps.go
Some applications are stored in sub-directories of ~/Library/Application Support, for example:

 /Users/myuser/Library/Application Support/JetBrains/Daemon/bundles/current/jetbrainsd.app/Contents/Helpers/JetBrains.app
 /Users/myuser/Library/Application Support/Steam/steamapps/common/AoE2DE/Age Of Empires II.app

Those applications are detected by osquery, and the Software Inventory in the DD agent should also detect them.
@pascalrobert
pascalrobert force-pushed the feature/darwin-inventory branch from 7e486c6 to c99e4b8 Compare August 15, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant