Skip to content

Commit ae7deb6

Browse files
committed
nit fixes
1 parent 9f0acb2 commit ae7deb6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/utilities/data_masking.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Utility
55

66
<!-- markdownlint-disable MD051 -->
77

8-
The data masking utility provides a simple solution to obfuscate (mask or encrypt) incoming data so that sensitive information is not passed downstream or logged.
8+
The data masking utility provides a simple solution to mask or encrypt incoming data so that sensitive information is not passed downstream or logged.
99

1010
```mermaid
1111
stateDiagram-v2
@@ -39,7 +39,7 @@ stateDiagram-v2
3939

4040
## Terminology
4141

42-
**Masking** irreversibly replaces sensitive information with a non-sensitive placeholder or mask. For example, display the last four digits of a credit card number as `"**** **** **** 1234"`.
42+
**Masking** replaces sensitive information **irreversibly** with a non-sensitive placeholder. For example, display the last four digits of a credit card number as `"**** **** **** 1234"`.
4343

4444
**Encrypting** transforms plaintext into ciphertext using an encryption algorithm and a cryptographic key. Encryption can be reversed with the correct decryption key. This allows you to encrypt any PII (personally identifiable information) and make sure only the users with appropirate permissions can decrypt it to view the plaintext.
4545

@@ -53,18 +53,18 @@ If not using any encryption services and only masking data, your Lambda function
5353

5454
#### Using AWS Encryption SDK
5555

56-
To use the AWS Encryption SDK, your Lambda function IAM Role must have `kms:Decrypt` and `kms:GenerateDataKey` IAM permissions.
56+
To use the AWS Encryption SDK, your Lambda function IAM Role must have the `kms:Decrypt` and `kms:GenerateDataKey` IAM permissions.
5757

5858
You must also have an AWS KMS key with full read/write permissions. You can create one and learn more on the [AWS KMS console](https://us-east-1.console.aws.amazon.com/kms/home?region=us-east-1#/kms/home){target="_blank" rel="nofollow"}.
5959

6060
#### Using a custom encryption provider
6161

62-
For any other encryption provider, make sure to have the permissions for your role that it requires.
62+
If using your own encryption provider, make sure to have the necessary resources and permissions for your Lambda function's role.
6363

6464
### Working with nested data
6565

6666
#### JSON
67-
When using the data masking utility with dictionaries or JSON strings, you can provide a list of keys to obfuscate the corresponding values. If no fields are provided, the entire data object will be masked or encrypted. You can obfuscate values of nested keys by using dot notation.
67+
When using the data masking utility with dictionaries or JSON strings, you can provide a list of keys to obfuscate the corresponding values. If no fields are provided, the entire data object will be masked or encrypted. You can select values of nested keys by using dot notation.
6868

6969
???+ note
7070
If you're using our example [AWS Serverless Application Model (SAM) template](#using-a-custom-encryption-provider), you will notice we have configured the Lambda function to use a memory size of 1024 MB. We compared the performances of Lambda functions of several different memory sizes and concluding 1024 MB was the most optimal size for this feature. For more information, you can see the full reports of our [load tests](https://github.com/aws-powertools/powertools-lambda-python/pull/2197#issuecomment-1730571597) and [traces](https://github.com/aws-powertools/powertools-lambda-python/pull/2197#issuecomment-1732060923).
@@ -142,11 +142,11 @@ You have the option to modify some of the configurations we have set as defaults
142142

143143
The `CACHE_CAPACITY` value is currently set to `100`. This value represents the maximum number of entries that can be retained in the local cryptographic materials cache. Please see the [AWS Encryption SDK documentation](https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.caches.local.html){target="_blank" rel="nofollow"} for more information.
144144

145-
The `MAX_CACHE_AGE_SECONDS` value is currently set to `300`. It represents the maximum time (in seconds) that a cache entry may be kept in the cache. Please see the [AWS Encryption SDK documentation](https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.materials_managers.caching.html#module-aws_encryption_sdk.materials_managers.caching){target="_blank" rel="nofollow"} for more information about this.
145+
The `MAX_CACHE_AGE_SECONDS` value is currently set to `300`. This represents the maximum time (in seconds) that a cache entry may be kept in the cache. Please see the [AWS Encryption SDK documentation](https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.materials_managers.caching.html#module-aws_encryption_sdk.materials_managers.caching){target="_blank" rel="nofollow"} for more information about this.
146146

147147
#### Limit messages
148148

149-
The `MAX_MESSAGES_ENCRYPTED` value is currently set to `200`. It represents the maximum number of messages that may be encrypted under a cache entry. Please see the [AWS Encryption SDK documentation](https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.materials_managers.caching.html#module-aws_encryption_sdk.materials_managers.caching){target="_blank" rel="nofollow"} for more information about this.
149+
The `MAX_MESSAGES_ENCRYPTED` value is currently set to `200`. This represents the maximum number of messages that may be encrypted under a cache entry. Please see the [AWS Encryption SDK documentation](https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.materials_managers.caching.html#module-aws_encryption_sdk.materials_managers.caching){target="_blank" rel="nofollow"} for more information about this.
150150

151151
### Create your own encryption provider
152152

@@ -188,16 +188,16 @@ Here is an example of implementing a custom encryption using an external encrypt
188188
--8<-- "examples/data_masking/src/generic_data_input.json"
189189
```
190190

191+
=== "custom_provider.py"
192+
```python hl_lines="1 3 6 8"
193+
--8<-- "examples/data_masking/src/custom_data_masking_provider.py"
194+
```
195+
191196
=== "working_with_own_provider.py"
192197
```python hl_lines="1-2 9-10"
193198
--8<-- "examples/data_masking/src/working_with_own_provider.py"
194199
```
195200

196-
=== "custom_provider.py"
197-
```python hl_lines="1 3 8"
198-
--8<-- "examples/data_masking/src/custom_data_masking_provider.py"
199-
```
200-
201201
=== "encrypted_output.json"
202202
```json hl_lines="5-7 12"
203203
--8<-- "examples/data_masking/src/encrypt_data_output.json"

0 commit comments

Comments
 (0)