-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-13148. [Docs] Update Transparent Data Encryption doc. #8530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2bd55a6
HDDS-13148. [Docs] Update Transparent Data Encryption doc.
jojochuang 3dcd627
Update
jojochuang 834ef09
Update per Gemini.
jojochuang b6bc2c6
Update per Siyao's comments.
jojochuang 60fe96a
Update hadoop-hdds/docs/content/security/SecuringTDE.md
jojochuang 3633e73
Update per Gemini
jojochuang dd1fca0
Update hadoop-hdds/docs/content/security/SecuringTDE.md
jojochuang f17d50e
Revert unrelated change.
jojochuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,64 +25,80 @@ icon: lock | |
| limitations under the License. | ||
| --> | ||
|
|
||
| Ozone TDE setup process and usage are very similar to HDFS TDE. | ||
| The major difference is that Ozone TDE is enabled at Ozone bucket level | ||
| when a bucket is created. | ||
| Ozone Transparent Data Encryption (TDE) enables you to encrypt data at rest. TDE is enabled at the bucket level when a bucket is created. To use TDE, an administrator must first configure a Key Management Server (KMS). Ozone can work with **Hadoop KMS** and **Ranger KMS**. The KMS URI needs to be provided to Ozone via the `core-site.xml` configuration file. | ||
|
|
||
| ### Setting up the Key Management Server | ||
| Once the KMS is configured, users can create an encryption key and then create an encrypted bucket using that key. All data written to an encrypted bucket will be transparently encrypted on the server-side, and data read from the bucket will be transparently decrypted. | ||
|
|
||
| To use TDE, admin must setup a Key Management Server and provide that URI to | ||
| Ozone/HDFS. Since Ozone and HDFS can use the same Key Management Server, this | ||
| configuration can be provided via *core-site.xml*. | ||
| ### Configuring TDE | ||
|
|
||
| Property| Value | ||
| -----------------------------------|----------------------------------------- | ||
| hadoop.security.key.provider.path | KMS uri. <br> e.g. kms://http@kms-host:9600/kms | ||
| 1. **Set up a Key Management Server (KMS):** | ||
| * **Hadoop KMS:** Follow the instructions in the [Hadoop KMS documentation](https://hadoop.apache.org/docs/r3.4.1/hadoop-kms/index.html). | ||
| * **Ranger KMS:** Ranger KMS can also be used. For Ranger KMS, encryption keys can be managed via the Ranger KMS management console or its [REST API](https://ranger.apache.org/kms/apidocs/index.html), in addition to the `hadoop key` command line interface. | ||
|
|
||
| ### Using Transparent Data Encryption | ||
| If this is already configured for your cluster, then you can simply proceed | ||
| to create the encryption key and enable encrypted buckets. | ||
| 2. **Configure Ozone:** | ||
| Add the following property to Ozone’s `core-site.xml`: | ||
|
|
||
| To create an encrypted bucket, client need to: | ||
| <property> | ||
| <name>hadoop.security.key.provider.path</name> | ||
| <value><kms_provider_path></value> | ||
jojochuang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </property> | ||
|
|
||
| * Create a bucket encryption key with hadoop key CLI, which is similar to | ||
| how you would use HDFS encryption zones. | ||
| Replace `<kms_provider_path>` with the actual URI of your KMS. For example, `kms://[email protected]:9600/kms` | ||
smengcl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| hadoop key create enckey | ||
| ``` | ||
| The above command creates an encryption key for the bucket you want to protect. | ||
| Once the key is created, you can tell Ozone to use that key when you are | ||
| reading and writing data into a bucket. | ||
| ### Creating an Encryption Key | ||
|
|
||
| * Assign the encryption key to a bucket. | ||
| Use the `hadoop key create` command to create an encryption key in the configured KMS: | ||
|
|
||
| ```bash | ||
| ozone sh bucket create -k enckey /vol/encryptedbucket | ||
| ``` | ||
| ```shell | ||
| hadoop key create <key_name> [-size <key_bit_length>] [-cipher <cipher_suite>] [-description <description>] | ||
| ``` | ||
|
|
||
| * `<key_name>`: The name of the encryption key. | ||
| * **`-size <key_bit_length>` (Optional):** Specifies the key bit length. Ozone supports **128** (default) and **256** bits. | ||
| * **`-cipher <cipher_suite>` (Optional):** Specifies the cipher suite. Currently, only **`AES/CTR/NoPadding`** (the default) is supported. | ||
jojochuang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * `-description <description>` (Optional): A description for the key. | ||
|
|
||
| For example: | ||
|
|
||
| ```shell | ||
| hadoop key create enckey -size 256 -cipher AES/CTR/NoPadding -description "Encryption key for my_bucket" | ||
| ``` | ||
|
|
||
| ### Creating an Encrypted Bucket | ||
|
|
||
| Use the Ozone shell `ozone sh bucket create` command with the `-k` (or `--key`) option to specify the encryption key: | ||
|
|
||
| ```shell | ||
| ozone sh bucket create --key <key_name> /<volume_name>/<bucket_name> | ||
| ``` | ||
|
|
||
| For example: | ||
|
|
||
| ```shell | ||
| ozone sh bucket create --key enckey /vol1/encrypted_bucket | ||
| ``` | ||
|
|
||
| After this command, all data written to the _encryptedbucket_ will be encrypted | ||
| via the enckey and while reading the clients will talk to Key Management | ||
| Server and read the key and decrypt it. In other words, the data stored | ||
| inside Ozone is always encrypted. The fact that data is encrypted at rest | ||
| will be completely transparent to the clients and end users. | ||
| Now, all data written to `/vol1/encrypted_bucket` will be encrypted. | ||
jojochuang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Using Transparent Data Encryption from S3G | ||
|
|
||
| There are two ways to create an encrypted bucket that can be accessed via S3 Gateway. | ||
| Ozone’s S3 Gateway (S3G) allows you to access encrypted buckets. However, it's important to note that **Ozone does not support S3-SSE (Server-Side Encryption) or S3-CSE (Client-Side Encryption) in the way AWS S3 does.** That said, Ozone S3 buckets can be encrypted using Ranger KMS or Hadoop KMS to provide a guarantee similar to S3-SSE with client-supplied keys (SSE-C). | ||
|
|
||
| #### Option 1. Create a bucket using shell under "/s3v" volume | ||
| When creating an encrypted bucket that will be accessed via S3G: | ||
|
|
||
| ```bash | ||
| ozone sh bucket create -k enckey --layout=OBJECT_STORE /s3v/encryptedbucket | ||
| ``` | ||
| 1. **Create the bucket under the `/s3v` volume:** | ||
| The `/s3v` volume is the default volume for S3 buckets. | ||
|
|
||
| #### Option 2. Create a link to an encrypted bucket under "/s3v" volume | ||
| ```shell | ||
| ozone sh bucket create --key <key_name> /s3v/<bucket_name> | ||
| ``` | ||
|
|
||
| ```bash | ||
| ozone sh bucket create -k enckey --layout=OBJECT_STORE /vol/encryptedbucket | ||
| ozone sh bucket link /vol/encryptedbucket /s3v/linkencryptedbucket | ||
| ``` | ||
| 2. **Alternatively, create an encrypted bucket elsewhere and link it:** | ||
|
|
||
| ```shell | ||
| ozone sh bucket create --key <key_name> /<volume_name>/<bucket_name> | ||
| ozone sh bucket link /<volume_name>/<bucket_name> /s3v/<link_name> | ||
| ``` | ||
|
|
||
| Note 1: An encrypted bucket cannot be created via S3 APIs. It must be done using Ozone shell commands as shown above. | ||
| After creating an encrypted bucket, all the keys added to this bucket using s3g will be encrypted. | ||
|
|
@@ -94,12 +110,12 @@ argument, but explicitly added here to make a point). | |
| Bucket created with the `OBJECT_STORE` type will NOT be accessible via | ||
| HCFS (ofs or o3fs) at all. And such access will be rejected. For instance: | ||
|
|
||
| ```bash | ||
| ```bash | ||
| $ ozone fs -ls ofs://ozone1/s3v/encryptedbucket/ | ||
| -ls: Bucket: encryptedbucket has layout: OBJECT_STORE, which does not support file system semantics. Bucket Layout must be FILE_SYSTEM_OPTIMIZED or LEGACY. | ||
| ``` | ||
|
|
||
| ```bash | ||
| ```bash | ||
| $ ozone fs -ls o3fs://encryptedbucket.s3v.ozone1/ | ||
| 22/02/07 00:00:00 WARN fs.FileSystem: Failed to initialize fileystem o3fs://encryptedbucket.s3v.ozone1/: java.lang.IllegalArgumentException: Bucket: encryptedbucket has layout: OBJECT_STORE, which does not support file system semantics. Bucket Layout must be FILE_SYSTEM_OPTIMIZED or LEGACY. | ||
| -ls: Bucket: encryptedbucket has layout: OBJECT_STORE, which does not support file system semantics. Bucket Layout must be FILE_SYSTEM_OPTIMIZED or LEGACY. | ||
|
|
@@ -112,25 +128,25 @@ However, in buckets with `FILE_SYSTEM_OPTIMIZED` layout, some irregular S3 key | |
| names may be rejected or normalized, which can be undesired. | ||
| See [Prefix based File System Optimization]({{< relref "../feature/PrefixFSO.md" >}}) for more information. | ||
|
|
||
| In non-secure mode, the user running the S3Gateway daemon process is the proxy user, | ||
| while in secure mode the S3Gateway Kerberos principal (ozone.s3g.kerberos.principal) is the proxy user. | ||
| S3Gateway proxy's all the users accessing the encrypted buckets to decrypt the key. | ||
| For this purpose on security enabled cluster, during S3Gateway server startup | ||
| logins using configured | ||
| **ozone.s3g.kerberos.keytab.file** and **ozone.s3g.kerberos.principal**. | ||
| When accessing an S3G-enabled encrypted bucket: | ||
|
|
||
| * **Secure Mode (Kerberos enabled):** | ||
| The S3 Gateway proxy user (configured by `ozone.s3g.proxy.user`) must have permissions to decrypt the encryption key. This user also needs proxy user privileges for the end-user (e.g., be configured as a proxy user in `core-site.xml` for Hadoop’s proxy user mechanism). | ||
| * **Non-Secure Mode:** | ||
| The user running the S3 Gateway (typically the user who started the S3G daemon) must have permissions to decrypt the encryption key. | ||
|
|
||
| The below two configurations must be added to the kms-site.xml to allow the S3Gateway principal to act as a proxy for other users. In this example, "ozone.s3g.kerberos.principal" is assumed to be "s3g" | ||
| The below two configurations must be added to the kms-site.xml to allow the S3Gateway principal to act as a proxy for other users. In this example, "ozone. | ||
| s3g.kerberos.principal" is assumed to be "s3g" | ||
jojochuang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```xml | ||
| <property> | ||
| <name>hadoop.kms.proxyuser.s3g.users</name> | ||
| <value>user1,user2,user3</value> | ||
| <description> | ||
| Here the value can be all the S3G accesskey ids accessing Ozone S3 | ||
| Here the value can be all the S3G accesskey ids accessing Ozone S3 | ||
| or set to '*' to allow all the accesskey ids. | ||
| </description> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>hadoop.kms.proxyuser.s3g.hosts</name> | ||
| <value>s3g-host1.com</value> | ||
|
|
@@ -143,6 +159,23 @@ The below two configurations must be added to the kms-site.xml to allow the S3Ga | |
|
|
||
| ### KMS Authorization | ||
|
|
||
| If Ranger authorization is enabled for KMS, then decrypt key permission should be given to | ||
| access key id user(currently access key is kerberos principal) to decrypt the encrypted key | ||
| to read/write a key in the encrypted bucket. | ||
| Key Management Servers (KMS) may enforce key access authorization. **Hadoop KMS supports ACLs (Access Control Lists) for fine-grained permission control, while Ranger KMS supports Ranger policies for encryption keys.** Ensure that the appropriate users have the necessary permissions based on the KMS type in use. | ||
|
|
||
| For example, when using Ranger KMS for authorization, to allow the user `om` (the Ozone Manager user) to access the key `enckey` and the user `hdfs` (a typical HDFS service user) to manage keys, you might have policies in Ranger KMS like: | ||
|
|
||
| * **Policy for `om` user (or the user running the Ozone Manager):** | ||
| * Resource: `keyname=enckey` | ||
| * Permissions: `DECRYPT_EEK` (Decrypt Encrypted Encryption Key) | ||
| * **Policy for S3 Gateway proxy user (e.g., `s3g_proxy`):** | ||
| * Resource: `keyname=enckey` (or specific keys for S3 buckets) | ||
| * Permissions: `DECRYPT_EEK` | ||
| * **Policy for administrative users (e.g., `hdfs` or a keyadmin group):** | ||
| * Resource: `keyname=*` (or specific keys) | ||
| * Permissions: `CREATE_KEY`, `DELETE_KEY`, `GET_KEYS`, `ROLL_NEW_VERSION` | ||
|
|
||
| Refer to the Ranger documentation for detailed instructions on configuring KMS policies if you are using Ranger KMS. For Hadoop KMS, consult its [Hadoop KMS documentation](https://hadoop.apache.org/docs/r3.4.1/hadoop-kms/index.html#ACLs_.28Access_Control_Lists.29) for managing ACLs. | ||
|
|
||
| ### Additional References | ||
|
|
||
| * For more background on Transparent Data Encryption concepts, you can refer to the [Transparent Encryption in HDFS documentation](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html). | ||
| * For detailed information on Hadoop KMS, see the [Hadoop KMS documentation](https://hadoop.apache.org/docs/r3.4.1/hadoop-kms/index.html). | ||
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.
Uh oh!
There was an error while loading. Please reload this page.