How does a policy enforcer establish that it loaded the intended ruleset and not a substituted one?
answer
- integrity and identity are different claims
- hash the whole set, not each file
- deletion is the attack you must catch
- expected value needs a separate write path
- mismatch means no policy, never pass
basics
~20 sBy computing a digest over the whole rule set it loaded and comparing it against an expected value obtained through a different path than the ruleset itself. A mismatch must fail the run loudly, and the digest should be stamped on every result.
solid answer
~50 sThere are two separate claims: integrity — the content I loaded is intact and came from a publisher I trust — and identity — it is the specific ruleset I meant to run. Integrity comes from a digest computed over the complete set at load time, plus, where you have one, a signature from the publishing identity. Identity comes from comparing that digest to an expected value the enforcer was configured with, and the critical detail is that the expected value must arrive by a different write path than the bundle. If both come from the same store, whoever can replace one can replace the other and the check proves nothing. A mismatch means `I have no policy`: the run is reported as failed, never as a pass. Finally, stamp the digest on every result so the check is auditable after the fact and not only before.
go deeper
Know that an enforcer downloads its rules from somewhere, and that it should hash what it downloaded and compare against a value it was told to expect.
Explain the mechanics: a digest over the complete set catches deletion, the expected value must arrive by an independent path, and a mismatch fails the run rather than warning.
Show how you would wire this in practice — which credential holds the expectation, what alerts fire on mismatch, and how the loaded digest is emitted with results for later reconciliation.
Argue for where the trust anchor lives across the estate: how many independent write paths an attacker must own to change what is enforced, and what that costs teams in day-to-day rule delivery.
## Two claims, often conflated A decision point that fetches its rules from somewhere is making two different assertions when it starts evaluating, and interviews reward candidates who separate them. **Integrity**: what I loaded is exactly what was published, byte for byte, and it came from a party I am willing to take rules from. This is what a digest and a publisher signature give you. **Identity**: what I loaded is the *particular* ruleset I was supposed to be running — not an older one, not a valid-but-different one someone else published. A signature alone does not give you this: a correctly signed ruleset from an authorised publisher can still be the wrong ruleset, or an authorised publisher's credential in the wrong hands. ## Digest the set, not the files Compute the digest over the complete ruleset as a unit — all rule text, any data it depends on, and its metadata — rather than verifying each file independently. The reason is deletion. Per-file verification proves that the files present are intact; it says nothing about the file that is no longer there. Removing the encryption-at-rest rule is the cheapest way to disable it, and it leaves every remaining file verifying perfectly. A single digest over the whole set changes the moment a rule disappears, so *the rule is gone* becomes as detectable as *the rule was edited*. ## Where the expected value comes from This is the part candidates most often get wrong. Verification is only as good as the independence of the expected value. If the enforcer fetches the ruleset and its expected digest from the same location, using the same credential, an attacker with write access to that location controls both sides of the comparison and the check becomes decoration. The expected value should ride in on the enforcer's own configuration path — its deployment manifest, its configuration management, something governed by a different credential and a different review than the rule distribution point. You then have two write paths that both must be compromised rather than one. Where a pinned digest is impractical, the weaker but still useful form is an expected *publisher identity*: the enforcer refuses content not vouched for by that identity, which narrows the attack from `anyone who can write to the store` to `whoever holds the publishing credential`. ## What to do on a mismatch An integrity or identity failure means the enforcer does not know what rules it has. The one outcome that must never happen is reporting the run as a pass. For a periodic detective sweep, that means marking the run failed and alerting, not emitting `0 violations`. Whether the engine additionally keeps serving the last ruleset it verified, refuses to serve decisions at all, or exits is engine-specific behaviour and a separate design question; the invariant here is that an unverifiable ruleset never produces green output. The same logic applies to a fetch that fails entirely. `Could not verify` and `could not download` are both `no assurance`, and neither is `allow`. ## Record what you loaded Verification before the run is half the value. The other half is emitting the digest with every result the enforcer produces, so that later — during an incident, or when someone asks what was enforced last Tuesday — the question is answered by a recorded fact instead of an inference from deployment history. This turns a one-time check into a durable, comparable trail, and it is what makes out-of-band reconciliation possible at all. ## The limits of a matching digest A digest match proves you loaded exactly what you asked for. It proves nothing about whether those rules are correct, whether they cover the controls you claim to enforce, or whether the expected value you pinned was ever the right one. A verified digest of an empty ruleset verifies flawlessly. Integrity and correctness are independent problems, and conflating them — `it verified, so we are covered` — is the reasoning error this whole area exists to prevent.
- Why hash the whole ruleset rather than verify each rule file individually?Because the cheapest attack is deletion. Per-file verification proves the files that are present are intact and says nothing about one that was removed, so dropping the encryption rule leaves every check green. A digest over the complete set changes when anything is added, edited or removed.
- Where should the expected digest come from?A write path independent of the distribution point — the enforcer's own deployment configuration, governed by a different credential and review. If the expectation is fetched from the same store as the ruleset, whoever can replace the bundle can replace the expectation, and the comparison proves nothing at all.
- Is a matching digest enough to trust the ruleset?No. It establishes that you loaded exactly what you pinned — nothing about whether those rules are correct, current, or cover the controls you claim. A verified digest of an empty ruleset verifies perfectly. Integrity and correctness need separate evidence.
- What should a sweep report when the ruleset fails verification?A failed run, with an alert. Never zero violations. The enforcer does not know what rules it holds, so it has no basis for any compliance statement; emitting green in that state converts a detected tampering event into positive evidence of health.
saying these in an interview costs you the question
- Treats a failed integrity check as a warning and carries on
- Fetches the expected digest from the same store as the ruleset
- Verifies each rule file but never the set as a whole
- Thinks a matching digest proves the rules are correct
- Confuses a valid publisher signature with the right ruleset