Deploying

Golden images and VDI clones

Bake DPLens into an image safely — what to include, and what every clone discards.

DPLens can be installed into a golden image.

Every clone notices at its first start that the working state was created on a different machine, and discards that state before anything can be replayed or delivered from it. Without that, every clone would inherit the image's collection positions and its queued events, and would deliver another machine's data under its own name.

The mechanism is the machine identifier that sysprep /generalize regenerates: it is recorded when DPLens is installed, and compared at every start.

What to put in the image

Install with the configuration and, if wanted, the console:

msiexec /i dplens-1.0.912.msi /qn CONFIG_FILE=C:\build\agent.yaml            # or a dp-deploy transform: TRANSFORMS=dplens.mst

Do not bake into the image:

Then run sysprep /generalize /oobe /shutdown as usual. Stop the dplens service first if you want the image's own checkpoints not to grow; it does not matter for correctness, they are discarded on the clone.

What the clone does at first start

The service reads state\schema.json, sees a machine GUID that differs from its own, and:

  1. deletes state\checkpoints (so no event the image already delivered is replayed from the clone), state\cache (the image's undelivered spool), state\fim (the image's file-integrity baselines — the clone re-baselines its own files) and state\metrics (the image's counters), and the persisted state\agent-id (a clone must not report as the image; a fresh id is generated);
  2. keeps the config, the licence key file, the secret store, the console credential, the audit log and the service identity;
  3. writes an audit record naming the old and new identifier and, for each set it deleted, how many files and bytes went — so the reset is fully accounted for rather than silent;
  4. records its own identifier and starts normally.

A normal restart on the same machine touches nothing.

A state folder written by a version of DPLens that predates clone detection carries no identifier. The first start adopts the machine's own and discards nothing, so an upgrade keeps live collection positions. Detection depends on that identifier being readable; where it cannot be read, DPLens records the fact and surfaces it in the console.

Verifying a clone

On a freshly cloned machine:

Get-Service dplens
Get-Content C:\ProgramData\DPLens\state\audit\audit.jsonl | Select-String state-reset-clone

The audit record is the proof that the reset happened, and lists exactly what was discarded. Settings and audit → Security also shows the machine identity as having been reset.

Limits