Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

HAProxy assessment: deliver and operate two services

  • 150 min

By updated

Improve this page

This assessment closes the HAProxy module: you take over an HAProxy that has no mission, you publish two services through it over HTTPS, protected and observed, you prove that you can lose everything and recover it, then you repair a second instance that is failing without knowing what broke. It is meant for someone who has followed the module, from Install HAProxy to Test the availability of the HAProxy entry point, and it draws on their skills without recalling any of them. Allow two and a half hours, in one sitting.

The bench runs on Debian 13 with HAProxy 3.4.7, from the 3.4 LTS branch, installed from trixie-backports-3.4 as in the lessons. Certificates come from a local test ACME authority, Pebble, through a supplied ACME client. Everything you write is your own: the acceptance sheet says what must happen, never which directive achieves it.

What you will learn

The assessment teaches no new skill. It teaches you to put together on your own the skills of the module on a need you discover, and to diagnose a configuration you did not write. You will be able to:

  • Publish two names over HTTPS, one certificate per name, renewed without a restart
  • Defend an entry point: administration, source address, rate, isolation
  • Observe a proxy through its metrics, refusals and failures included
  • Diagnose an unknown failure and repair it without weakening the service
  • Prove a recovery with a restore, a reload and a reboot

The need

You take over the entry point of a small platform on edge.lab: two services run there, a catalogue and a notifications service, and nobody has published them properly. They listen on ports 18301 and 18302, started in a hurry. HAProxy is installed but has no listener, no certificate and no route. Nobody has ever tried to lose this entry point and recover it either.

On the same machine, a second HAProxy instance named archives has been serving an application for a while, on port 8088, with its own configuration, its own unit and its own socket. It used to work, then something broke, and nobody says what.

You work from edge.lab on the operator side, and from poste.lab, the independent client, for everything a visitor sees. Two files describe the bench: /home/student/README-epreuve and /opt/pub-epreuve-haproxy/recette.txt, on edge.lab. Read them in full before you start.

The constraints

Each requirement is proven by an observable state, from the client, never by a configuration that looks right. haproxy -c says that a file loads, not that the service holds. The assessment has two independent parts, and the table sums up what the first one requires.

#RequirementWhat will be observed
1Both services are publishedeach name over strictly validated HTTPS with its own certificate, an unknown name refused, HTTP redirected
2The renewal worksboth certificates renewed and put into service without restarting HAProxy, including after a reboot of the machine
3The entry point resistsadministration closed without an identity, source address set by the proxy, an over-talkative client slowed down then released, backends and metrics unreachable from the network
4The proxy is observablea long event stream that arrives whole, metrics that follow traffic, refusals and a stopped service
5The recovery is provenconfiguration and business data restored from backups, a reload without interruption, then everything coming back on its own after a reboot

The second part is about the archives instance: its failure is drawn at random from five families, and you repair it without removing anything that protects it.

Two bench rules avoid a bad surprise. The test authority issues certificates valid for five minutes: the validation therefore runs your renewal script whenever it needs a fresh certificate, throughout the assessment. And it draws a new root and forgets its accounts at every boot: the validation reads the root again before each check, and erases the local account of the ACME client after the reboot before replaying the cycle.

What you must deliver

The validation calls two scripts at fixed locations and creates by itself the situations they must handle. It cannot guess the mechanism you choose, it measures its effect. Both run on edge.lab, and you write them as you see fit.

DeliverableWhat it must do
/opt/pub-epreuve-haproxy/renouvelerrenew the certificates of both names and put them into service without restarting HAProxy
/var/backups/pub-epreuve-haproxy/haproxy.cfg.bakthe backup of your HAProxy configuration
/opt/pub-epreuve-haproxy/restaurerbring back the catalogue's business data and the HAProxy configuration from the backups, then restart HAProxy, without touching the certificates or the backups

The diagnosis of the second part is written to /home/student/incident.yaml, on edge.lab, with three fields, famille, composant and explication. The family takes one of five values, routage, sonde, confiance, limite or delai, and the component names the real cause, backed by what you observed. Naming every family "just in case" is not a diagnosis: the hypotheses you ruled out belong in the explanation.

How to assess yourself

Twenty checks of five points compare the real state of the machines with what the acceptance sheet requires, played mostly from poste.lab under strict TLS verification. A machine cannot judge a line of reasoning: the explication field is read by a reviewer, who also reads your configuration and your scripts and asks you to justify your choices. The check only verifies that this field is present.

What the check measures, area by area:

  • publication and protocols, 20 points: the certificate cycle, HTTPS per name, the unknown name and the redirect, and a broken certificate pushed at runtime, which must be refused without losing the one in service;
  • security and trust, 25 points: the isolation of backends and metrics, administration, the source address, rate limiting and the protection of private keys;
  • observability and streams, 20 points: the long stream, metrics that follow traffic, a stopped service read in the metrics, and refusals counted;
  • diagnosis, 20 points: the family and the component, the archives service repaired, then trust, probes, the limit and the wait bound still in place;
  • recovery and rollback, 15 points: the full restore, a reload that does not interrupt the service, and the reboot, after which the acceptance test is replayed.

A failed requirement does not call for a ready-made solution, because no answer key appears in the lessons. Go back to the lesson that teaches the missing skill, then start again from a clean state.

Hands-on: take the assessment

The assessment runs in the lab, between edge.lab and poste.lab. It takes about 150 minutes and gives no hint during the session. The last check reboots edge.lab: run the validation when everything is in place, and start the assessment when you have time to finish it in one go.

Key takeaways

An end-of-module assessment proves a state and a line of reasoning, not a configuration.

  • A published service is proven from an independent client, with TLS verification intact.
  • A renewal only counts if it puts the new certificate into service without restarting the proxy.
  • A protection is proven by its refusals, against a client that challenges it.
  • A repair removes no verification, no probe, no limit and no bound.
  • A recovery only counts once tested: restore, reload, then reboot.