Skip to content

Commit 62e1aba

Browse files
committed
Docs cleanup
1 parent b7a3345 commit 62e1aba

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

docs/utilities/data_masking.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ stateDiagram-v2
3838
## Key features
3939

4040
* Encrypt, decrypt, or irreversibly erase data with ease
41-
* Remove sensitive information in one or more fields within nested data
41+
* Erase sensitive information in one or more fields within nested data
4242
* Seamless integration with [AWS Encryption SDK](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html){target="_blank"} for industry and AWS security best practices
4343

4444
## Terminology
4545

4646
**Erasing** replaces sensitive information **irreversibly** with a non-sensitive placeholder _(`*****`)_. This operation replaces data in-memory, making it a one-way action.
4747

48-
**Encrypting** transforms plaintext into ciphertext using an encryption algorithm and a cryptographic key. It allows you to encrypt any sensitive data, so only allowed personnel to decrypt it.
48+
**Encrypting** transforms plaintext into ciphertext using an encryption algorithm and a cryptographic key. It allows you to encrypt any sensitive data, so only allowed personnel to decrypt it. Learn more about encryption [here](https://aws.amazon.com/blogs/security/importance-of-encryption-and-how-aws-can-help/){target="_blank"}.
4949

5050
**Decrypting** transforms ciphertext back into plaintext using a decryption algorithm and the correct decryption key.
5151

@@ -179,16 +179,16 @@ Under the hood, we delegate a [number of operations](#decrypt-operation-with-enc
179179

180180
### Encryption context for integrity and authenticity
181181

182-
For a stronger security posture, you can add metadata to each encryption operation, and verify them during decryption. This is known as additional authenticated data (AAD). These are non-sensitive data that can help protect authenticity and integrity of your encrypted data.
182+
For a stronger security posture, you can add metadata to each encryption operation, and verify them during decryption. This is known as additional authenticated data (AAD). These are non-sensitive data that can help protect authenticity and integrity of your encrypted data, and even help to prevent a [confused deputy](https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html) situation.
183183

184184
???+ danger "Important considerations you should know"
185185
1. **Exact match verification on decrypt**. Be careful using random data like `timestamps` as encryption context if you can't provide them on decrypt.
186186
2. **Only `string` values are supported**. We will raise `DataMaskingUnsupportedTypeError` for non-string values.
187-
3. **Use non-sensitive data only**. When using KMS, encryption context is available as plaintext in AWS CloudTrail. Unless you [intentionally disabled KMS events](https://docs.aws.amazon.com/kms/latest/developerguide/logging-using-cloudtrail.html#filtering-kms-events){target="_blank"}.
187+
3. **Use non-sensitive data only**. When using KMS, encryption context is available as plaintext in AWS CloudTrail, unless you [intentionally disabled KMS events](https://docs.aws.amazon.com/kms/latest/developerguide/logging-using-cloudtrail.html#filtering-kms-events){target="_blank"}.
188188

189189
=== "getting_started_encryption_context.py"
190190

191-
```python hl_lines="27-29"
191+
```python hl_lines="26-28"
192192
--8<-- "examples/data_masking/src/getting_started_encryption_context.py"
193193
```
194194

@@ -348,13 +348,13 @@ Here are common scenarios to best visualize how to use `fields`.
348348

349349
=== "Data"
350350

351-
> Expression: `data_masker.erase(data, fields=["$.address[?(@.postcode > 81846)]"])`
351+
> Expression: `data_masker.erase(data, fields=["$.address[?(@.postcode > 12000)]"])`
352352

353353
> `$`: Represents the root of the JSON structure.
354354

355355
> `.address`: Selects the "address" property within the JSON structure.
356356

357-
> `(@.postcode > 81846)`: Specifies the condition that elements should meet. It selects elements where the value of the `postcode` property is `greater than 81846`.
357+
> `(@.postcode > 12000)`: Specifies the condition that elements should meet. It selects elements where the value of the `postcode` property is `greater than 12000`.
358358

359359
```json hl_lines="8 12"
360360
--8<-- "examples/data_masking/src/choosing_payload_complex_search.json"
@@ -406,7 +406,7 @@ For compatibility or performance, you can optionally pass your own JSON serializ
406406

407407
=== "advanced_custom_serializer.py"
408408

409-
```python hl_lines="16"
409+
```python hl_lines="17-18"
410410
--8<-- "examples/data_masking/src/advanced_custom_serializer.py"
411411
```
412412

@@ -429,7 +429,7 @@ The AWS Encryption SDK defaults to using the `AES_256_GCM_HKDF_SHA512_COMMIT_KEY
429429

430430
=== "changing_default_algorithm.py"
431431

432-
```python hl_lines="5 29"
432+
```python hl_lines="5 26"
433433
--8<-- "examples/data_masking/src/changing_default_algorithm.py"
434434
```
435435

examples/data_masking/src/choosing_payload_multiple_keys_output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "card_number",
2+
"name": "Carlos",
33
"operation": "non sensitive",
44
"card_number": "1111 2222 3333 4444",
55
"address": {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{"body": "AgV4uF5K2YMtNhYrtviTwKNrUHhqQr73l/jNfukkh+qLOC8AXwABABVhd3MtY3J5cHRvLXB1YmxpYy1rZXkAREEvcjEyaFZHY1R5cjJuTDNKbTJ3UFA3R3ZjaytIdi9hekZqbXVUb25Ya3J5SzFBOUlJZDZxZXpSR1NTVnZDUUxoZz09AAEAB2F3cy1rbXMAS2Fybjphd3M6a21zOnVzLWVhc3QtMToyMDA5ODQxMTIzODY6a2V5LzZkODJiMzRlLTM2NjAtNDRlMi04YWJiLTdmMzA1OGJlYTIxMgC4AQIBAHjxYXAO7wQGd+7qxoyvXAajwqboF5FL/9lgYUNJTB8VtAHBP2hwVgw+zypp7GoMNTPAAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMx/B25MTgWwpL7CmuAgEQgDtan3orAOKFUfyNm3v6rFcglb+BVVVDV71fj4aRljhpg1ixsYFaKsoej8NcwRktIiWE+mw9XmTEVb6xFQIAABAA9DeLzlRaRQgTcXMJG0iBu/YTyyDKiROD+bU1Y09X9RBz5LA1nWIENJKq2seAhNSB/////wAAAAEAAAAAAAAAAAAAAAEAAAEBExLJ9wI4n7t+wyPEEP4kjYFBdkmNuLLsVC2Yt8mv9Y1iH2G+/g9SaIcdK57pkoW0ECpBxZVOxCuhmK2s74AJCUdem9McjS1waUKyzYTi9vv2ySNBsABIDwT990rE7jZJ3tEZAqcWZg/eWlxvnksFR/akBWZKsKzFz6lF57+cTgdISCEJRV0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1waUKyzYTi9vv2ySNBsABIDwT990rE7jZJ3tEZAqcWZg/eWlxvnksFR/akBWZKsKzFz6lF57+cTgdISCEJRV0E7fcUeCuaMaQGK1Qw2OCmIeHEG5j5iztBkZG2IB2CVND/AbxmDUFHwgjsrJPTzaDYSufcGMoZW1A9X1sLVfqNVKvnOFP5tNY7kPF5eAI9FhGBw8SjTqODXz4k6zuqzy9no8HtXowP265U8NZ5VbVTd/zuVEbZyK5KBqzP1sExW4RhnlpXMoOs9WSuAGcwZQIxANTeEwb9V7CacV2Urt/oCqysUzhoV2AcT2ZjryFqY79Tsg+FRpIx7cBizL4ieRzbhQIwcRasNncO5OZOcmVr0MqHv+gCVznndMgjXJmWwUa7h6skJKmhhMPlN0CsugxtVWnD"
3+
}

examples/data_masking/src/getting_started_decrypt_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def lambda_handler(event: dict, context: LambdaContext) -> dict:
2121

2222
logger.info("Decrypting whole object")
2323

24-
decrypted = data_masker.decrypt(data) # (3)!
24+
decrypted = data_masker.decrypt(data)
2525

2626
return decrypted

examples/data_masking/src/getting_started_encrypt_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ def lambda_handler(event: dict, context: LambdaContext) -> dict:
2323

2424
logger.info("Encrypting the whole object")
2525

26-
encrypted = data_masker.encrypt(data) # (2)!
26+
encrypted = data_masker.encrypt(data)
2727

2828
return {"body": encrypted}

examples/data_masking/tests/test_lambda_mask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def lambda_context():
1010
class LambdaContext:
1111
function_name: str = "test"
1212
memory_limit_in_mb: int = 128
13-
invoked_function_arn: str = "arn:aws:lambda:eu-west-1:809313241:function:test"
13+
invoked_function_arn: str = "arn:aws:lambda:eu-west-1:111111111:function:test"
1414
aws_request_id: str = "52fdfc07-2182-154f-163f-5f0f9a621d72"
1515

1616
def get_remaining_time_in_millis(self) -> int:

0 commit comments

Comments
 (0)