Encrypt existing search indexes
Encrypting DSE Search indexes turns on encryption only for new files. Additional steps are required to encrypt existing data. When you encrypt existing DSE Search indexes, a node restart is required.
There are several ways to encrypt existing DSE Search indexes. Choose the method that is appropriate for your environment.
Encryption is enabled per core.
|
If the When using a TDE-secured local file system, encryption keys are stored remotely with KMIP encryption or locally with on-server encryption. |
-
To enable encryption for an existing core, change the
search indexconfig insolrconfig.xml:<directoryFactory name="DirectoryFactory" class="solr.EncryptedFSDirectoryFactory"/> -
Upload the changed
solrconfig.xmlfile.For example, you can use
dsetoolto upload the changed resource file:dsetool reload_core keyspace_name.table_name -
Enabling encryption does not require a node restart. However, the
directoryFactorychanges require a node restart.Encryption is enabled only for new files. Complete the remaining steps to encrypt existing data.
-
Encrypt existing files using one of the following methods.
-
While the node is running (long running)
-
While the local node is offline (fastest)
-
Eventual encryption (simplest)
This option immediately encrypts existing data, but it is a long running process.
Use
dsetoolto reload the core and reindex while the node is running:dsetool reload_core keyspace_name.table_name deleteAll=true reindex=trueThis option is the fastest, but the local node must be offline.
Requirements:
-
The remote node that contains the encryption configuration must be running.
-
The local node is offline.
-
The user that runs this command must have read and write permissions to the directory that contains the index files.
When your DSE cluster has a second remote node that is running, use
dsetoolto encrypt index files on the local offline node. The encryption configuration is read from the remote node.-
Enable encryption for all nodes that have a search index.
-
Run the
dsetoolcommand:dsetool upgrade_index_files <keyspace_name>.<table_name> -h <IP_address> [<options>]You can specify the following options for offline index encryption:
- keyspace_name.table_name
-
Required. The keyspace and table names of the search index. Keyspace and table names are case-sensitive. Enclose names that contain uppercase in double quotation marks.
- -h IP_address
-
Required. Node hostname or IP address of the remote node that contains the encryption configuration that is used for index encryption. The remote node must be running.
- -c port
-
The DSE port on the remote node that contains the encryption configuration.
- --backup
-
Preserves the index files from the current index as a backup after successful upgrade. The preserved index file backup is moved to the
--workspacedirectory. When not specified, index files from the current index are deleted. - --workspace directory
-
The workspace directory for the upgrade process. The upgraded index is created in this directory. When not specified, the default directory is the same directory that contains the search index files.
- --index directory
-
The data directory that contains the search index files. When not specified, the default directory is inferred from the search index name.
This option doesn’t require you to run any additional commands, but it relies on eventual encryption. This means it’s uncertain how long it will take before all existing data is encrypted.
Instead of running
dsetoolcommands, you can wait and allow encryption to happen naturally. As new data is added to your index, encryption occurs when indexes are compacted or merged. Because new files are encrypted, your files are eventually encrypted. -
-
To verify which files are encrypted, use the following command to list all DSE Search index files for the specified search core on the local node:
dsetool list_index_files KEYSPACE_NAME.TABLE_NAME [--index DIRECTORY]Replace
KEYSPACE_NAME.TABLE_NAMEwith the name of the search core to verify, and replaceDIRECTORYwith the data directory that contains the search index files. When not specified, the default directory is inferred from the search core name. -
After you verify which files are encrypted, you can encrypt existing files using a different option.
To disable encryption, disable encryption for the backing CQL table. No node restart is required.