ЛР 7 — БВТ2301 — Курлова — на 4
Перенесён минимум lab6 (API без изменений), добавлена защита на границах доверия: - внешний HTTPS; обязательный mTLS LB -> API с allowlist identity и отзывом по serial; - TLS на всех связях: PostgreSQL verify-full, MinIO HTTPS, RabbitMQ AMQPS mTLS (EXTERNAL), Valkey TLS + ACL, Collector и хранилища телеметрии через mTLS с отдельными CA; - OpenBao в server mode: cert auth, токены 15 мин, политики только на свой путь; - роли БД, S3-политики и права брокера по принципу минимальных прав; - Argon2id с замером, rehash, общий лимит входа, бюджет защиты от login DoS; - hardening всех контейнеров, scan образов с разбором, модель угроз, матрица доверия; - отрицательные тесты: TLS-аудит (135 проверок), ACL, ротации, sealed OpenBao.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"vhosts": [{"name": "messenger"}],
|
||||
"users": [
|
||||
{"name": "api.client.messenger", "password_hash": "", "hashing_algorithm": "rabbit_password_hashing_sha256", "tags": []},
|
||||
{"name": "worker.client.messenger", "password_hash": "", "hashing_algorithm": "rabbit_password_hashing_sha256", "tags": []}
|
||||
],
|
||||
"permissions": [
|
||||
{"user": "api.client.messenger", "vhost": "messenger", "configure": "^$", "write": "^attachments$", "read": "^$"},
|
||||
{"user": "worker.client.messenger", "vhost": "messenger", "configure": "^$", "write": "^$", "read": "^attachments\\.process$"}
|
||||
],
|
||||
"exchanges": [
|
||||
{"name": "attachments", "vhost": "messenger", "type": "direct", "durable": true, "auto_delete": false, "internal": false, "arguments": {}},
|
||||
{"name": "attachments.dlx", "vhost": "messenger", "type": "fanout", "durable": true, "auto_delete": false, "internal": false, "arguments": {}}
|
||||
],
|
||||
"queues": [
|
||||
{"name": "attachments.process", "vhost": "messenger", "durable": true, "auto_delete": false,
|
||||
"arguments": {"x-queue-type": "quorum", "x-dead-letter-exchange": "attachments.dlx", "x-delivery-limit": 20}},
|
||||
{"name": "attachments.dlq", "vhost": "messenger", "durable": true, "auto_delete": false,
|
||||
"arguments": {"x-queue-type": "quorum"}}
|
||||
],
|
||||
"bindings": [
|
||||
{"source": "attachments", "vhost": "messenger", "destination": "attachments.process", "destination_type": "queue", "routing_key": "attachment.process.v1", "arguments": {}},
|
||||
{"source": "attachments.dlx", "vhost": "messenger", "destination": "attachments.dlq", "destination_type": "queue", "routing_key": "", "arguments": {}}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[rabbitmq_auth_mechanism_ssl].
|
||||
@@ -0,0 +1,25 @@
|
||||
# RabbitMQ 4.0 (lab7): TLS-only AMQP with mandatory client certificates. Identity = certificate CN, mapped to a
|
||||
# passwordless user from definitions.json (auth mechanism EXTERNAL). No password users, no guest, no management UI.
|
||||
listeners.tcp = none
|
||||
listeners.ssl.default = 5671
|
||||
ssl_options.cacertfile = /run/secrets/ca.crt
|
||||
ssl_options.certfile = /run/secrets/server.crt
|
||||
ssl_options.keyfile = /run/secrets/server.key
|
||||
ssl_options.verify = verify_peer
|
||||
ssl_options.fail_if_no_peer_cert = true
|
||||
ssl_options.versions.1 = tlsv1.3
|
||||
ssl_options.versions.2 = tlsv1.2
|
||||
auth_mechanisms.1 = EXTERNAL
|
||||
ssl_cert_login_from = common_name
|
||||
# Users, permissions, vhost and topology come from the definitions file on every boot.
|
||||
definitions.import_backend = local_filesystem
|
||||
definitions.local.path = /etc/rabbitmq/definitions.json
|
||||
definitions.skip_if_unchanged = true
|
||||
loopback_users = none
|
||||
consumer_timeout = 600000
|
||||
disk_free_limit.absolute = 200MB
|
||||
vm_memory_high_watermark.relative = 0.6
|
||||
log.console.level = warning
|
||||
# Erlang distribution (CLI tools, clustering) is loopback-only: no cluster here, and rabbitmqctl runs inside the
|
||||
# container. Otherwise ports 25672/4369 would be a cookie-protected plaintext channel reachable from the network.
|
||||
distribution.listener.interface = 127.0.0.1
|
||||
Reference in New Issue
Block a user