DataSunrise Achieves AWS DevOps Competency Status in AWS DevSecOps and Monitoring, Logging, Performance

Protecting Sensitive Data with Field Level Encryption (FLE)

Protecting Sensitive Data with Field Level Encryption (FLE)

Field Level Encryption content image

Introduction

In today’s digital world, protecting sensitive data is more critical than ever. Companies face the daunting task of keeping private information like Personally Identifiable Information (PII), Protected Health Information (PHI), financial records, and intellectual property secure. Failure to properly safeguard this data can lead to disastrous consequences, from reputational damage to hefty regulatory fines. Fortunately, Field Level Encryption (FLE) has emerged as a powerful tool to help companies meet their data security obligations. This article discusses Field Level Encryption.

It explains how it works and its advantages. It also covers how to implement it properly. Additionally, it explains how FLE helps with following regulations.

What is Field Level Encryption?

FLE is a complex way to protect data. It encrypts sensitive data fields to stop unauthorized access. Applications and systems process the data while this occurs. Field Level Encryption allows you to encrypt specific data elements instead of encrypting the entire database or disk.

Common types of data secured with Field Level Encryption include:

  • PII like names, email addresses, phone numbers
  • PHI like medical record numbers, diagnoses, medications
  • Financial information like credit card and bank account numbers
  • Confidential business data like sales figures, product roadmaps, contracts

By precisely targeting the most sensitive data for encryption, Field Level Encryption provides robust security while minimizing performance impacts and preserving application functionality. Leading companies like MongoDB and Amazon have implemented Field Level Encryption capabilities into their offerings.

How Field Level Encryption Works

Client-Side Field Level Encryption (CSFLE) encrypts data on the client device. It does this before sending the data over the network and storing it in a database. The server sends the data back to the client in encrypted form for local decryption when needed.

The client uses an encryption key to perform the encryption and decryption. In production environments, store this key separately in a secure key management service. Any clients that can access the underlying database will only see ciphertext in encrypted fields. Decryption requires possession of the encryption key.

Deterministic methods encrypt fields while still allowing them to index and search them. Developers can create indexes on the encrypted fields just like they would for plaintext data. The system will automatically add newly inserted documents to the indexes.

To query the database, the client encrypts the search terms before sending the request. The database processes the query and returns the encrypted results, which the client then decrypts. This process is transparent to the end user.

Benefits of Field Level Encryption

Compared to alternative approaches like whole database or disk encryption, Field Level Encryption provides several key advantages:

  1. Targeted Protection: Field Level Encryption gives control over who can access sensitive data by encrypting at the field and document level. Even if an attacker compromises the database server, operating system, or server memory, they still cannot read encrypted data.
  2. Separation of Duties: Field Level Encryption architectures cleanly separate responsibilities and access. Server/database administrators can perform their duties without being able to view sensitive data. Clients retain control over who can access protected information.
  3. Regulatory Compliance: Granular encryption helps satisfy requirements in privacy regulations like GDPR and HIPAA.

These security benefits come with minimal performance overhead, typically less than 5-10% in read-heavy workloads. And for clients/applications not authorized to access encrypted data, there is no perceptible performance impact at all.

Best Practices

While FLE is a powerful tool, it does introduce some constraints that require careful consideration:

  • Users cannot use encrypted fields in reports, business intelligence tools, or regular application functions without decrypting them. This means users cannot search, display, or validate them. To use encrypted fields, you must first decrypt them.
  • Encrypted fields have limited configurability (no default values, picklists, etc.)
  • Text fields have a max size of 255 characters
  • Encryption is one-way – there is no way to permanently revert an encrypted field to plaintext

To succeed with FLE, follow these best practices:

  1. Backup your database before encrypting any fields in case issues arise
  2. Use a unique encryption key for each object and environment (dev, staging, prod)
  3. Securely backup encryption keys
  4. Use new custom fields for encrypted data to avoid conflicts with existing application logic
  5. Thoroughly test functionality with encrypted fields

Examples Here’s a simple example of querying an encrypted “ssn” field in MongoDB with the official Node.js client:

javascript


// Import the MongoClient
const { MongoClient } = require('mongodb');
// Define the master key for encryption
const masterKey = 'my-secret-key';
// Connect to MongoDB with the encryption-enabled client
const secureClient = new MongoClient('mongodb://localhost:27017', {
  useNewUrlParser: true,
  useUnifiedTopology: true,
  autoEncryption: {
    keyVaultNamespace: 'encryption.__keyVault',
    kmsProviders: {
      local: { key: masterKey },
    },
  },
});
// Establish the database connection
await secureClient.connect();
// Define the query object with the encrypted field
const query = { ssn: '123-45-6789' };
// Execute the query on the 'people' collection in the 'myDb' database
const result = await secureClient.db('myDb').collection('people').find(query);
// Print the query result
console.log(result);

In this example:

  1. Import the MongoClient from the MongoDB driver.
  2. Define the masterKey used for encryption.
  3. Create a new MongoClient instance with encryption enabled by setting the autoEncryption options. The keyVaultNamespace indicates the location of the encryption keys. The kmsProviders indicate the key management service in use, which in this instance is a local key.
  4. Connect to the MongoDB database using the encryption-enabled client.
  5. Define the query object with the encrypted field ssn.
  6. Execute the query on the people collection in the myDb database using the find method.
  7. Finally, print the query result.

Client automatically encrypts the query object before sending it to MongoDB. Turning on encryption only requires configuring the client with a key management provider and enabling the autoEncryption option.

Conclusion

Data security is a critical priority for modern businesses. Field Level Encryption gives companies the ability to control encryption of sensitive data at the field level. This helps to enhance security for private information without causing disruptions to application functionality or user experience. FLE is important for protecting data when done correctly and aligned with security goals.

DataSunrise provides a complete set of tools for companies looking to protect their data and comply with regulations. The suite includes security, auditing, masking, and management features. Our powerful solutions integrate seamlessly to protect your most precious information assets. To learn more, we invite you to contact DataSunrise team of experts for an online demo tailored to your needs.

Next

Key Security Controls and Best Practices for Data Protection

Key Security Controls and Best Practices for Data Protection

Learn More

Need Our Support Team Help?

Our experts will be glad to answer your questions.

Countryx
United States
United Kingdom
France
Germany
Australia
Afghanistan
Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Republic of the
Congo, The Democratic Republic of the
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and Mcdonald Islands
Holy See (Vatican City State)
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran, Islamic Republic Of
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Democratic People's Republic of
Korea, Republic of
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libyan Arab Jamahiriya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia, Republic of
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territory, Occupied
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syrian Arab Republic
Taiwan, Province of China
Tajikistan
Tanzania, United Republic of
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Venezuela
Viet Nam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Choose a topicx
General Information
Sales
Customer Service and Technical Support
Partnership and Alliance Inquiries
General information:
info@datasunrise.com
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
partner@datasunrise.com