Skip to content

Commit f1a684c

Browse files
Add section "Why Encrypt Data at the Application Level" to the guide (rails#43202)
Ref. rails#43115
1 parent 006a82b commit f1a684c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

guides/source/active_record_encryption.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ After reading this guide you will know:
1717

1818
Active Record supports application-level encryption. It works by declaring which attributes should be encrypted and seamlessly encrypting and decrypting them when necessary. The encryption layer is placed between the database and the application. The application will access unencrypted data but the database will store it encrypted.
1919

20+
## Why Encrypt Data at the Application Level?
21+
22+
Active Record Encryption is meant to protect sensitive information in your application. A typical example is personal information from customers. But why would you want to do this if, for example, you are already encrypting your database at rest?
23+
24+
As an immediate practical benefit, encrypting sensitive attributes adds an additional security layer. For example, if an attacker gained access to your database, a snapshot of it, or your application logs, they wouldn't be able to make sense of the encrypted information. And even without thinking about malicious actors, checking application logs for legit reasons shouldn't expose personal information from customers either.
25+
26+
But more importantly, by using Active Record Encryption, you define what constitutes sensitive information in your application at the code level. This enables controlling how this information is accessed and building services around it. As examples, think about auditable Rails consoles that protect encrypted data or check the built-in system to [filter controller params automatically](./#filtering-params-named-as-encrypted-columns).
27+
2028
## Basic Usage
2129

2230
### Setup

0 commit comments

Comments
 (0)