Skip to content

Commit 7e486c6

Browse files
committed
feat: Detect macOS applications in ~/Library/Application Support
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.
1 parent fec92d8 commit 7e486c6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/inventory/software/collector_darwin_apps.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,19 @@ func (c *applicationsCollector) Collect() ([]*Entry, []*Warning, error) {
114114
for _, userHome := range localUsers {
115115
username := filepath.Base(userHome)
116116
userAppsPath := filepath.Join(userHome, "Applications")
117+
userLibAppSupportPath := filepath.Join(userHome, "Library", "Application Support")
117118

118119
// Check if the user's Applications directory exists and is accessible
119120
if info, err := os.Stat(userAppsPath); err == nil && info.IsDir() {
120121
appDirs = append(appDirs, userAppDir{path: userAppsPath, username: username})
121122
}
122123
// If directory doesn't exist or can't be accessed, silently skip
123124
// (most users won't have ~/Applications)
125+
126+
// Check if the user's Library/Application Support directory exists and is accessible
127+
if info, err := os.Stat(userLibAppSupportPath); err == nil && info.IsDir() {
128+
appDirs = append(appDirs, userAppDir{path: userLibAppSupportPath, username: username})
129+
}
124130
}
125131

126132
for _, appDir := range appDirs {

0 commit comments

Comments
 (0)