Now that Chapter 1 has given you some idea of where your cloud provider’s responsibility ends and yours begins, your first step to securing your cloud environment is to figure out where your data is—or is going to be—and how you’re going to protect it. There is often a lot of confusion about the term “asset management.” What exactly are our assets, and what do we need to do to manage them? The obvious (and unhelpful) answer is that assets are anything valuable that you have. Let’s start to home in on the details.
In this book, I’ve broken up asset management into two parts: data asset management and cloud asset management. Data assets are the important information you have, such as customer names and addresses, credit card information, bank account information, or credentials to access such data. Cloud assets are the things you have that store and process your data—compute resources such as servers or containers, storage such as object stores or block storage, and platform instances such as databases or queues. Managing these assets is covered in the next chapter. While you can start with either data assets or cloud assets, and may need to go back and forth a bit to get a full picture, I find it easier to start with data assets.
The theory of managing data assets in the cloud is no different than on-premises, but in practice there are some cloud technologies that can help.
Data Identification and Classification
If you’ve created at least a “back-of-the-napkin” diagram and threat model as described in the previous chapter, you’ll have some idea of what your important data is, as well as the threat actors you have to worry about and what they might be after. Let’s look at different ways threat actors might attack your data.
One of the more popular information security models is the CIA triad : confidentiality, integrity, and availability. A threat actor trying to breach your data confidentiality wants to steal it, usually to sell it for money or embarrass you. A threat actor trying to breach your data integrity wants to change your data, such as by altering a bank balance. (Note that this can be effective even if the attacker cannot read the bank balances; I’d be happy to have my bank balance be a copy of Bill Gates’s, even if I don’t know what that value is.) A threat actor trying to breach your data availability wants to take you offline for fun or profit, or use ransomware to encrypt your files. 1
Most of us have limited resources and must prioritize our efforts. 2 A data classification system can assist with this, but resist the urge to make it more complicated than absolutely necessary.
Example Data Classification Levels
Every organization is different, but the following rules provide a good, simple starting point for assessing the value of your data, and therefore the risk of having it breached:
Low or public
While the information in this category may or may not be intended for public release, if it were released publicly the impact to the organization would be very low or negligible. Here are some examples:
-
Your servers’ public IP addresses
-
Application log data without any personal data, secrets, or value to attackers
-
Software installation materials without any secrets or other items of value to attackers
Moderate or private
This information should not be disclosed outside of the organization without the proper nondisclosure agreements. In many cases (especially in larger organizations) this type of data should be disclosed only on a need-to-know basis within the organization. In most organizations, the majority of information will fall into this category. Here are some examples:
-
Detailed information on how your information systems are designed, which may be useful to an attacker
-
Information on your personnel, which could provide information to attackers for phishing or pretexting attacks
-
Routine financial information, such as purchase orders or travel reimbursements, which might be used, for example, to infer that an acquisition is likely
High or confidential
This information is vital to the organization, and disclosure could cause significant harm. Access to this data should be very tightly controlled, with multiple safeguards. In some organizations, this type of data is called the “crown jewels.” Here are some examples:
-
Information about future strategy, or financial information that would provide a significant advantage to competitors
-
Trade secrets, such as the recipe for your popular soft drink or fried chicken
-
Secrets that provide the “keys to the kingdom,” such as full access credentials to your cloud infrastructure
-
Sensitive information placed into your hands for safekeeping, such as your customers’ financial data
-
Any other information where a breach might be newsworthy
Note that laws and industry rules may effectively dictate how you classify some information. For example, the European Union’s General Data Protection Regulation (GDPR) has many different requirements for handling personal data, so with this system you might choose to classify all personal data as “moderate” risk and protect it accordingly. Payment Card Industry Data Security Standard (PCI DSS) requirements would probably dictate that you classify cardholder data as “high” risk if you have it in your environment.
Also, note that there are cloud services that can help with data classification and protection. As examples, Amazon Macie can help you find sensitive data in Amazon S3 buckets, Google Cloud Sensitive Data Prevention can help you classify or mask certain types of sensitive data, and Microsoft Purview can classify data on Azure cloud services.
Whatever data classification system you use, write down a definition of each classification level and some examples of each, and make sure that everyone generating, collecting, or protecting data understands the classification system.
Relevant Industry or Regulatory Requirements
As mentioned in the preface, this is a book on security, not compliance. As a gross overgeneralization, compliance is about proving your security to a third party—and that’s much easier to accomplish if you have actually secured your systems and data. The information in this book will help you with being secure, but there will be additional compliance work and documentation to complete after you’ve secured your systems.
That said, some compliance requirements may inform your security design. So, even at this early stage, it’s important to make note of a few industry or regulatory requirements:
EU GDPR
This regulation may apply to the personal data of any European Union or European Economic Area citizen, regardless of where in the world the data is. The GDPR requires you to catalog, protect, and audit access to “any information relating to an identifiable person who can be directly or indirectly identified in particular by reference to an identifier.” The techniques in this chapter may help you meet some GDPR requirements, but you must make sure that you include relevant personal data as part of the data you’re protecting.
US FISMA or FedRAMP
The Federal Information Security Management Act is applied per agency, whereas Federal Risk and Authorization Management Program certification may be used with multiple agencies, but both require you to classify your data and systems in accordance with FIPS 199 and other US government standards. If you’re in an area where you may need one of these certifications, you should use the FIPS 199 classification levels.
US ITAR
If you are subject to International Traffic in Arms Regulations, in addition to your own controls, you will need to choose cloud services that support ITAR. Such services are available from some cloud providers and are managed only by US personnel.
Global PCI DSS
If you’re handling credit card information, the Payment Card Industry Data Security Standard dictates that there are specific controls that you have to put in place, and there are certain types of data you’re not allowed to store.
US HIPAA
If you’re in the US and dealing with any protected health information (PHI), the Health Insurance Portability and Accountability Act mandates that you include that information in your list and protect it, which often involves encryption.
There are many other regulatory and industry requirements around the world, such as MTCS (Singapore), G-Cloud (UK), and IRAP (Australia). If you think you may be subject to any of these, review the types of data they are designed to protect so that you can ensure that you catalog and protect that data accordingly .
Data Asset Management in the Cloud
Most of the preceding information is good general practice and not specific to cloud environments. However, cloud providers are in a unique situation to help you identify and classify your data. For starters, they will be able to tell you everywhere you are storing data, because they want to charge you for the storage!
In addition, use of cloud services brings some level of standardization by design. In many cases, your persistent data in the cloud will be in one of the cloud services that store data, such as object storage, file storage, block storage, a cloud database, or a cloud message queue, rather than being spread across thousands of different disks attached to many different physical servers.
Your cloud provider gives you the tools to inventory these storage locations, as well as to access them (in a carefully controlled manner) to determine what types of data are stored there. There are also cloud services that will look at all of your storage locations and automatically attempt to classify where your important data is. You can then use this information to tag your cloud assets that store data.
Note
When you’re identifying your important data, don’t forget about passwords, API keys, and other secrets that can be used to read or modify that data! We’ll talk about the best way to secure secrets in Chapter 4 , but first you need to know exactly where they are.
If we look at our sample application that we diagrammed in Chapter 1 , there’s obviously customer data in the database. However, where else do you have important assets? Here are some things to consider:
-
The web servers have log data that may be used to identify your customers.
-
Your web server has a private key for a Transport Layer Security (TLS) certificate; with that and a little Domain Name System (DNS) or Border Gateway Protocol (BGP) hijacking, anyone could pretend to be your site and steal your customers’ passwords (and some types of second factors) as they try to log in.
-
Do you keep a list of password hashes to verify your customers? Hopefully you’re using some sort of federated ID system, as described in Chapter 4 , but if not, the password hashes are a nice target for attackers. 3
-
Your application server needs a password or API key to access the database. With this password, an attacker could read or modify everything in the database that the application can.
Even in this really simple application, there are a lot of nonobvious things you need to protect. Figure 2-1 repeats Figure 1-6 from the previous chapter, adding the data assets in the boxes.
Figure 2-1. Sample application diagram with data assets
Tagging Cloud Resources
Most cloud providers, as well as container management systems such as Kubernetes, have the concept of tags. A tag is usually a combination of a name (or “key”) and a value. These tags can be used for lots of purposes, from categorizing resources in an inventory, to making access decisions, to choosing what to alert on. For example, you might have a key of PII-data and a value of yes for anything that contains personally identifiable information, or you might use a key of datatype and a value of PII .
The problem is clear: if everyone in your organization uses different tags, they won’t be very useful! Have a policy to use tags. To support this policy, create a tag standard with a list of tags and explanations for when they must be used, use these same tags across multiple cloud providers, and require them to be applied by any automated tools that create cloud resources.
In smaller organizations, a simple tag standard will probably suffice. In larger organizations, this tag standard should probably be treated as a versioned, backward-compatible standard with an assigned owner and periodic reviews. Some tags will likely be organization-wide and some specific to subsections of the organization. Even if one of your cloud providers doesn’t explicitly support the use of tags, there are often other description fields that may be used to hold tags in easy-to-parse formats such as JSON. Tags rarely cause any harm, so use them liberally; if you don’t need them, they’re easily ignored.
Tags are free to use, so there’s rarely any technical concern with creating a lot of them, but you should be careful not to make the tag standard so complicated that it confuses the humans who have to write rules for applying and consuming tag data. In addition, cloud providers do impose some limits on how many tags a particular resource can have (usually between 15 and 64 tags per resource).
Some cloud providers even offer automation to check whether tags are properly applied to resources, so that you can catch untagged or mistagged resources early and correct them. For example, if you have a rule that every asset must be tagged with the maximum data classification allowed on that asset, then you can run automated scans to find any resources where the tag is missing or where the value isn’t one of the classification levels you have decided upon.
Table 2-1 shows the different names given to tagging by different cloud providers. Kubernetes, which may run on-premises or on any IaaS provider, uses the term “labels.”
Table 2-1. Tagging features | Infrastructure | Feature name | | --- | --- | | Amazon Web Services | Tags | | Microsoft Azure | Tags | | Google Compute Platform | Labels and network tags | | IBM Cloud | Tags |
We will talk more about tagging resources in Chapter 3 , but for now, jot down some data-related tags that may apply to your different cloud resources, such as dataclass:low , dataclass:moderate , dataclass:high , or regulatory:gdpr .
Protecting Data in the Cloud
Several of the data protection techniques discussed in this section may also be applied on-premises, but many cloud providers give you easy, standardized, and less expensive ways to protect your data.
Tokenization
Why store the data when you can store something that functions similarly to the data, but is useless to an attacker? Tokenization , which is most often used with credit card numbers, replaces a piece of sensitive data with a token (usually randomly generated). It has the benefit that the token generally has the same characteristics (such as being 16 digits long) as the original data, so underlying systems that are built to take that data don’t need to be modified. Only one place (a “token service”) knows the actual sensitive data. Tokenization can be used on its own or in conjunction with encryption, discussed next.
Examples include cloud services that work with your browser to tokenize sensitive data before sending it, and cloud services that sit in between the browser and the application to tokenize sensitive data before it reaches the application.
Encryption
Encryption is the silver bullet of the data protection world; we want to “encrypt all the things.” Unfortunately, it’s a little more complicated than that. There are three types of data you might need to encrypt:
-
Data in motion (being transmitted across a network)
-
Confidential computing, or data in use (currently being processed in a computer’s CPU or held in RAM)
-
Data at rest (on persistent storage, such as a disk)
Encryption of data in motion is discussed in detail in Chapter 6 . In this section, we’ll discuss the other two uses of encryption.
Note
More bits are not always necessary or useful once you get to a certain point; encryption is often broken due to a flaw in the implementation rather than brute force. In addition, there’s often a performance trade-off with using a cipher algorithm with more bits, particularly if you use something without hardware acceleration. If you don’t want to make a deep study of it, it’s usually safe to adopt the same cipher requirements as large private and governmental organizations that have studied the subject extensively.
Confidential computing
Encryption of data in use is now available from several cloud providers, and is typically marketed to organizations with very sensitive data under the name confidential computing . Because it changes the way the processor accesses memory, it requires support in the hardware platform, and then the feature must be exposed by the cloud provider.
The most common cloud implementation is to encrypt process or virtual machine memory so that even a privileged user (or an attacker or malware impersonating a privileged user) cannot read it, and the processor can read it only when executing code for a specific process or virtual machine. 4 If you are in a very high-security environment and your threat model includes protecting data in memory from a privileged user, or you want additional isolation between you and another tenant in the cloud, you should seek out a platform that supports memory encryption. This often goes by hardware-specific brand names such as Intel SGX/TGX, AMD SEV, and IBM Z Pervasive Encryption.
Encryption of data at rest
Encryption of data at rest can be the most complicated to implement correctly. The problem is not in encrypting the data; there are many libraries to do this. The problem is that once you’ve encrypted the data, you now have an encryption key that can be used to access it. Where do many people put this? In the clear, right next to the data! Imagine locking a door and then hanging the key on a hook next to it helpfully labeled “key.” To have real security (instead of just ticking a checkbox indicating that you’ve encrypted data), you must have proper key management. Fortunately, there are cloud services to help.
Tip
Encrypted data can’t be effectively compressed or deduplicated. If you want to make use of compression or deduplication, do that before encrypting it.
In traditional on-premises environments with high security requirements, you would purchase a hardware security module (HSM) to hold your encryption keys, usually in the form of an expansion card or a module accessed over the network. An HSM has significant logical and physical protections against unauthorized access. With most systems, anyone with physical access can try to tamper with it, but an HSM has sensors to wipe out the data as soon as someone tries to take it apart, scan it with X-rays, fiddle with its power source, or look threateningly in its general direction.
HSMs are expensive, and so are not feasible for most on-premises deployments. However, in cloud environments, advanced technologies such as HSMs and encryption key management systems are now within reach of projects with modest budgets.
Some cloud providers have an option to rent a dedicated HSM for your environment. While this may be required for the highest-security environments, a dedicated HSM is still expensive in a cloud environment, and is often harder to spin up automatically. Another good option is a key management service (KMS), which is run by the cloud provider and usually uses an HSM on the backend to keep keys safe. A KMS is usually a multitenant service, which is a slightly larger attack surface, and you do have to trust both the HSM and the KMS (instead of just the HSM), which adds a little additional risk. However, compared to performing your own key management—often incorrectly—a KMS provides excellent security at a very low cost. You can have the benefits of proper key management in projects with more modest security budgets.
Table 2-2 lists the key management options offered by the major cloud providers, as of this writing.
Table 2-2. Key management options | Provider | Dedicated HSM option | Key management service | | --- | --- | --- | | Amazon Web Services | Cloud HSM | Amazon KMS | | Microsoft Azure | Azure Dedicated HSM | Key Vault | | Google Compute Platform | Cloud HSM | Cloud KMS | | IBM Cloud | Cloud HSM | Key Protect |
So, how do you actually use a KMS correctly? This is where things get a little complicated.
Key management
The simplest approach to key management is to generate a key, encrypt the data with that key, stuff the key into the KMS, and then write the encrypted data to disk along with a note indicating which key was used to encrypt it. There are two main problems with this approach:
-
It puts a lot of load on the KMS. There are good reasons for wanting a different key for every file, so a KMS with a lot of customers would have to store billions or trillions of keys with near instantaneous retrieval.
-
If you want to securely erase the data, you have to trust the KMS to irrevocably erase the key when you’re done with it, and not leave any backup copies lying around. Alternatively, you have to overwrite all of the encrypted data, 5 which can take a while.
You may not want to wait hours or days for your data to be overwritten. It’s better if you have the option to quickly and securely erase data objects in two ways: either by deleting a key at the KMS, which may effectively erase a lot of different objects at once; or by deleting a key where the data is actually stored, to delete a single data object. For these reasons, you typically have two levels of keys: a key encryption key (KEK) and a data encryption key (DEK). As the names suggest, the key encryption key is used to encrypt (or “wrap”) data encryption keys, and the wrapped keys are stored right next to the data. The key encryption key usually stays in the KMS and never comes out, for safety. The wrapped data encryption keys are sent to the HSM for unwrapping when needed, and then the unwrapped keys are used to encrypt or decrypt the data. You never write down the unwrapped keys. When you’re done with the current encryption or decryption operation, you forget about them. 6
The use of keys is easier to understand with a real-world analogy. Imagine you are selling your house (which contains all of your data), and you provide a key to your realtor to unlock your door. This house key is like a data encryption key; it can be used to directly access your house (data). The realtor will place this key into a key box on your door, and protect it with a code provided by the realtor service. This code is like the key encryption key, and the realtor service that hands out codes is like the key management service. In this mildly strained analogy, you actually take the key box to the KMS, and it gives you a copy of the key inside with the agreement that you won’t make a copy of it (write it to disk) and you’ll melt (forget) that copy when finished with it. You never actually see the code that opens the box.
The end result is that when you walk up to the house (data), you know the data key’s right there, but it can’t be opened without another key or password. Of course, in the real world, a hammer and a little time would get the key out of the box, or would allow you to break a window and not need the key. The cryptographic equivalent of the hammer is guessing the key or password used to protect the data key. This is usually done by trying all of the possibilities (brute force) or, for keys based on passwords, trying many common passwords (a dictionary attack). If the encryption algorithm and the implementation of that algorithm are correct, the expected time for the “hammer” to get into the box is considerably longer than the expected lifetime of the universe.
Server-side and client-side encryption
The great news is that you usually don’t have to do most of this key management yourself! For most cloud providers, if you’re using their storage and their KMS, and you turn on KMS encryption for your storage instances, the storage service will automatically create data encryption keys, wrap them using a key encryption key that you can manage in the KMS, and store the wrapped keys along with the data. You can still manage the keys in the KMS, but you don’t have to ask the KMS to wrap or unwrap them, and you don’t have to perform the encryption or decryption operations yourself. Some providers call this server-side encryption .
Because the multitenant storage service does have the ability to decrypt your data, an error in that storage service could potentially allow an unauthorized user to ask the storage service to decrypt your data. For this reason, having the storage service perform the encryption/decryption is not quite as secure as doing the decryption in your own instance—if you implement it correctly, using well-known libraries and processes. Doing the encryption and decryption in your own application is often called client-side encryption . However, unless you have a very low risk tolerance (and a budget to match that low risk tolerance), I recommend that you use well-tested cloud services and allow them to handle the encryption/decryption for you.
Note that when using client-side encryption, the server does not have the ability to read the encrypted data because it doesn’t have the keys. This means no server-side searches, calculation, indexing, malware scans, or other high-value tasks can be performed. Homomorphic encryption may make it feasible for operations such as addition to be performed correctly on encrypted data without decrypting the data, but as of this writing it’s too slow to be practical.
Warning
Unless you have devoted most of your distinguished career to cryptography, do not attempt to create or implement your own crypto systems. Even when performing the encryption/decryption in your own application, use only well-tested and supported library implementations of secure algorithms.
If your organization doesn’t have a list of approved cryptographic algorithms, a good source for recommended algorithms is NIST SP 800-131A .
Cryptographic erasure
It’s actually difficult to reliably destroy large amounts of data. 7 It takes a long time to overwrite the data completely, and even then there may be other copies sitting around. We can solve this through cryptographic erasure . With this approach, rather than storing clear-text data on the disk, we store only an encrypted version. Then, when we want to make data unrecoverable, we can wipe or revoke access to the key encryption key in the KMS, which will make all of the data encryption keys “wrapped” with that key encryption key useless, wherever they are in the world. We can also wipe a specific piece of data by wiping out just its wrapped data encryption key, so a multiterabyte file can be effectively made unrecoverable by overwriting a 256-bit key.
How encryption foils different types of attacks
As we’ve discussed, encryption of data at rest can protect data from attackers by limiting their choices; the data is available in the clear only in a few places, depending on where in the system the encryption is being performed. Let’s look at a simple example application using a database to see how our encryption choices protect us. The relevant layers of this application are:
-
The storage system that the disks go in, which may encrypt data before sending it to the disks
-
The Database-as-a-Service platform offering, which may encrypt data before sending it to the storage system
-
The application, which may encrypt data before sending it to the database
Let’s explore the benefits, drawbacks, and residual risk of encryption at each of these layers.
Disk-level encryption
Attackers might successfully steal disks from the data center or the dumpster, or steal tapes in transit. If the storage subsystem is encrypting data before storing it on disk, these attackers can’t make use of the data even with physical access to the disks or tapes. The attackers only have access to an unintelligible “bag of bits,” and the keys to decrypt the data are safely stored elsewhere, on the storage subsystem!
There used to be performance trade-offs for encrypting data sent to disk, but with hardware cryptographic acceleration this is largely no longer an issue; cloud providers routinely encrypt almost all data stored to disk, except in some bare-metal cases where you manage the disks directly. So, there are very few drawbacks to disk-level encryption in a cloud environment, and it’s probably done for you.
This is great news, but stolen or lost media typically isn’t a large risk in cloud environments, given the physical controls and equipment disposal controls most cloud providers implement. (Disk-level encryption is far more important for portable devices such as smartphones and laptops, where devices get lost or stolen regularly and decommissioning processes may not be as mature.)
Encryption performed only to “check the encryption box” will often only help to mitigate this threat of physical theft—and sometimes not even this threat, because this protection also fails if you store unwrapped keys on the same media as the data.
However, what if the attackers are able to impersonate an administrator of the storage system that the disks can go in? Since the storage subsystem performs the decryption, attackers at that layer (or above) will be able to see the unencrypted data.
Platform-level encryption
What if you have the database (or other service) encrypt the data before sending it to the storage subsystem? In that case, anyone with access to the storage subsystem under the database will only have a bag of bits; they can destroy the data or make it temporarily unavailable, but should not be able to read or tamper with it.
The trade-off for encrypting at this layer is often a little worse; because the database is encrypting the data prior to sending it to storage, that means it can’t be compressed or deduplicated by the storage subsystem, which in turn means that storage costs may be higher. Depending on the database engine, there may also be some performance trade-offs.
While database-level encryption protects you from things that go wrong at the layers underneath it, there’s still some risk. The database has users who are allowed to see the data in the database, and the database service has administrators who may be able to access any database. Cloud providers often have several layers of controls to prevent their administrators from reading or tampering with customer data, so that’s a relatively low risk. However, the larger risk is that if an attacker gets access to the API key that your application uses to talk to the database, the attacker will be able to read and write everything in the database that the application can!
Application-level encryption
Now we’re at the top of the stack. If your application encrypts data prior to sending it to the database, then anyone at the database level is left holding a bag of bits unless they can get into the application, or can steal the application’s encryption key.
Whereas you may lose some performance or cost-effectiveness when encrypting at the database layer, there’s a more significant trade-off here, with application-level encryption. Because the database cannot see the unencrypted data, it cannot search for specific data items, sort the data, report on it, or perform similar functions. The application has to do these things (or live without them), which can have significant performance or functionality impacts. I generally recommend implementing application-level encryption only for the most sensitive data your application processes, and letting the lower layers handle encryption for everything else.
If an attacker gains unauthorized access to the application, all bets are off from an encryption standpoint, because the application must be able to read the data in order to function. However, defense in depth techniques can help. For example, using separate data stores protected by access control lists (ACLs) and separate encryption keys for different applications can lower the impact of such a breach, by keeping the attacker from being able to read anything other than what the compromised application has access to.
Quantum-Safe Cryptography
Quantum computers are expected to be much better at some tasks than classical computers, and some of those tasks have security implications for encryption. A well-known example is that if you can factor large numbers quickly, then you can break an important cryptographic algorithm.
Although quantum computers cannot enable these attacks yet, one of the risks is that attackers will harvest encrypted data now so that they can decrypt it later. For this reason, there is an industry-wide push to move to quantum-safe algorithms long before these attacks become feasible in the real world.
Algorithms used for encryption of data in motion are most at risk, and future versions of TLS are expected to use quantum-safe algorithms. While encryption of data at rest via AES-256 is expected to be safe for the foreseeable future, it’s worth noting that many schemes use a non-quantum-safe algorithm to encrypt the AES symmetric key. This is done so that you can make the key available to many different individuals without encrypting multiple copies of the data with different AES keys, but any products that do this will need to update to reencrypt the AES keys using a quantum-safe algorithm, or the data at rest may also be compromised.
For an in-depth look at quantum-safe cryptography, one good reference currently in development is NIST SP 1800-38 .
This is another example of where designing for defense in depth can help. Design the system so that if you make encrypted versions of your data publicly available without the keys, in theory nobody can read them. In addition, protect the encrypted data wherever possible so that if that assumption fails, your data is still safe .
Conclusion
When planning your cloud strategy, you need to figure out what data you have—both the obvious and non-obvious parts. Classify each type of data by the impact to you if it’s read, modified, or deleted by an attacker. Get organizational-wide agreement on which tags to use in a “tag standard,” and use the tagging features offered by your cloud provider to tag resources that contain data.
If possible, you should decide on an encryption strategy before you create cloud resources that store data, because it can be difficult to change later. In most cases, you should use your cloud provider’s key management system to manage the encryption keys, and you should use built-in encryption in the database and storage services. If you have really sensitive information, consider encrypting it yourself in your application prior to storing it, and use only well-tested implementations of secure algorithms.
Carefully control the users and systems that have access to the keys, and set up alerts to let you know when the keys are being accessed in any unusual fashion. Use of a key management system will provide another layer of protection in addition to the access controls on the storage instances, and can also provide you with an easy way to cryptographically erase the information when you’re done with it.
One of the concerns with encryption is that it can reduce performance, due to the extra processing time required to encrypt and decrypt the data. Fortunately, this is no longer as big a concern as it once was; hardware is cheap, and all of the major chip makers have some form of hardware acceleration built into their CPUs. Performance concerns are rarely a good excuse for not encrypting data, but there are some trade-offs, and you can be certain only by testing with real-world loads.
A more important concern around encryption is the availability of your data. If you cannot access the encryption keys, you cannot access your data. Ensure that you have some sort of “break the glass” process for getting access to the encryption keys, and make sure that it’s “noisy” and cannot be used without detection and alerting.
Finally, if the “bottom” of the stack is the physical hardware and the “top” of the stack is the application, you get protection against more types of breaches by having the encryption happen as close to the top of the stack as possible. The trade-offs are getting less functionality, performance, and cost-effectiveness from the lower layers, and having to do more work yourself.
In a cloud environment, your data assets are stored and processed by different types of cloud assets. In the next chapter, we’ll see what the different types are and how to track and protect them.
Exercises
-
What is a reasonable number of data classification levels for most organizations?
-
3
-
30
-
300
-
-
What are some good examples of data assets you may need to protect in the cloud? Select all that apply.
-
Password hashes
-
API keys
-
Documents and images you store for your customers
-
IP addresses of your end users
-
-
In what states can data be encrypted and decrypted? Select all that apply.
-
When data is at rest, and written to some persistent storage
-
When data is in use in memory
-
When data is in motion, and transmitted from one place to another
-
When data is deleted, and removed from use
-
-
Which of the following statements about key management is true?
-
A hardware security module is required for proper key management.
-
You should never write encryption keys alongside the data, even if the keys themselves are encrypted using a different key that’s not stored with the data.
-
Cloud providers have services to do some of the key management for you.
-
-
If you have the disk controller encrypt data as it’s written to the physical disk, what types of attackers will be blocked by this encryption?
-
Attackers who gain unauthorized access to an application that uses the disk
-
Attackers who gain unauthorized access to a database used by the application
-
Attackers who gain access to the physical disk
-
1 Ransomware is both an availability and an integrity breach, because it uses unauthorized modifications of your data in order to make it unavailable.
2 If you have unlimited resources, please contact me!
3 Remember LinkedIn’s 6.5 million password hashes that were stolen, cracked offline, and then used to compromise other accounts where users reused their LinkedIn password? This has happened many times, and sites like have i been pwned can tell you about all of the breaches that may contain your email or password data.
4 Note that in-memory encryption protects data only from attacks from outside the process; if you manage to trick the process itself into doing something it shouldn’t, it can read the memory and divulge the data.
5 Despite the findings of a well-known USENIX paper from 1996 by Peter Gutmann exploring the ability to recover data on a hard disk that’s been overwritten, it’s not practical today. Recovering overwritten data from solid state drives (SSDs) is slightly more practical due to the way writes happen, but most SSDs have a “secure erase” feature to sanitize the entire drive; see Michael Wei et al.’s 2011 USENIX paper for more details.
6 This is an extremely simplified explanation. For a really deep discussion of all things cryptographic, see Bruce Schneier’s book Applied Cryptography , 2nd ed. (Wiley, 1996).
7 Although paradoxically, it’s often easy to do by accident!