Skip to content

Update system integrity checks for team reports and BitLocker#487

Merged
dz0ny merged 2 commits intomainfrom
fix/race-win-ole
Feb 4, 2026
Merged

Update system integrity checks for team reports and BitLocker#487
dz0ny merged 2 commits intomainfrom
fix/race-win-ole

Conversation

@dz0ny
Copy link
Member

@dz0ny dz0ny commented Feb 4, 2026

  • add TeamReportSentCheck with config tracking and hook it into each platform’s System Integrity claim
  • reimplement the Windows disk encryption check via native BitLocker APIs(OLE no admin needed), and simplify the related tests

Copilot AI review requested due to automatic review settings February 4, 2026 08:32
@dz0ny dz0ny requested a review from zupo February 4, 2026 08:33
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

🚀 Dev Builds Available

Development builds for this PR are available in the workflow artifacts.

Available builds:

  • Windows (agent, installer, tray)
  • Linux (agent)
  • macOS (agent)

Download the build artifact to test the latest changes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds team report tracking to system integrity checks and reimplements Windows BitLocker detection using native APIs instead of PowerShell commands.

Changes:

  • Adds LastTeamReportSuccess timestamp tracking in config and updates it after each successful team report
  • Implements TeamReportSentCheck that validates reports were sent within the last 25 hours (allowing for one missed hourly check)
  • Replaces PowerShell-based BitLocker status queries with native Windows COM APIs for better performance and no longer requires elevated permissions

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
shared/config.go Adds LastTeamReportSuccess field to track last successful report timestamp
team/report.go Updates timestamp after successful report and saves config
team/report_test.go Adds test setup for temp config path and verifies timestamp is set after reports
checks/shared/team_report_sent.go New check that validates team reports are being sent regularly with relative time formatting
claims/checks_windows.go Integrates TeamReportSentCheck into Windows System Integrity claim
claims/checks_linux.go Integrates TeamReportSentCheck into Linux System Integrity claim
claims/checks_darwin.go Integrates TeamReportSentCheck into macOS System Integrity claim
checks/windows/disk_encryption.go Refactored to use native BitLocker APIs instead of PowerShell, no longer requires root
checks/windows/disk_encryption_test.go Updated tests to use function mocking instead of command mocking
checks/windows/bitlocker_property_windows.go New Windows-specific native BitLocker API implementation using COM
checks/windows/bitlocker_property_nonwindows.go Cross-platform stubs for non-Windows systems

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Merging this branch changes the coverage (2 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/ParetoSecurity/agent/checks/shared 59.63% (+3.43%) 👍
github.com/ParetoSecurity/agent/checks/windows 77.78% (-1.60%) 👎
github.com/ParetoSecurity/agent/claims 0.00% (ø)
github.com/ParetoSecurity/agent/shared 59.80% (ø)
github.com/ParetoSecurity/agent/team 93.75% (-0.87%) 👎
Total 51.25%

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ParetoSecurity/agent/checks/shared/team_report_sent.go 77.27% (+77.27%) 44 (+44) 34 (+34) 10 (+10) 🌟
github.com/ParetoSecurity/agent/checks/windows/bitlocker_property_nonwindows.go 0.00% (ø) 3 (+3) 0 3 (+3)
github.com/ParetoSecurity/agent/checks/windows/bitlocker_property_windows.go 0.00% (ø) 0 0 0
github.com/ParetoSecurity/agent/checks/windows/disk_encryption.go 79.37% (-10.83%) 63 (+12) 50 (+4) 13 (+8) 💀
github.com/ParetoSecurity/agent/claims/checks_darwin.go 0.00% (ø) 0 0 0
github.com/ParetoSecurity/agent/claims/checks_linux.go 0.00% (ø) 0 0 0
github.com/ParetoSecurity/agent/claims/checks_windows.go 0.00% (ø) 0 0 0
github.com/ParetoSecurity/agent/shared/config.go 61.67% (ø) 60 37 23
github.com/ParetoSecurity/agent/shared/device_all.go 27.59% (ø) 58 16 42
github.com/ParetoSecurity/agent/team/report.go 96.15% (-1.81%) 52 (+3) 50 (+2) 2 (+1) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ParetoSecurity/agent/checks/shared/team_report_sent_test.go
  • github.com/ParetoSecurity/agent/checks/windows/disk_encryption_test.go
  • github.com/ParetoSecurity/agent/team/report_test.go

@dz0ny dz0ny merged commit 045a845 into main Feb 4, 2026
38 checks passed
@dz0ny dz0ny deleted the fix/race-win-ole branch February 4, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants