Add security policies and reports to Workstations#43457
Conversation
Add multiple endpoint security policies and telemetry reports and wire them into the workstations fleet manifest. New macOS policies: firewall, Gatekeeper, SIP (critical), Remote Login disabled, screen-lock inactivity, and local-admin count; new Windows policies: Secure Boot, Remote Desktop disabled, interactive screen-lock timeout; new Linux policy: sshd PermitRootLogin restriction. Added cross-platform reports for disk encryption (includes BitLocker), local user/admin inventory, USB devices, listening ports, and Chromium-family browser extensions. These changes improve compliance and detection coverage (SOC2/ISO mappings included) and enable more comprehensive fleet monitoring.
Add two new Fleet reports to collect browser extension/add-on inventories and register them in the workstations fleet config. New files: collect-safari-browser-extensions.yml (macOS-only, notes Full Disk Access requirement) and collect-firefox-browser-extensions.yml (darwin, linux, windows). Both run daily (interval: 86400), use snapshot logging, allow observer runs, and support related compliance mappings (NET-94, VPM-75, SOC2 CC 7.1).
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis change registers new compliance policies and reporting jobs in the workstation fleet config. Policies added: macOS (application firewall, Gatekeeper, SIP, remote login disabled, screen-lock inactivity, local-admin count), Windows (Secure Boot, Remote Desktop disabled, screen-lock timeout), and Linux (sshd PermitRootLogin restriction). Reports added: Chromium-family, Firefox, and Safari browser extensions; local user accounts and admin membership; connected USB devices; and listening TCP/UDP ports. workstations.yml was updated to reference the new policy and report YAML files. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 6/8 reviews remaining, refill in 9 minutes and 3 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
it-and-security/lib/all/reports/collect-usb-devices.yml (1)
17-17: Harden the device filter for null/whitespace values.Line 17 can be made more robust by normalizing nulls and trimming whitespace before comparison, which reduces noisy rows.
Suggested patch
- WHERE vendor != '' OR model != ''; + WHERE + COALESCE(TRIM(vendor), '') != '' + OR COALESCE(TRIM(model), '') != '';🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@it-and-security/lib/all/reports/collect-usb-devices.yml` at line 17, The WHERE clause in collect-usb-devices.yml is too permissive for nulls/whitespace; update the filter to normalize nulls and trim whitespace before comparing so rows with only whitespace are excluded — replace the current WHERE clause with one that uses COALESCE and TRIM (e.g., check COALESCE(TRIM(vendor), '') <> '' OR COALESCE(TRIM(model), '') <> '') to ensure both null and whitespace-only vendor/model values are treated as empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@it-and-security/lib/all/reports/collect-listening-ports.yml`:
- Line 15: The report currently snapshots raw process command lines via
p.cmdline which can expose secrets; remove p.cmdline from the collected fields
in the collect-listening-ports.yml rule (or move it behind an explicit
opt-in/exception flag) so command-line data is not captured by default; update
any comments/README in the rule to note how to request/enable cmdline capture
and, if you must keep it, implement a redaction or allowlist gating around
p.cmdline access in the same rule (refer to the p.cmdline field used in the
rule).
In `@it-and-security/lib/all/reports/collect-local-user-accounts.yml`:
- Around line 3-17: The description claims "interactive" accounts but the SQL
(the query selecting from users u and computing is_admin) returns all users; fix
by either narrowing the query (add an interactivity filter on users u — e.g.,
require interactive login shells or non-system uid range, or check a field like
u.shell) or by changing the human-readable text to remove "interactive" so it
accurately reflects the result; update the description text at the top or add a
WHERE clause to the SELECT that filters u for interactive accounts while keeping
the is_admin logic intact.
In `@it-and-security/lib/linux/policies/sshd-permitrootlogin-restricted.yml`:
- Around line 3-8: The current query only checks augeas entries with path =
'/etc/ssh/sshd_config' for label 'PermitRootLogin', so it misses drop-in files;
update the SELECT to search the augeas table for all relevant SSH config paths
(e.g., include '/etc/ssh/sshd_config.d/' files or any path that starts with
'/etc/ssh/sshd_config') when looking for label = 'PermitRootLogin' and value IN
('yes','true','1') so that settings in drop-in files are detected; locate the
check that references path = '/etc/ssh/sshd_config' and change it to cover all
parsed SSH config paths (using path LIKE or an IN-list for
'/etc/ssh/sshd_config' and '/etc/ssh/sshd_config.d/%').
---
Nitpick comments:
In `@it-and-security/lib/all/reports/collect-usb-devices.yml`:
- Line 17: The WHERE clause in collect-usb-devices.yml is too permissive for
nulls/whitespace; update the filter to normalize nulls and trim whitespace
before comparing so rows with only whitespace are excluded — replace the current
WHERE clause with one that uses COALESCE and TRIM (e.g., check
COALESCE(TRIM(vendor), '') <> '' OR COALESCE(TRIM(model), '') <> '') to ensure
both null and whitespace-only vendor/model values are treated as empty.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bf928a76-ddcd-42fc-b555-4b850cf3d67a
📒 Files selected for processing (18)
it-and-security/fleets/workstations.ymlit-and-security/lib/all/reports/collect-chromium-browser-extensions.ymlit-and-security/lib/all/reports/collect-disk-encryption-status.ymlit-and-security/lib/all/reports/collect-firefox-browser-extensions.ymlit-and-security/lib/all/reports/collect-listening-ports.ymlit-and-security/lib/all/reports/collect-local-user-accounts.ymlit-and-security/lib/all/reports/collect-safari-browser-extensions.ymlit-and-security/lib/all/reports/collect-usb-devices.ymlit-and-security/lib/linux/policies/sshd-permitrootlogin-restricted.ymlit-and-security/lib/macos/policies/firewall-enabled.ymlit-and-security/lib/macos/policies/gatekeeper-enabled.ymlit-and-security/lib/macos/policies/local-admin-count-reasonable.ymlit-and-security/lib/macos/policies/remote-login-disabled.ymlit-and-security/lib/macos/policies/screen-lock-inactivity.ymlit-and-security/lib/macos/policies/sip-enabled.ymlit-and-security/lib/windows/policies/remote-desktop-disabled.ymlit-and-security/lib/windows/policies/screen-lock-timeout-configured.ymlit-and-security/lib/windows/policies/secure-boot-enabled.yml
| p.pid, | ||
| p.name AS process_name, | ||
| p.path AS process_path, | ||
| p.cmdline |
There was a problem hiding this comment.
Avoid snapshotting raw command lines by default.
Line 15 + Line 23 can store sensitive arguments (tokens, secrets, internal URLs) in snapshot logs across all workstations. Prefer excluding p.cmdline (or gating it behind a stricter exception flow).
Also applies to: 23-23
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@it-and-security/lib/all/reports/collect-listening-ports.yml` at line 15, The
report currently snapshots raw process command lines via p.cmdline which can
expose secrets; remove p.cmdline from the collected fields in the
collect-listening-ports.yml rule (or move it behind an explicit opt-in/exception
flag) so command-line data is not captured by default; update any
comments/README in the rule to note how to request/enable cmdline capture and,
if you must keep it, implement a redaction or allowlist gating around p.cmdline
access in the same rule (refer to the p.cmdline field used in the rule).
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Updated resolution instructions for firewall enforcement.
Simplify and harmonize wording across multiple IT/security policy YAMLs: remove detailed compliance mappings, shorten descriptions, and standardize resolutions to note MDM enforcement and to restart/refetch when applicable. Add a consistent #help-it contact instruction in resolutions (and minor wording/format fixes). Affected files include macOS, Windows and Linux policy files (sshd-permitrootlogin-restricted, firewall-enabled, gatekeeper-enabled, local-admin-count-reasonable, remote-login-disabled, screen-lock-inactivity, sip-enabled, remote-desktop-disabled, screen-lock-timeout-configured, secure-boot-enabled).
Add multiple endpoint security policies and telemetry reports and wire them into the workstations fleet manifest. New macOS policies: firewall, Gatekeeper, SIP (critical), Remote Login disabled, screen-lock inactivity, and local-admin count; new Windows policies: Secure Boot, Remote Desktop disabled, interactive screen-lock timeout; new Linux policy: sshd PermitRootLogin restriction. Added cross-platform reports for disk encryption (includes BitLocker), local user/admin inventory, USB devices, listening ports, and Chromium-family browser extensions. These changes improve compliance and detection coverage (SOC2/ISO mappings included) and enable more comprehensive fleet monitoring.
Summary by CodeRabbit