Why doesn't HTTPS to a package mirror prove the packages that mirror serves are untampered?
answer
- channel integrity versus artifact integrity
- the mirror is an endpoint, not a middle
- TLS terminates there and starts again
- publisher signs, consumer verifies
- trust anchor must not come from the mirror
basics
~20 sTLS protects the channel to an endpoint; the mirror is the endpoint. It authenticates who you are talking to and stops tampering in transit, but it cannot say whether the files that endpoint holds are the ones the publisher produced.
solid answer
~40 sTransport security and artifact integrity answer different questions. TLS tells you that you reached the host you named and that nothing changed the bytes on the wire - and a compromised mirror satisfies both, because it is the legitimate host and it hands you exactly the bytes it means to. Integrity has to be end-to-end: the publisher signs the package and the client verifies that signature against a key obtained independently of the mirror, reducing the mirror to a carrier of bytes it cannot alter undetected. This matters most where a mirror is trusted because it is close - an update mirror on a factory network serving line-side devices that are configured to trust it. An attacker with a position on that network needs no certificate trickery, only write access to the mirror.
go deeper
Remember the one-line distinction: HTTPS protects the road, not the goods. The mirror is the shop you are buying from, so its own honesty is a separate question.
Explain that TLS terminates at the mirror, which makes it an endpoint rather than an interceptor, and that the countermeasure is a publisher signature the client verifies against an independently held key.
Bring the deployment traps: clients that warn rather than fail on an unverified package, mirrors permitted to re-sign, and trust anchors provisioned from the mirror itself. Add monitoring for devices that stop receiving updates.
Own the standard: which distribution paths in the estate are allowed to exist, whether every one of them ends in consumer-side verification, and what you accept for legacy devices that cannot verify at all.
## Two different guarantees It is worth stating both precisely, because conflating them is the classic error in this area. **Transport security (TLS)** gives you: the endpoint presented a certificate for the name you asked for and proved possession of the corresponding private key; and the bytes exchanged with that endpoint were not read or modified by anyone in between. Its scope begins at your process and ends at the server socket. **Artifact integrity (a publisher signature over the package, verified by the consumer)** gives you: these exact bytes were produced by the holder of a key you already decided to trust, wherever they travelled and however many hands they passed through. Its scope begins at the publisher and ends at the consumer. A mirror sits *inside* the first scope and *outside* the second. That is the whole answer: TLS terminates at the mirror, so the mirror is not a man in the middle - it is one of the two ends. Everything it serves is served over a genuine, valid connection. ## The trusted-because-it-is-local mirror Consider an internal update mirror on a factory network, serving operating-system packages to the controllers and line-side devices that run a physical process. The devices are configured to fetch from it - often *only* from it, because the plant has no general internet egress. The mirror was set up for availability and bandwidth, and it inherited trust from the fact that it is on the local network behind the plant firewall. Now give an attacker a position on that network, or on the mirror host itself: a contractor's laptop, an unpatched jump host, a technician with legitimate access to the mirror's storage. They do not need to defeat TLS, forge a certificate or intercept anything. They replace a package on the mirror. Every device that updates from it installs the modified package during the next maintenance window. The assets here are not customer records. They are the **safety and availability of a physical process**: a controller that behaves differently under load, an interlock that responds late, a line that stops during a shift. This is worth naming because a defender who only ever pictures data theft under-rates the mirror as a target. ## What actually holds The defence is that the client verifies a signature made by the publisher, using a trust anchor it did not receive from the mirror. Three consequences follow, and each is a place real deployments go wrong: 1. **The trust anchor must not come from the mirror.** If devices are provisioned to trust a key that the mirror serves, or if the mirror is allowed to re-sign packages with its own key, the end-to-end property is gone and you are back to trusting the mirror. Re-signing at the mirror is convenient and it is exactly what removes the guarantee. 2. **Verification must actually be enforced.** A client configured to accept unsigned packages, or to warn and continue, gains nothing from the fact that signatures exist upstream. Signing that is never verified changes nothing. 3. **A signature answers authorship, not everything.** It says the publisher produced these bytes. It does not say the package is free of vulnerabilities, and it does not by itself make the mirror an honest narrator of what exists - a mirror still decides which packages a device is ever offered, so a plant that stops seeing updates at all deserves an alert as much as one that sees a bad one. ## Where the same reasoning applies The pattern generalises to any intermediary in the distribution path that terminates the connection and holds a copy: a caching edge in front of a download site, a shared internal artifact host, a vendor's regional distribution point. In each case the intermediary is a *legitimate endpoint*, which is why channel security cannot see its dishonesty, and in each case the countermeasure is the same shape - integrity that is created by the publisher, carried with the artifact, and checked by the consumer. ## How to answer this in an interview Say the two guarantees, in one sentence each. Say that the mirror is an endpoint rather than a man in the middle, which is why TLS is satisfied. Then give the countermeasure end-to-end, and add the trap: if the mirror re-signs, or if clients are configured to trust keys the mirror provides, you have moved the trust rather than removed it. Finishing with a concrete setting - devices on a plant network that trust a local host by configuration - shows you understand that the attacker position, not the protocol, is what makes this real.
- The mirror re-signs everything it serves with its own key, and clients trust that key. What have you gained?Convenience, and a relocation of trust rather than a reduction of it. Clients now verify that the mirror produced the bytes, which a compromised mirror can do perfectly. The end-to-end property only exists when the key being verified belongs to the publisher and the mirror cannot use it.
- Devices on the plant network cannot reach the internet at all. Does that isolation solve the problem?No - it concentrates it. Isolation removes remote attackers but makes the local mirror the single source those devices must trust, so anyone with a position on that network or on the mirror host inherits full control of what gets installed. Isolation is a reason to verify signatures on-device, not a substitute for it.
- Where else does this same reasoning apply outside package mirrors?Any intermediary that terminates the connection and holds a copy: a caching edge in front of a download site, a shared internal artifact host, a vendor regional distribution point. Each is a legitimate endpoint, so channel security cannot detect its dishonesty, and each needs integrity applied by the publisher and checked by the consumer.
A sealed armoured van proves nothing about the warehouse that loaded it. You want a tamper-evident seal applied by the manufacturer and checked by the recipient.
saying these in an interview costs you the question
- Says TLS makes the download tamper-proof
- Calls a compromised mirror a man-in-the-middle attack
- Accepts the mirror re-signing packages as equivalent
- Treats network isolation as integrity assurance
- Assumes signatures exist means signatures are verified