File tree Expand file tree Collapse file tree 2 files changed +58
-5
lines changed
device-trust/reporting-db Expand file tree Collapse file tree 2 files changed +58
-5
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,21 @@ op signin
77for vault in $( op vault list --format=json | jq --raw-output ' .[] .id' )
88do
99 echo " "
10- echo " ************** Vault Details************** "
10+ echo " Vault Details"
1111 op vault get $vault --format=json | jq -r ' .|{name, items, updated_at}'
12+ sleep 1
1213 echo " "
13- echo " ************** Users************** "
14+ echo " Users"
1415 op vault user list $vault
16+ sleep 1
1517 echo " "
16- echo " ************** Groups************** "
18+ echo " Groups"
1719 op vault group list $vault
20+ sleep 1
1821 echo " "
19- echo " *****************************************"
20- echo " *****************************************"
22+ echo " End of Vault Details"
23+ sleep 2
24+ clear
2125 echo " "
2226 echo " "
2327done
Original file line number Diff line number Diff line change 1+ -- "Mac Apps Report"
2+ -- Internal-1P only https://app.kolide.com/4918/reporting/queries/2080
3+
4+ -- Reporting DB query to retrieve all mac_apps installed across the fleet,
5+ -- filtering out a list of "approved apps" such as 1Password and anything
6+ -- built by either Apple or Google using their bundle_identifier.
7+
8+ -- The final report contains an ordered list of "unapproved" apps with a
9+ -- JSON formatted device table containing the device name, serial and admin URL.
10+
11+ WITH device_info AS (
12+ SELECT
13+ id as device_id,
14+ name,
15+ serial ,
16+ k2_url,
17+ id || ' (' || name || ' )' as device_name
18+ FROM
19+ devices
20+ ),
21+
22+ apps AS (
23+ SELECT
24+ *
25+ FROM
26+ mac_apps
27+ WHERE
28+ 1 = 1
29+ AND path LIKE ' /Applications%'
30+ AND name NOT LIKE ' 1Password%.app'
31+ AND bundle_identifier NOT LIKE ' com.apple.%'
32+ AND bundle_identifier NOT LIKE ' com.google.%'
33+ )
34+
35+ SELECT
36+ a .name ,
37+ a .bundle_identifier ,
38+ COUNT (* ) as count,
39+ JSON_AGG(
40+ JSON_BUILD_OBJECT(
41+ ' device_name' , d .device_name ,
42+ ' device_serial' , d .serial ,
43+ ' url' , d .k2_url
44+ ) ORDER BY d .device_name
45+ ) as device_table
46+ FROM apps as a
47+ JOIN device_info as d on d .device_id = a .device_id
48+ GROUP BY 1 , 2
49+ ORDER BY count DESC
You can’t perform that action at this time.
0 commit comments