AWS offers services to handle the cache management process. Earlier, we were using Memcached or Redis installed on VM, which was a very complex and tough task to manage in terms of ensuring availability, patching, scalability, and security.
[box type="shadow" align="" class="" width=""]This article is an excerpt taken from the book,'Cloud Security Automation'. In this book, you'll learn the basics of why cloud security is important and how automation can be the most effective way of controlling cloud security.[/box]
On AWS, we have this service available as ElastiCache. This gives you the option to use any engine (Redis or Memcached) to manage your cache. It's a scalable platform that will be managed by AWS in the backend.
ElastiCache provides a scalable and high-performance caching solution. It removes the complexity associated with creating and managing distributed cache clusters using Memcached or Redis.
Now, let's look at how to secure ElastiCache.
For enhanced security, we deploy ElastiCache clusters inside VPC. When they are deployed inside VPC, we can use a security group and NACL to add a level of security on the communication ports at network level.
Apart from this, there are multiple ways to enable security for ElastiCache.
Using a security group at VPC—when we deploy AWS ElastiCache in VPC, it gets associated with a subnet, a security group, and the routing policy of that VPC. Here, we define a rule to communicate with the ElastiCache cluster on a specific port.
ElastiCache clusters can also be accessed from on-premise applications using VPN and Direct Connect.
We use IAM in order to implement the authentication and access control on ElastiCache. For authentication, you can have the following identity type:
Apart from this, we can also specify federated access to services where we have an IAM role with temporary credentials for accessing the service.
To access ElastiCache, service users or services must have a specific set of permissions such as create, modify, and reboot the cluster.
For this, we define an IAM policy and associate it with users or roles.
Let's see an example of an IAM policy where users will have permission to perform system administration activity for ElastiCache cluster:
{ "Version": "2012-10-17", "Statement":[{ "Sid": "ECAllowSpecific", "Effect":"Allow", "Action":[ "elasticache:ModifyCacheCluster", "elasticache:RebootCacheCluster", "elasticache:DescribeCacheClusters", "elasticache:DescribeEvents", "elasticache:ModifyCacheParameterGroup", "elasticache:DescribeCacheParameterGroups", "elasticache:DescribeCacheParameters", "elasticache:ResetCacheParameterGroup", "elasticache:DescribeEngineDefaultParameters"], "Resource":"*" } ] }
AWS ElastiCache also adds an additional layer of security with the Redis authentication command, which asks users to enter a password before they are granted permission to execute Redis commands on a password-protected Redis server.
When we use Redis authentication, there are the following few constraints for the authentication token while using ElastiCache:
To make the policy harder or more complex, there are the following rules related to defining the strength of a password:
AWS ElastiCache and EC2 instances have mechanisms to protect against unauthorized access of your data on the server.
ElastiCache for Redis also has methods of encryption for data run-in on Redis clusters. Here, too, you have data-in-transit and data-at-rest encryption methods.
ElastiCache ensures the encryption of data when in transit from one location to another. ElastiCache in-transit encryption implements the following features:
ElastiCache for Redis at-rest encryption is an optional feature that increases data security by encrypting data stored on disk during sync and backup or snapshot operations.
However, there are the following few constraints for data-at-rest encryption:
To summarize, we learned how to secure ElastiCache and ensured security for PaaS services, such as database and analytics services. If you've enjoyed reading this article, do check out 'Cloud Security Automation' for hands-on experience of automating your cloud security and governance.
AWS Sydney Summit 2018 is all about IoT
AWS Fargate makes Container infrastructure management a piece of cake