How to Manage Cloud Drift in Three Simple Steps
Cloud drift is a topic that is rarely discussed at IT department meetings. In fact, it’s usually ignored until something important stops working or a compliance audit on your codebase is coming up. Suddenly, you realize that all your perfectly crafted deployment scripts and baseline images look nothing like the testing or production environments in real life. This scenario begs the question: How far has your cloud drifted – do you roll back?
Understanding cloud drift: What it is and why it happens
Drift is nothing new. It refers to the gap between a digital system’s desired state and its actual state. In cloud computing, “cloud drift” encompasses two distinct types: Infrastructure drift and configuration drift.
Infrastructure drift
Cloud infrastructure drift is the deviation between predefined infrastructure configurations and the real-life state of your cloud resources. Since cloud users (your developers) usually have access to cloud providers’ infrastructure management portals, APIs, and CLIs, it’s a matter of one undocumented command adjusting resource allocation to a microservice to generate cloud infrastructure drift.
Configuration drift
Cloud configuration drift is the divergence between the system and infrastructure configuration definitions as set by DevOps teams and the configuration employed in the system’s operational state. It happens when the configuration files are edited without proper documentation or outside standardized CI/CD pipelines.
Causes and common problems
Broadly speaking, cloud drift happens when deployment or configuration procedures are ignored or bypassed by people or processes for one reason or another. More often than not, cloud drift is not the result of malice or insufficient skill. While it may sound counter-intuitive, in many cases, cloud drift is the only way to ensure security and performance when time is of the essence.
For example, consider a scenario where a cloud service provider deploys an emergency zero-day patch to prevent an active malefactor from exploiting a weakness in one of the software packages used throughout your cloud infrastructure. While necessary for the integrity and privacy of your systems, this emergency update may break workload dependencies.
Another common scenario is when subtle changes are made to production systems and their infrastructure to tweak performance or enable rapid scaling of system resources due to unexpected spikes in demand, all without the changes being documented or properly communicated to relevant stakeholders.
From drift to breach
Ignoring cloud drift introduces various issues for your software and infrastructure security, operations, resource allocation, and regulatory and industry standards compliance. One of the most frequent causes of security breaches in cloud environments is misconfiguration. As soon as you deviate from the tested and approved configuration baseline, you risk your app and data by introducing undocumented changes that may expose your cloud assets to attacks.
Undocumented changes dramatically delay troubleshooting and recovery from downtime. In addition to operational headaches, cloud drift can incur direct and indirect expenses, including labor hours and cloud costs. After all, cloud usage is billed according to resources reserved, and untracked changes to your cloud infrastructure resource allocation can become unpleasant surprises in your cloud services bills.
Another source of unexpected expenses can be regulatory fines for failing to comply with specific industry standards, such as HIPAA or PCI-DSS.
Catching the drift: How to manage cloud drift in three simple steps
1. Detect
Early discovery and remediation of cloud drift are key to reducing its associated risks. Therefore, visibility and observability are the first things you should aim to achieve by using continuous monitoring and planned scanning.
Since most IaC tools can’t discover undocumented resources in their scans, they can only be used to run preplanned comparisons of familiar resource states and detect changes since the last scan was performed. Hence, you’ll need continuous infrastructure monitoring.
Cloud service providers offer infrastructure configuration monitoring tools, like Azure Application Change Analysis and AWS Config. In multicloud environments, you may need to opt for a third-party tool or solution to consolidate and contextualize your cloud drift alerts.
2. Automate
Automation is at the heart of DevOps practices for consistency and speed, and cloud drift management is no different. For example, you could use automated configuration management tools that perform infrastructure maintenance (such as critical patching), application deployment scripts, IaC security scanning, and environment provisioning.
3. Enforce
Implement a robust and strict change-control policy that ensures changes are made efficiently and safely without overcomplicating processes and frustrating developers. Start by moving all your IaC and configuration files to a version control system (VCS) like Git and developing your own change management policy. This policy should include a comprehensive documentation suite detailing branch guidelines, approval processes, and other information relevant to modifying configuration files.
In addition, by leveraging a PaC (policy-as-code) framework in your CI/CD pipeline to scan your IaC scripts for potentially harmful changes to your infrastructure, you can prevent the unwanted type of cloud drift from ever reaching deployment.
The DevOps balancing act
With IaC monitoring and scanning practices, adherence to best practices in code security and version control, plus enforcement of compliance requirements and internal policies through PaC tools, you can minimize the risk of cloud drift and maintain a reliable and secure cloud environment for your applications and data.
Dotan Nahum
Dotan Nahum is the Head of Developer-First Security at Check Point Software Technologies. Dotan was the co-founder and CEO at Spectralops, which was acquired by Check Point Software, and now is the Head of Developer-First Security. Dotan is an experienced hands-on technological guru & code ninja. Major open-source contributor. High expertise with React, Node.js, Go, React Native, distributed systems and infrastructure (Hadoop, Spark, Docker, AWS, etc.). https://www.checkpoint.com/
