Answer key - fault injection (НЕ ОТКРЫВАТЬ во время challenge)

Правила examiner mode

Incident 1 - nginx syntax regression

Injection: внести controlled syntax error в отдельный nginx config на APP01, не reload до начала ticket либо выполнить reload так, чтобы old worker/config behaviour был понятен.

Symptom to user: «После изменения web-конфига новый reload не проходит / сервис не принимает новую конфигурацию».

Expected path: nginx -t → config location → minimal fix → nginx -t → reload → curl.

Root cause: syntax/config validation failure.

Incident 2 - one backend stopped

Injection:

podman stop backend2

Symptom: «HTTPS открывается, но поведение backend/load balancing изменилось; часть ожидаемых backend-ответов исчезла».

Expected: proxy logs/config → direct upstream tests → DATA01 podman ps → start/recreate backend → end-to-end curl.

Incident 3 - wrong upstream port

Injection: изменить один nginx upstream 8082 на unused port, validation остаётся синтаксически корректной.

Symptom: «Nginx active, TLS работает, но часть запросов получает backend error/502».

Expected: nginx logs → upstream config → nc/curl direct → correct port → reload.

Incident 4 - DATA01 firewall blocks backend

Injection: удалить/ограничить firewalld rule, который разрешает APP01 доступ к 8081/8082.

Symptom: «Backend container отвечает локально на DATA01, но APP01 не может подключиться».

Expected: localhost curl → ss/podman → route → remote nc → firewalld zone/rules → restore narrow rule.

Incident 5 - SELinux denies content/backend operation

Injection: создать controlled wrong context на отдельном test content path или убрать необходимый persistent label/boolean в заранее подготовленном scenario.

Symptom: «Unix owner/mode выглядят правильно, service запущен, но operation получает Permission denied / AVC-related failure».

Expected: getenforce → ls -Z → ausearch -m AVC -ts recent → identify context/boolean/port cause → persistent fix via semanage/restorecon/appropriate boolean.

Forbidden fix: disable SELinux.

Incident 6 - NFS blocked

Injection: закрыть NFS service/2049 для APP01 либо stop NFS server.

Symptom: «Autofs path перестал открываться».

Expected: first test manual mount / nc 2049 → distinguish autofs from NFS → service/firewall → fix → manual mount → autofs.

Incident 7 - autofs map typo

Injection: изменить export path/server в autofs map, при этом manual NFS configuration остаётся рабочей.

Symptom: «Manual NFS mount работает, но automount path не появляется».

Expected: prove NFS works → autofs service/logs/map → fix map → access path → findmnt.

Incident 8 - APP01 application storage permissions

Injection: изменить owner/group/ACL /srv/app/data так, чтобы appsvc не мог писать, но mount был рабочим.

Symptom: «Filesystem mounted, free space есть, service user получает Permission denied при записи».

Expected: id → namei -l → ls -ld → getfacl → minimal permission/ownership fix → test as appsvc.

Forbidden fix: chmod 777.

Incident 9 - filesystem full vs inode full

Injection: использовать заранее созданную маленькую test filesystem; заполнить либо bytes большим test file, либо inodes множеством небольших файлов.

Symptom: «Приложение получает No space left on device».

Expected: df -hT + df -ih → identify which resource is exhausted → du/find → clean only injected data → verify.

Incident 10 - PostgreSQL not reachable remotely

Injection options (choose one):

Symptom: «PostgreSQL local readiness работает, APP01 не может выполнить application DB connection».

Examiner: выбрать только одну root cause за ticket.

Expected: pg_isready local → ss :5432 → SHOW listen_addresses → network nc → pg_hba/auth → firewall → targeted fix.

Incident 11 - PostgreSQL authentication vs authorization

Injection: изменить role password либо revoke permission на конкретный object.

Symptom: дать фактический application error без указания типа.

Expected: пользователь должен различить connection/authentication/SQL authorization по psql error и logs.

Incident 12 - systemd health-check failure

Injection: изменить ExecStart path, script permission или intentionally wrong URL в unit/script. Выбрать только одну причину.

Symptom: «app-health.timer запускается, но последнее health-check выполнение failed».

Expected: systemctl list-timers → service status → journal → systemctl cat → script direct test → fix → rerun service.

Incident 13 - resource limit

Injection: установить низкий LimitNOFILE только для controlled test service или PAM limit для test login process.

Symptom: «Process стартует, но под нагрузкой не может открыть новые files/sockets».

Expected: /proc//limits / systemctl show / login ulimit → identify source of limit → change correct layer → restart/relogin only when justified.

Incident 14 - missing static route

Injection: удалить controlled route к специально выделенной test network.

Symptom: «APP01/OPS01 не достигает test destination; другие сети работают».

Expected: ip addr → ip route → ip route get <TEST_IP> → compare expected path → restore persistent route → verify.

Incident 15 - nftables redirect path broken

Injection options: wrong backend IP/port in DNAT rule OR missing forwarding rule. Только одна.

Symptom: «APP01 test redirect port доступен/виден, но request не достигает ожидаемого backend».

Expected: nft list ruleset/counters → forwarding sysctl → route → backend listener → fix exact layer.

Incident 16 - TLS key/config

Injection options: wrong certificate/key path, mismatched certificate/key pair, unreadable key for service context. Только одна.

Symptom: «HTTP работает, HTTPS не запускается/handshake не проходит после TLS change».

Expected: nginx -t → journal → certificate/key metadata → permissions/path → reload → openssl s_client/curl.

Incident 17 - bad fstab on recovery clone

Injection: добавить invalid test persistent mount, затем reboot snapshot/clone до emergency/problem state.

Symptom: «Host после reboot не доходит до нормального multi-user state».

Expected: console → systemctl --failed / journalctl -xb / mounts → inspect fstab → correct entry → mount -a → reboot.

Incident 18 - backup selection error

Injection: оставить несколько versioned backups, один старый/неполный/с intentionally mismatched checksum.

Symptom: «Нужно восстановить test data к заданной точке времени; доступно несколько backup candidates».

Expected: choose by timestamp/policy → checksum → inspect archive → staging restore → verify expected content → only then recovery.

Scoring suggestion

Для каждого incident 0–4:

Рекомендуемый проход: 8 incidents × 4 = 32 points.

Уверенное прохождение: 24+ без критически опасных «универсальных fixes».

Critical errors

Challenge останавливается/считается проваленным для конкретного ticket, если без необходимости: