forked from mtusi2026/mtusi2026lab7
Закрыть оценку 4 и трек 1: отзыв leaf и права worker.
Брокер и Collector принимают только серийный номер текущего leaf. Прогон показывает rehash, 429 до дорогого Argon2, отказ stranger, ротацию пароля worker и сохранность задания.
This commit is contained in:
+13
-1
@@ -2,7 +2,19 @@
|
||||
set -eu
|
||||
apk add --no-cache openssl >/dev/null
|
||||
cd /work
|
||||
|
||||
serial_of() {
|
||||
openssl x509 -in "$1" -noout -serial | awk -F= '{print tolower($2)}'
|
||||
}
|
||||
|
||||
write_allows() {
|
||||
openssl x509 -in lb-client.crt -outform DER | openssl dgst -sha256 -r | awk '{print $1}' > allowed-lb.sha256
|
||||
serial_of api-client.crt > allowed-api.serial
|
||||
serial_of worker-client.crt > allowed-worker.serial
|
||||
}
|
||||
|
||||
if [ -f ca.crt ] && [ -f allowed-lb.sha256 ] && [ -f lb.pem ]; then
|
||||
write_allows
|
||||
echo "certificates already present"
|
||||
exit 0
|
||||
fi
|
||||
@@ -70,7 +82,7 @@ openssl x509 -req -in /tmp/other-client.csr -CA other-ca.crt -CAkey other-ca.key
|
||||
-out other-client.crt -days 7 -extfile /tmp/other-client.cnf >/dev/null 2>&1
|
||||
cat other-client.crt other-client.key > other-client.pem
|
||||
|
||||
openssl x509 -in lb-client.crt -outform DER | openssl dgst -sha256 -r | awk '{print $1}' > allowed-lb.sha256
|
||||
write_allows
|
||||
find . -name '*.key' -exec chmod 644 {} \;
|
||||
find . -name '*.pem' -exec chmod 644 {} \;
|
||||
echo "certificates created"
|
||||
|
||||
Reference in New Issue
Block a user