Pack de contenus (8 labs, séquence 08 complète)
This commit is contained in:
parent
138235bd76
commit
5c396d5a94
13 changed files with 805 additions and 0 deletions
56
paillasse-contenus/06-chiffrement-https/lab.yaml
Normal file
56
paillasse-contenus/06-chiffrement-https/lab.yaml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
id: 06-chiffrement-https
|
||||
titre: Chiffrement et HTTPS
|
||||
niveau: intermediaire
|
||||
duree_min: 50
|
||||
formations: [nsi-tle, bts-sio, bts-ciel-ir, but-rt, ais]
|
||||
competences: [chiffrement-asymetrique, certificats, tls]
|
||||
|
||||
reseaux:
|
||||
- nom: lan
|
||||
cidr: 10.60.0.0/24
|
||||
|
||||
machines:
|
||||
- nom: serveur
|
||||
image: paillasse-debian
|
||||
flavor: eleve.petit
|
||||
reseaux: [lan]
|
||||
|
||||
consignes:
|
||||
- "Génère une clé privée RSA 2048 bits et un certificat auto-signé pour le nom labo.paillasse.local, valable 30 jours, dans /etc/ssl/labo/."
|
||||
- "Configure nginx pour servir sa page en HTTPS sur le port 443 avec ce certificat."
|
||||
- "Redirige HTTP (port 80) vers HTTPS."
|
||||
- "Protège la clé privée : seul root doit pouvoir la lire."
|
||||
|
||||
verifications:
|
||||
- id: certificat
|
||||
titre: Certificat au bon nom
|
||||
machine: serveur
|
||||
commande: "openssl x509 -in /etc/ssl/labo/labo.crt -noout -subject | grep -q 'labo.paillasse.local'"
|
||||
attendu: { code_retour: 0 }
|
||||
points: 2
|
||||
message_echec: "Le certificat /etc/ssl/labo/labo.crt est absent ou n'a pas le bon nom."
|
||||
- id: https
|
||||
titre: HTTPS répond
|
||||
machine: serveur
|
||||
commande: "curl -sk --max-time 3 -o /dev/null -w '%{http_code}' https://localhost/ | grep -q 200"
|
||||
attendu: { code_retour: 0 }
|
||||
points: 3
|
||||
message_echec: "nginx ne répond pas en HTTPS sur le port 443."
|
||||
- id: redirection
|
||||
titre: HTTP redirige vers HTTPS
|
||||
machine: serveur
|
||||
commande: "curl -s --max-time 3 -o /dev/null -w '%{http_code}' http://localhost/ | grep -Eq '301|302|308'"
|
||||
attendu: { code_retour: 0 }
|
||||
points: 1
|
||||
message_echec: "Le port 80 ne redirige pas vers HTTPS."
|
||||
- id: cle
|
||||
titre: Clé privée protégée
|
||||
machine: serveur
|
||||
commande: "test \"$(stat -c %a /etc/ssl/labo/labo.key)\" = 600"
|
||||
attendu: { code_retour: 0 }
|
||||
points: 1
|
||||
message_echec: "La clé privée doit avoir les droits 600."
|
||||
|
||||
indices:
|
||||
- "openssl req -x509 -newkey rsa:2048 -nodes -days 30 -subj '/CN=labo.paillasse.local' …"
|
||||
- "Dans nginx : listen 443 ssl; ssl_certificate …; ssl_certificate_key …;"
|
||||
Loading…
Add table
Add a link
Reference in a new issue