feat: complete lab 7 grade 3 security controls

This commit is contained in:
Dmitrii Grishko
2026-11-14 20:08:27 +03:00
parent 8986ba6bef
commit c5e3ac3aff
49 changed files with 1670 additions and 149 deletions
+27
View File
@@ -36,6 +36,33 @@ make_ca untrusted-ca
chmod 644 "$dir/lab7-ca.crt"
make_leaf ingress lab7-ca serverAuth DNS:localhost,IP:127.0.0.1
make_leaf api lab7-ca serverAuth DNS:api
for service in db redis s3 broker; do
san="DNS:$service"
if [ "$service" = s3 ]; then san="$san,DNS:localhost,IP:127.0.0.1"; fi
make_leaf "$service" lab7-ca serverAuth "$san"
done
for service in otel-collector loki tempo prometheus grafana; do
san="DNS:$service"
if [ "$service" = grafana ]; then san="$san,DNS:localhost,IP:127.0.0.1"; fi
make_leaf "$service" lab7-ca serverAuth "$san"
done
make_ca telemetry-read-ca
make_ca telemetry-export-ca
chmod 644 "$dir/telemetry-read-ca.crt" "$dir/telemetry-export-ca.crt"
make_leaf grafana-reader telemetry-read-ca clientAuth URI:urn:lab7:grafana
make_leaf collector-exporter telemetry-export-ca clientAuth URI:urn:lab7:collector
make_leaf prometheus-scraper telemetry-export-ca clientAuth URI:urn:lab7:prometheus
cat "$dir/telemetry-read-ca.crt" "$dir/telemetry-export-ca.crt" > "$dir/loki-client-ca.crt"
chmod 644 "$dir/loki-client-ca.crt"
make_ca telemetry-ingest-ca
chmod 644 "$dir/telemetry-ingest-ca.crt"
for role in api worker dispatcher; do
make_leaf "otel-$role" telemetry-ingest-ca clientAuth "URI:urn:lab7:otel:$role"
done
make_leaf openbao lab7-ca serverAuth DNS:openbao,DNS:localhost,IP:127.0.0.1
for role in api worker dispatcher cleanup; do
make_leaf "bao-$role" lab7-ca clientAuth "URI:urn:lab7:bao:$role"
done
make_leaf lb lab7-ca clientAuth URI:urn:lab7:load-balancer
make_leaf wrong-role lab7-ca clientAuth URI:urn:lab7:probe
make_leaf wrong-ca untrusted-ca clientAuth URI:urn:lab7:load-balancer