Add filevault_status
to disk_encryption table
#6823
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the PR do?
This PR adds a new darwin-only column to the
disk_encryption
table calledfilevault_status
which on Macs will return eitheron
,off
, orunknown
.Why do we need
filevault_status
?Some Mac Admins often believe the terms "Filevault On" and "Encryption Enabled" are equivalent. While historically this is true, the introduction of the T2 Secure Enclave has made these terms diverge in meaning in very important ways.
On T2 Macs, even when Filevault is off, the Secure Enclave by default will encrypt the contents of the drive at line speed. This means, at rest, the drive is encrypted. In these cases the
disk_encryption
table in osquery correctly indicates the volume is encrypted.However, this does not mean the data of the drive is inaccessible to someone with physical access to the Mac. In fact, in Kolide's testing, if a Mac that has FileVault off, any volume can be easily mounted using the macOS recovery OS in target disk mode, without the user's password EVEN IF THE DRIVE IS ENCRYPTED AT REST.
This is a really big deal because many people use Osquery to determine if their devices are encrypted using a methodology that makes them resistant to exfil attempts that involve physical access to the device (ex: theft, accidental loss, evil maid attacks). Right now Osquery cannot accurately report this status on all Macs with a T2 chip (which have been on the market since the introduction of the iMac Pro in Jan 2018).
When FileVault is correctly enabled, the drive contents will be inaccessible to bad-actors because they must know the user's Filevault password to unlock the drive, even for target disk mode. See this Apple Support article for more details.
Based on the above, I recommend immediately cutting a release after this PR is merged so that this crucial distinction is available to people who need it.
Other ways I could have written this PR
Not adding a new column
One thing I considered was instead of adding a new column, was to instead to change the definition of
encrypted
on Macs to mean any drive that didn't have Filevault enabled. While this was tempting, I think it's better for us to expose the nuance here instead of hiding it. That being said, I am still open to this option of the core team thinks its a better choice.Making
filevault_status
a platform-specific columnWhile this was my first instinct, I opted to instead copy the established pattern of this table to simply mark(Apple)
in the description along withuid
and theuser_uuid
columns.Edit: The platform-specific columns have been correctly documented as an extended DARWIN schema.
A Note On Testing
I have tested this table on the following Macs and am confident in its compatibility.
A Note On HFS+ and other volumes
For backwards compatibility I've included a assumption that on a Mac, if non-APFS drive is encrypted, filevault is also "on". This is mostly done for ease-of-querying purposes. My basic understanding is that before the T2 chip made this complicated, FileVault and encryption basically meant the same thing. That assumption is documented in a comment.