Allow TrueSearch / Spotlight indexing of unlocked encrypted datasets (opt-in)

Problem/Justification

TrueSearch currently excludes encrypted ZFS datasets from indexing. This means that users who want to use TrueSearch and macOS Spotlight over SMB effectively have to choose between:

  • ZFS encryption for their data, or

  • server-side TrueSearch / Spotlight functionality.

Leaving the pool root dataset unencrypted does not solve this problem if the datasets containing the actual user data remain encrypted, because those encrypted datasets are still excluded from TrueSearch.

I understand why excluding encrypted datasets is the safe default. A search index may contain sensitive information such as filenames, metadata and extracted file contents. If that index remained accessible after the source dataset was locked, it could weaken the protection provided by dataset encryption.

However, I would like to see an explicit administrator opt-in that allows TrueSearch to index an encrypted dataset while that dataset is unlocked and mounted.

Encrypted datasets should remain excluded by default. The requested improvement would be an optional mode with appropriate safeguards, for example:

  • indexing encrypted datasets must be enabled explicitly by an administrator;

  • preferably, this can be enabled or disabled per dataset;

  • the resulting search index is protected appropriately at rest;

  • the corresponding index data is unavailable when the source dataset is locked;

  • TrueSearch / Spotlight results continue to respect SMB permissions and ACLs;

  • the UI clearly warns administrators that filenames, metadata and file contents may be added to the index.

I do not want to prescribe the exact technical implementation. The main request is to make TrueSearch usable with encrypted datasets without requiring users to give up data-at-rest protection.

For me personally, disabling ZFS encryption just to gain Spotlight support is not an acceptable trade-off. If encrypted datasets remain unsupported, I will probably continue using a separate search solution such as FoxTrot Professional Search.

That works, but native TrueSearch integration would be much preferable because it would provide centralized server-side indexing directly on TrueNAS and integrate naturally with Finder and macOS Spotlight.

Impact

This would benefit users who require both:

  • encryption at rest, and

  • fast server-side search from macOS clients.

A typical use case is a NAS where ZFS encryption protects data if a failed HDD has to be returned, a disk is physically removed, or the storage system is stolen.

During normal operation, the encrypted datasets are unlocked and authorized services such as SMB can already access their contents. Allowing TrueSearch to index those datasets while unlocked would add search functionality without requiring users to abandon encryption at rest.

This is relevant not only to home users, but also to professional and business environments with:

  • encrypted storage;

  • macOS clients;

  • SMB shares;

  • centralized file and content search requirements.

A server-side TrueSearch index is particularly useful in such environments because it avoids maintaining separate client-side indexes on each Mac.

The main disadvantage is that a search index can itself contain sensitive information. That is why I believe the feature should remain disabled by default and require explicit administrator approval, with the index protected appropriately.

Overall, this would make TrueSearch available to security-conscious users who currently cannot use it at all.

Looking further ahead, I would also be interested in broader client support for TrueSearch beyond macOS. For example, integration with KDE/Dolphin or dedicated Linux search applications could make the server-side index useful to an even wider range of TrueNAS users.

User Story

As a TrueNAS user, I have an encrypted dataset that is shared with macOS clients through SMB.

I use ZFS encryption to protect the data at rest and do not want to disable that protection merely to gain Spotlight functionality.

I would like to:

  1. open the dataset or SMB share settings;

  2. explicitly enable TrueSearch indexing for that encrypted dataset;

  3. acknowledge a warning explaining that filenames, metadata and possibly file contents will be added to the search index;

  4. have TrueSearch index the dataset while it is unlocked;

  5. search the SMB share through Finder / Spotlight on my Macs;

  6. retain normal SMB permission and ACL enforcement;

  7. have the corresponding search index protected or made unavailable when the encrypted dataset is locked.

This would preserve the secure default while allowing administrators to decide whether the convenience of TrueSearch is appropriate for their own threat model.

Please, TrueNAS team, make this a reality. Was excited to try out the indexing feature, only to see that I couldn’t on my encrypted dataset, and I do not have enough hard drives to recreate the dataset as unencrypted.

Don’t forget to vote for feature requests you support, that includes the thread starter.

and please don’t couple the functionality (be it via SMB or web-based browsing) to cloud services such as truenas-connect, compare this thread for more info: Why does WebShare require TrueNAS Connect? - #8 by johannesjh