Files
Зарубин Филипп f219b1fc67 feat: Athena OS Фаза 2 — generic chezmoi-канон Мозга
chezmoi-source (чистая пересборка, не дамп 1.2 ГБ):
- dot_claude: CLAUDE.md лин-роутер, AGENTS.md.tmpl (VPS вычищен),
  settings.json.tmpl (deny-щит 20 + security-guard hook), rules
  (structure + ECC 21 язык), 30 generic ECC-агентов, health-check
- dot_codex: symlink-паритет; dot_agents: registry 13 скриптов
  HOME-генерик + методология docs
- плагины: plugins.manifest + bootstrap Слой 1b (marketplace+install)
- launchd: health.plist (PATH-фикс 127) + session-reaper.example
- smoke++: secret-токен guard + канон-проверки (зелёный)
- 0 hard личных данных; cut личного (kb/references/gsd/owner) → Ф4
2026-06-15 16:59:09 +03:00

1.9 KiB

paths
paths
**/*.rb
**/*.rake
**/Gemfile
**/Gemfile.lock
**/config/routes.rb
**/config/credentials*.yml.enc

Ruby Security

This file extends common/security.md with Ruby and Rails specific content.

Rails Defaults

  • Keep CSRF protection enabled for state-changing browser requests.
  • Use strong parameters or typed boundary objects before mass assignment.
  • Store secrets in Rails credentials, environment variables, or a secret manager. Never commit plaintext keys, tokens, private credentials, or copied .env values.

SQL And Active Record

  • Prefer Active Record query APIs and parameterized SQL.
  • Never interpolate request, cookie, header, job, or webhook values into SQL strings.
  • Scope model callbacks carefully; security-sensitive side effects should be explicit and covered by tests.

Authentication And Sessions

  • Use the Rails 8 authentication generator for simple session auth, or Devise when OAuth, MFA, confirmable, lockable, multi-model auth, or existing Devise conventions are required.
  • Rotate sessions after sign-in and privilege changes.
  • Protect account recovery flows with expiry, single-use tokens, rate limiting, and audit logging.

Dependencies

  • Run dependency checks when the lockfile changes:
bundle exec bundle-audit check --update
bundle exec brakeman --no-progress
  • Review new gems for maintainer activity, native extension risk, transitive dependencies, and whether the same behavior can be implemented with Rails core.

Web Safety

  • Escape template output by default. Treat html_safe, raw, and custom sanitizers as security-sensitive code.
  • Validate file uploads by content type, extension, size, and storage destination.
  • Treat background jobs, webhooks, Action Cable messages, and Turbo Stream inputs as untrusted boundaries.

Reference

See skill: security-review for secure-by-default review patterns.