Most explanations of infrastructure as code assume continuous deployment, container orchestration and a dedicated platform team. That framing makes a broadly useful operating discipline sound like a specialist engineering project, and an organization without those things can easily conclude the idea is not for it.
The core idea is simpler. The configuration of your systems should exist as a written, versioned and reviewable definition, rather than as an accumulated history of changes made through an interface and never recorded. A manufacturer, clinic, law firm or school district can benefit from that idea without trying to operate like a software business. The useful question is not whether to adopt every infrastructure-as-code practice. It is which parts remove enough risk and repeated work to justify their upkeep.
What counts as infrastructure and what counts as code
In a small or mid-sized organization, infrastructure is anything that is configured rather than stored as data. That includes servers and the roles installed on them, firewall and wireless policy, Group Policy, device management profiles, DNS records, backup jobs and the administrative settings of cloud services such as Microsoft 365. Each has a current state that somebody chose, and each can drift away from what was intended.
Code does not have to mean software development. A definition can be a structured text file, a PowerShell script, an exported policy report or a carefully written build document. What matters is that it lives somewhere other than the system it describes, that every change to it is recorded, that someone other than its author can review it, and that it can be compared against the running system.
The most useful definitions are declarative. They describe the end state, such as which features must be installed or which line must be present in a file, and leave the tool to work out what has to change. Ansible's lineinfile module, for example, is documented as ensuring that a particular line is in a file, so running it a second time does not add the line again. A script that only lists steps is harder to review and riskier to run twice.
The problem is configuration drift
Any environment administered by hand eventually accumulates what is politely called configuration drift and less politely called nobody knows why that is like that. A firewall rule added during an incident in 2022 remains in place with no recorded purpose. Three servers built from the same plan become subtly different because two received a fix and one was missed.
An application depends on a particular setting that was discovered by trial and error but documented nowhere. Staging slowly stops resembling production, so a successful test there proves less every month.
Drift rarely comes from carelessness. It usually arrives through ordinary work:
- A fix made under pressure during an outage and never written back.
- A vendor support session in which a technician changed settings remotely.
- An update applied to some machines and missed on others.
- A setting changed in an admin console to test something and never changed back.
- Software installers that add their own services, scheduled tasks and firewall rules.
The last source is easy to underestimate. Microsoft's documentation for the Get-NetFirewallRule cmdlet says the persistent store holds rules that did not come from Group Policy and were created manually or programmatically during application installation, which is how servers collect rules nobody remembers approving.
The environment then becomes something engineers must study before they can safely change it. Routine work starts with investigation. Recovery requires reconstructing knowledge that exists only in running systems. The person who has been around longest becomes the index to the whole estate. That concentration of knowledge is a business-continuity risk, not merely an IT inconvenience.
You probably already have drift if several of these are true:
- Only one person can explain why certain settings exist.
- Two systems that should be identical behave differently.
- The documentation is older than the last significant change.
- Every change starts with someone checking how things are currently set up.
- A test environment exists, but nobody trusts its results.
- The disaster recovery plan says to rebuild the server but not how.
Our indicative rebuild figures show the direction of travel. A standard server rebuilt manually from memory has taken about eight hours; the same work from a written runbook, about three; a partially scripted build, about one and a half; and a defined, automated build, about 0.4 hours. These are figures from ALCO rebuild work rather than a universal benchmark, and the variance becomes larger as systems become more complex. The important result is not a faster typing speed. It is replacing uncertain reconstruction with a repeatable process.
Standards already ask for a defined baseline
None of this is a software-industry invention. NIST Special Publication 800-128 defines a baseline configuration as a set of specifications for a system that has been formally reviewed and agreed on at a given point in time and can be changed only through change control procedures, and it adds that the baseline is used as a basis for future builds, releases and changes. That is infrastructure as code described in standards language, with no tool named.
The CIS Critical Security Controls make the same point from a security angle. Control 4 asks organizations to establish and maintain the secure configuration of enterprise assets, including end-user devices, network devices, non-computing and IoT devices and servers, and of software, meaning operating systems and applications.
Ransomware guidance is more specific. The 2023 update of the StopRansomware Guide, written by CISA and MS-ISAC with the NSA and the FBI added as co-authors, recommends maintaining and regularly updating golden images of critical systems, using infrastructure as code to deploy and update cloud resources, keeping backups of the template files offline, version-controlling that code and auditing changes to the templates. Its recovery steps advise rebuilding systems based on the prioritization of critical services. When a customer, auditor or insurer asks how you maintain secure configurations, a versioned definition with a change history answers with evidence rather than assurance.
Start by choosing a useful boundary
Do not begin with a promise to codify everything. Begin with one class of system whose failure or inconsistency matters: a standard Windows server, a Linux web host, a firewall policy, a cloud network, a workstation baseline or the security settings of your Microsoft 365 tenant. Define what belongs inside the boundary and what does not. Data, for example, normally needs a backup and restore process; it should not be embedded in a server build. Vendor-managed appliances may expose too little configuration to automate safely.
A good first candidate meets most of these tests:
- You run several of them, or you will need to build another one.
- Its failure would stop work or expose sensitive information.
- It changes often enough that mistakes happen.
- Its configuration can be read and set through a supported command line, API or export.
- A named person can own the definition and keep it current.
Poor first candidates include a one-off legacy system that is due for retirement, an appliance whose vendor controls the configuration, and anything whose main value is the data it holds. Write the boundary down as two short lists, inside and outside, so later disagreements about scope have something to refer to.
Create an inventory before choosing a tool
For the selected system, record the operating-system version, packages and roles, services, local policy, network settings, firewall rules, scheduled tasks, certificates, external dependencies and the source of any secrets. Mark which settings are security controls and which are merely preferences. This exercise often produces value before a line of automation exists because it exposes contradictions and undocumented dependencies.
Deciding which settings are security controls is easier with a published reference. Microsoft's Security Compliance Toolkit provides Microsoft-recommended security baselines for Windows client and server releases, Microsoft 365 Apps and Microsoft Edge, and its Policy Analyzer can compare your Group Policy Objects with those baselines and with local policy and registry settings. A difference from the baseline is not automatically wrong, but each one deserves a recorded reason.
On Windows Server, much of this can be collected with Microsoft's own PowerShell cmdlets rather than by clicking through consoles. Get-WindowsFeature piped to Where Installed lists the roles, role services and features installed on a server. Get-ScheduledTask returns the scheduled task definitions registered on a computer, and piping them to Export-ScheduledTask writes each definition out as XML that can be stored and compared. Get-GPOReport with the All parameter produces an HTML or XML report on every Group Policy Object in the domain, covering its links, security filtering, WMI filtering, delegation and computer and user settings.
Backup-GPO with the All parameter backs every Group Policy Object up to a folder that must already exist. Microsoft's documentation notes that Restore-GPO puts a backup back only into the domain it came from and fails if that domain is unavailable or the object no longer exists. For a rebuild into a new domain, Import-GPO is the documented route: it imports the settings from a backup into a target object that can be in a different domain or forest, and an optional migration table maps security principals and UNC paths across domains.
Firewall rules hold a common trap. Microsoft's documentation says that Get-NetFirewallRule run without a policy store retrieves only the persistent store, meaning rules created locally, while the ActiveStore value returns the sum of all policy stores that apply to the computer, including rules delivered by Group Policy. An inventory taken the first way can look tidy while the server enforces something quite different.
Cloud services need their own export route. Microsoft's Tenant Configuration Management APIs in Microsoft Graph can extract current tenant configuration settings, such as Exchange shared mailboxes and transport rules in Microsoft's example, once an administrator has added the service's principal to the tenant and granted it permissions. A snapshot is kept for at most seven days before it is deleted automatically, and a tenant can extract up to 20,000 resources a month across all snapshots, so download each result and store it with the rest of the inventory. For network equipment, use the vendor's own backup or export function, and check the output for keys and passwords before it goes anywhere near a repository.
For each setting, record:
- Its current value and where it is set, such as locally, by Group Policy or in a management console.
- Why it exists, or unknown if nobody can say.
- Who owns the decision.
- Whether it is a security control, a dependency or a preference.
- How you would check it on a running system.
The unknowns are the point of the exercise. Each one is either a dependency waiting to break a rebuild or a setting nobody needs, and the inventory is the cheapest moment to find out which.
Decide what stays identical and what may vary
Then decide what must be identical, what may vary by site or environment, and what should remain manually approved. The definition should describe intent clearly enough that another engineer can review it. A thousand-line script that only its author understands is automation, but it is not a durable operating model.
Settings that carry security or recovery weight belong in the identical group, such as account policy, logging destinations, encryption, endpoint protection, backup agents and firewall boundaries. Legitimate differences, such as a site name, address ranges, DNS servers or a backup window, should be expressed as named values in a separate file for each site or environment. Copying the whole definition and editing the copy creates two definitions that drift apart exactly as two hand-built servers do.
Keep a short list of actions that always need a person to approve them at the time, even once the rest is automated. Typical entries are anything that deletes or replaces a system holding data, anything that changes who can sign in as an administrator, and anything that takes a service offline during working hours.
Adopt the practice in order of return
Version control comes before automation. Put configuration files, scripts, network definitions, build documentation and inventory exports in a repository with a history, a diff, named reviewers and a reason for each change. That is a low-effort, high-return step. During an incident, the valuable question is usually not simply what the setting is; it is when it changed, who changed it and why.
That only works if each change record carries the reason. A message such as "updated firewall" tells the next person nothing. One that names the rule, the business reason, the ticket and how the change was tested tells them most of what they will need during the next incident.
A private repository on a hosted Git service is the usual home, but check what your plan includes. GitHub's plan comparison lists protected branches, required pull request reviewers and code owners for private repositories under paid plans such as GitHub Team, not under GitHub Free for organizations. Where branch protection is available, turn on Require pull request reviews before merging with at least one approval, turn on Dismiss stale pull request approvals when new commits are pushed, select Do not allow bypassing the above settings, and leave Allow force pushes and Allow deletions at their default of off for the main branch.
Next, write the standard build. It should be precise enough for a competent engineer to execute without asking the original administrator what they meant. Write it before automating it. Ambiguous prose is cheaper to correct than ambiguous code, and the act of writing forces the team to resolve decisions that had previously lived in habit.
A standard build document that holds up in practice contains:
- Scope, prerequisites and where each secret will come from at build time.
- Ordered steps with exact values, or references to the values file.
- The expected result after each major step and how to check it.
- Known variations by site or environment, named rather than described.
- Rollback notes for any step that is hard to undo.
- An owner, a last-reviewed date and the version tag it matches.
The test of the document is simple. Someone who did not write it follows it on a test machine and records every question they had to ask. Each question becomes an edit.
Automate provisioning once the build is stable
Automate provisioning after the definition is stable. New systems being identical by construction is usually worth more than the labor saved during installation. An automated build should set the expected versions and policy, verify its own outcome and be safe to run again.
Idempotence matters. Ansible's glossary calls an operation idempotent if performing it once gives exactly the same result as performing it repeatedly without any intervening actions. In practice the second run should confirm or converge on the intended state, not duplicate users, append the same line twice or restart services unnecessarily. Ansible deals with restarts through handlers, tasks that run only when another task notifies them and reports that it changed something, so a service restarts when its configuration file changes and not otherwise.
Choose tools by the layer you are managing and the skills you already have. HashiCorp describes Terraform as a way to build, change and version cloud and on-premises resources, with providers that let it work with virtually any platform or service that has an accessible API. Ansible describes itself as agentless, using SSH with existing operating-system credentials, with playbooks written in YAML that reads like documentation. In an estate that is mostly Windows, PowerShell Desired State Configuration and Group Policy exports may be all you need. Use one tool per layer and resist adding a second until the first is well used.
Automated enforcement comes next, selectively. Enforce settings that carry security, compliance or recovery weight: logging, account policy, encryption, endpoint protection, backup agents, required services and firewall boundaries. Aesthetic or low-consequence preferences can stay documented. Continuous enforcement has a maintenance cost, and a non-software organization should spend that cost where drift would create a real exposure.
In Desired State Configuration for Windows PowerShell, the Local Configuration Manager's ConfigurationMode setting makes this choice explicit with three values. ApplyOnly applies the configuration and then stops checking for drift. ApplyAndMonitor, the default, applies it and reports any later drift in logs. ApplyAndAutoCorrect reports the drift and then reapplies the configuration, on a cycle set by ConfigurationModeFrequencyMins, which defaults to 15 minutes. A sensible path is to run in monitor mode first, read what it reports for a few weeks, and switch to auto-correct only for a configuration small enough that every setting in it deserves enforcement.
Full pipeline automation and automated infrastructure testing are valuable for environments that change frequently. If infrastructure changes monthly rather than daily, a sophisticated pipeline can cost more to maintain than it returns. Outside software firms, the practices generally compare like this:
- Configuration in version control is low effort and high return.
- A written standard build and automated provisioning are generally high return.
- Drift enforcement is medium effort and should be selective.
- Ephemeral systems that are rebuilt rather than patched are higher effort with low-to-medium return.
- Full infrastructure CI/CD is high effort and usually low return unless deployment frequency supports it.
A practical repository and change path
Keep the repository unsurprising. Separate reusable roles or modules from environment-specific values. Keep a short README that explains prerequisites, ownership, how to validate a change, how to apply it and how to recover from a failed run. Pin important tool and module versions so that next year's run does not silently mean something different. Tag or release known production states.
A small repository might hold:
- A README covering prerequisites, owners, validation, application and recovery.
- Reusable definitions, such as the standard Windows server, in one folder.
- Values for each site and environment in another.
- Inventory exports and reports kept for comparison.
- The written standard build and the emergency-change procedure.
- Outcome tests that run after every build or change.
Name an owner and a deputy for each definition, and write both names in the README. Ownership means approving changes, reading drift reports, keeping the instructions accurate and scheduling the recovery drill. A definition with no owner decays at the same rate as an undocumented server.
Version pinning takes concrete forms. Terraform records the provider versions it selected, with checksums, in a dependency lock file named .terraform.lock.hcl, and HashiCorp recommends committing that file so dependency changes go through review. Terraform does not remember version selections for remote modules, so pin each one with an exact version constraint, and newer provider versions are considered only when someone runs terraform init with the -upgrade option. For tags, Git's annotated tags store the tagger's name, email address, date and a message, which makes them a good record of what was in production on a given day. Git does not push tags by default, so pushing them has to be an explicit step.
Keep secrets out of the repository
Never place passwords, API keys, private certificates or recovery material directly in the repository. The definition can refer to a secret by name or path, while a password manager, secrets vault or protected platform store supplies the value at execution time.
Check both current files and commit history when removing an exposed secret; deleting it in the latest revision does not remove it from history, and rotation is still required. GitHub's guidance puts revoking or rotating the secret first and says that, once it is rotated, rewriting history to remove it may not be warranted. A rewrite with a tool such as git-filter-repo has side effects: it changes the hashes of the affected commits, copies can survive in clones, forks, cached views and pull requests, and a collaborator who pulls and then pushes from an old clone can bring the data back.
Prevention is cheaper than cleanup. GitHub's push protection blocks pushes containing hardcoded credentials such as tokens before they reach the repository, and at the repository level it requires GitHub Secret Protection. By default, anyone with write access can bypass a block by giving a reason, and each bypass is added to the audit log and raises an alert, so somebody should read those records.
Secrets also leak through tool files and output. HashiCorp warns that secret values added to Terraform configuration end up in its state and plan files, and recommends treating state as sensitive, keeping it out of Git and storing it remotely where it can be encrypted at rest. The terraform plan reference adds that a saved plan file stores sensitive values in cleartext even when the terminal output obscures them. Ansible notes that diff output can reveal sensitive information and lets you switch it off for a task with diff: false.
Import existing systems carefully
For systems that already exist, do not assume a newly written definition describes reality. Compare desired state with observed state and review the proposed change before enforcement. Tools name this step differently, and the names are worth recognizing:
- Terraform calls it a plan, which previews changes without carrying them out.
- Ansible calls it check mode, a simulation that makes no changes on remote systems and can be combined with diff mode to show before-and-after comparisons.
- Azure Resource Manager calls it what-if, which predicts the changes a Bicep file would make without changing existing resources.
- AWS CloudFormation offers drift detection, which compares a stack's actual configuration with the expected configuration in its template.
Whatever the name, the result must be understandable to the person approving it. A plan that proposes replacing a live resource should stop the change until its consequence is understood. In Terraform's output, replacement is marked with -/+ and a note that the resource must be replaced. Its prevent_destroy lifecycle setting makes Terraform reject any plan that would destroy a protected resource, though HashiCorp notes that it does not prevent destruction if someone removes the resource's configuration.
Dry runs have limits that approvers should know. Ansible's documentation says modules that do not support check mode report nothing and do nothing, so a quiet check run is not proof that nothing would change. Microsoft warns that what-if results can include noise, such as properties reported as deleted that will not actually change. AWS notes that CloudFormation determines drift only for property values explicitly set in the template or its parameters, not for defaults. A definition can only detect drift in what it describes.
Some tools will draft a definition from what already exists. Terraform imports existing resources through an import block, and running terraform plan with the -generate-config-out option writes matching configuration for them, an option HashiCorp's plan reference still labels experimental. Its documentation asks you to review and edit the generated configuration before adding it to version control. Treat it as a first draft that records what is there today, including every accident.
Start narrow. Ansible's documentation shows check mode and diff mode restricted to a single host with the limit option, and the same discipline applies with any tool: compare one system, explain every difference reported, and only then widen the scope.
Small teams still need change review
Use pull requests or an equivalent review even with a small team. The reviewer checks operational effect, not formatting. Require a ticket or business reason in the change record. That history becomes unusually valuable six months later, when the original context is gone.
Before approving, the reviewer should be able to answer:
- Which systems will change, and in what order?
- Will a service restart or a system reboot, and when?
- Could any person or system lose access?
- Does the plan or dry-run output match the stated purpose, with nothing extra?
- What evidence will show success?
- How will the change be reversed if it fails?
In a one- or two-person IT function, the reviewer may come from outside. A technician from your IT provider can check technical effect while an office manager confirms the business reason and the timing.
The cultural rule that prevents failure
The rule that makes the model work is that normal changes are made to the definition, not directly to the system. If an administrator fixes production at 2am and never reconciles the definition, service has been restored but drift has returned. Repeat that often enough and the repository becomes fiction. A fictional source of truth can be worse than none because people plan recovery around it.
There must be an emergency path. Direct intervention is sometimes the correct decision when service is down, and AWS's drift detection documentation acknowledges that some changes outside a template are made intentionally to respond to time-sensitive operational events. Make the path explicit:
- Restore service directly when that is the fastest safe option.
- Record what changed, on which system, by whom and when, in the incident ticket.
- Create the follow-up before closing the incident.
- Within the agreed window, update the definition to match or deliberately revert the change.
- Run the definition again in plan, check or what-if mode and confirm no unexplained difference remains.
Agree the reconciliation window in advance, such as two working days, so it is a rule rather than a negotiation. The requirement is not that humans never touch systems. It is that urgent knowledge cannot disappear into them.
Common failure modes
A program can fail while every script runs correctly. Watch for these patterns:
- The team automates a bad or disputed build before agreeing on the standard. Automation then distributes inconsistency faster.
- The repository contains code but not ownership, operating instructions or review. When its author leaves, it becomes another undocumented system.
- Secrets are committed for convenience. Version control turns one exposed file into a durable credential incident.
- Production is changed by hand while the definition is updated only when someone remembers. Drift becomes normal again.
- Enforcement is too broad. A configuration agent repeatedly reverses a legitimate vendor or incident change, producing an outage loop.
- A successful tool run is treated as proof of a successful service. Configuration converged, but the application cannot authenticate, resolve DNS or serve a real transaction.
- Tooling becomes the project. Months go into selecting platforms while no standard build is written and no recovery time improves.
- Drift reports go unread. Differences are recorded in logs nobody opens, which is the same as not monitoring.
- A quiet dry run is mistaken for a clean one. Parts of the definition were never evaluated, so the silence proves nothing.
Most of these give an early signal. Track three numbers each month: emergency changes awaiting reconciliation, the age of the oldest unreviewed drift report and the date of the last successful rebuild from the definition. If any of them keeps growing, the program is decaying even while every run is green.
Operational checks that make it defensible
Test outcome, not merely execution. After a build, confirm expected services are listening, logging reaches its destination, monitoring checks in, backups complete, security agents report healthy, name resolution works and an application-level transaction succeeds. Run those tests after tool upgrades as well as after configuration changes.
These checks can be code too. On Windows, Test-NetConnection with the Port parameter reports TcpTestSucceeded when a TCP port answers. Pester, a testing and mocking framework for PowerShell, lets you write checks as It blocks grouped by Describe, with Should assertions, in files ending in .Tests.ps1, and run them with Invoke-Pester. A test file asserting that the file-share port answers, the backup service is running and the domain name resolves becomes part of the definition and runs after every change.
Measure drift deliberately. On a suitable cadence, compare the defined state with the observed estate and assign every difference one of three outcomes: correct the system, update the definition because reality reflects an approved decision, or document an accepted exception with an owner and review date. An unowned exception is simply drift with better grammar.
Much of the comparison can be scheduled. Running terraform plan with the -detailed-exitcode option returns 0 when there are no changes, 1 on an error and 2 when changes are present, which a scheduled job can turn into an alert. Microsoft's Policy Analyzer, part of the Security Compliance Toolkit, can capture a baseline of Group Policy settings and compare it with a snapshot taken later. For tenant settings, Microsoft's Tenant Configuration Management monitors check a baseline every six hours, a fixed interval that cannot be changed.
The tenant mechanics are worth understanding before you rely on them. A baseline lists resources and the property values each should have; Microsoft's example monitor checks an Exchange shared mailbox, an accepted domain and a mail contact. Each monitor run produces a monitoring result with a count of drifts, while the details sit in separate drift records marked active or fixed. The only documented monitor mode is monitorOnly, and Microsoft's overview says administrators resolve drift through the relevant admin centers or other methods, so a monitor reports problems rather than repairing them.
Two retention rules matter. Updating a monitor's baseline deletes all of that monitor's earlier results and detected drifts, and each fixed drift is deleted 30 days after it is resolved, so keep your own record of decisions in the repository. A tenant can have up to 30 monitors and check up to 800 configuration resources a day across all of them; in Microsoft's example, a baseline of 20 transport rules and 30 Conditional Access policies is 50 resources per run, or 200 a day at four runs.
Prove recovery and control access
Prove recovery. Build a fresh instance from the definition in an isolated environment, restore representative data, and record elapsed time and manual interventions. A backup test alone proves that data can be read. This exercise proves that the systems needed to use the data can be reconstructed. That distinction matters in ransomware recovery, where restoring four terabytes of files may be straightforward but rebuilding eleven servers and their undocumented interdependencies is where weeks disappear.
A recovery drill that produces useful evidence follows the same steps each time:
- Choose the system and the version tag of the definition to build from.
- Build on an isolated network that cannot reach production.
- Restore a representative sample of data from the real backup set.
- Run the outcome tests and record which ones fail.
- Time each phase and count every manual step.
- Turn each manual step into an edit to the definition or the build document.
CISA's guidance also recommends regularly testing the availability and integrity of backups in a disaster recovery scenario, and retaining backup hardware to rebuild systems if rebuilding the primary system is not preferred. A drill is a good moment to settle where a rebuilt system would actually run if the original host were unavailable, because that answer is rarely written down.
Review access to the repository, automation runner and secret store. Those systems can change an estate at scale and should have MFA, least-privilege roles, protected production branches, audit logs and a controlled route for administrative access. Infrastructure as code improves auditability only if the mechanism applying it is itself controlled. Keeping an offline copy of the definition, as CISA's guidance recommends for template files, also means a compromised repository host does not take the recipe for recovery with it.
A worked example for a small firm
Imagine a 30-person engineering consultancy with one office, two Windows Server virtual machines acting as domain controller and file server, a firewall, Microsoft 365 and a part-time IT contractor. Nothing is codified. The contractor knows the environment well, which is exactly the risk.
In the first week, the owner names the boundary: the baseline shared by both servers, with role-specific differences recorded as values. The tenant and the firewall wait. The contractor runs Get-WindowsFeature, Get-ScheduledTask, Get-NetFirewallRule against the active store and Get-GPOReport for every Group Policy Object. The inventory might turn up a scheduled task running a script from the folder of someone who left years ago, inbound firewall rules left behind by software that was uninstalled, and a GPO linked nowhere. None of those needs automation to fix; each needs a decision.
In the second week, the firm creates a private repository on a plan that supports branch protection, requires MFA for everyone with access and requires one approval before anything merges. The contractor commits the inventory, the GPO reports and the existing scripts after checking them for passwords. The office manager reviews each change for business reason and timing, and a technician from an outside provider reviews technical effect.
Over the following month, the contractor writes the standard build. A different technician follows it on a test virtual machine and logs a page of questions, and each one becomes an edit. The build is then expressed as a PowerShell DSC configuration and applied in ApplyAndMonitor mode. For several weeks the contractor reads the drift it reports. Some differences turn out to be approved changes and go into the definition; one turns out to be an unrecorded vendor change and is reverted.
Only then does the firm move to ApplyAndAutoCorrect. Because ConfigurationMode is a single Local Configuration Manager setting for the whole server, the enforced configuration is kept to the settings the inventory marked as security controls. Preferences stay in the written build, where a reviewer can still see them.
At the end of the quarter, the contractor runs the first recovery drill. A replacement file server is built on an isolated network from the tagged definition, a sample of shares is restored from backup, and the Pester tests run against it. The record shows elapsed time and every manual step, perhaps a backup-agent registration nobody wrote down and a share permission set by hand. Both go into the definition before the next drill.
The next quarter starts on the second boundary, the Microsoft 365 security settings. The contractor takes a tenant snapshot, reviews it the way the server inventory was reviewed, and creates a monitor from the parts the firm decides to keep, beginning with the Conditional Access policies. The snapshot itself goes into the repository, because the copy Microsoft holds is deleted after seven days.
Progress is measured by comparing drills, not by counting automated tasks. Fewer manual steps and a shorter, more predictable rebuild are the results that matter.
What to do this week
You do not need a tool decision to start. These steps fit into a normal week:
- Name the first boundary and the person who owns its definition.
- Ask for an inventory of that system, with each setting marked as a security control, dependency or preference.
- Create a private repository, require MFA for everyone with access and protect the main branch.
- Move existing scripts, exports and build notes into it after checking them for passwords and keys.
- Write down the emergency-change rule and the reconciliation window.
- Put a date in the calendar for the first recovery drill.
If an outside provider runs your systems, these questions show quickly where you stand:
- Where is the definition of our standard server, and when did it last change?
- Can you show me the plan or dry-run output for the most recent change?
- When did we last rebuild a system from its definition, and how long did it take?
- Who can change production systems, and do all of them use MFA?
- Has a password or key ever been committed to a repository, and was it rotated?
What good looks like after a year
A new engineer can build a standard server without asking the person who built the first one. A production change appears as a dated diff with an author and reason. Staging and production come from the same definition, with their legitimate differences expressed as data rather than memory. Disaster recovery is a rebuild plus a data restore, not an archaeology exercise. No single person is the only reliable account of how a system is configured.
That is also why this is a security control. A defined environment can answer which systems carry a required setting with evidence, rather than by sampling and hoping. It supports consistent controls and gives an auditor something stronger than an assertion. It makes recovery repeatable and limits the knowledge an attacker, an accident or a departing employee can take away.
None of this requires becoming a software company. It requires treating configuration as an organizational asset: written somewhere other than the system it describes, reviewed when it changes, tested against reality and maintained in proportion to the risk it controls.
Where ALCO can help
ALCO's backup and disaster recovery service restores real files and systems on a schedule, times the restores and records what worked, and writes down and rehearses a recovery runbook. Its IT consulting and vCIO service produces a current-state picture of every system, contract, dependency and expiry date and tracks single points of failure and key-person dependencies. Other listed services include managed hosting, development with workflow automation, Microsoft 365 management covering Entra ID and Intune, and managed networking. The ALCO help desk is staffed 24 hours a day, including holidays, and calls are answered by a person.
Sources
- StopRansomware Guide on ransomware preparation and recovery, CISA - cisa.gov/stopransomware/ransomware-guide
- Glossary entry for baseline configuration, NIST Computer Security Resource Center - csrc.nist.gov/…
- Configuring the Local Configuration Manager in DSC, Microsoft Learn - learn.microsoft.com/…
- Use the Tenant Configuration Management APIs in Microsoft Graph, Microsoft Learn - learn.microsoft.com/…
- Reference for the terraform plan command, HashiCorp Developer - developer.hashicorp.com/…
- Validating tasks with check mode and diff mode, Ansible Documentation - docs.ansible.com/…
- Removing sensitive data from a repository, GitHub Docs - docs.github.com/…
- About protected branches, GitHub Docs - docs.github.com/…