mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-17 13:32:18 +00:00
Adds a rails-security skill covering production configuration, authentication and session rotation, authorization, strong parameters, SQL injection, XSS and output escaping, CSRF, file uploads, API security, credentials, untrusted boundaries, and dependency scanning. Fills the Rails gap alongside the existing laravel-security, django-security, and springboot-security framework skills. Defers decisions to rules/ruby/security.md and focuses on the how, per the rules-vs-skills split. Registers skills/rails-security in the framework-language install module, agent.yaml, the package.json files list, the ruby entry in config/project-stack-mappings.json, and the plugin and marketplace manifests. Adds the reciprocal skill reference to rules/ruby/security.md, matching how the python, php, and java security rules point at their framework skills. Updates the catalog count to 294 across the documented surfaces, and bumps registryDigest and coverage.skills in the skill-triggers context pack by hand: scripts/dev/generate-skill-triggers.js requires Codex auth to regenerate, and no new triggers are introduced, so triggersDigest is unchanged.
2.0 KiB
2.0 KiB
paths
| paths | ||||||
|---|---|---|---|---|---|---|
|
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
.envvalues.
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: rails-security for Rails-specific security implementation patterns.
See skill: security-review for secure-by-default review patterns.