odoo-security
БесплатноЗапускает вложенные скриптыНе проверенComprehensive Odoo security auditor for model access rules, HTTP route authentication, sudo() usage, SQL injection risks, and record rule completeness across…
от ahmed-lakosha★ 79 звёзд на GitHubОб этом скилле
Odoo Security Skill
You are an expert Odoo security auditor. You analyze Odoo module codebases systematically, produce severity-graded reports, and guide developers toward secure-by-default implementations.
How to Audit
When triggered, follow this methodology:
- Validate module — confirm
__manifest__.pyexists at the given path. - Run Access Checker — scan
models/*.pyvssecurity/ir.model.access.csv. - Run Route Auditor — scan
controllers/*.pyfor@http.route()issues. - Run Sudo Finder — scan all
.pyfiles for.sudo()risk patterns. - Run SQL Scanner — find
env.cr.execute()with unsafe string formatting. - Aggregate results — merge issues, compute risk score, sort by severity.
- Present unified report with remediation code for each issue.
Use the Python scripts in odoo-security/scripts/ for automated scanning:
python odoo-security/scripts/security_auditor.py /path/to/module
python odoo-security/scripts/security_auditor.py /path/to/module --min-severity HIGH --json
Or run individual auditors:
python odoo-security/scripts/access_checker.py /path/to/module --json
python odoo-security/scripts/route_auditor.py /path/to/module --json
python odoo-security/scripts/sudo_finder.py /path/to/module --json
python odoo-security/scripts/sql_scanner.py /path/to/module --json
Severity Levels
| Severity | Weight | Meaning | Action |
|---|---|---|---|
| CRITICAL | 4 | Immediate vulnerability | Fix before deployment |
| HIGH | 3 | Significant risk | Fix within sprint |
| MEDIUM | 2 | Security weakness | Fix in next release |
| LOW | 1 | Minor improvement | Fix when convenient |
Risk Score (0-100) = sum of (issue_count x weight). 80+ = CRITICAL, 50-79 = HIGH, 25-49 = MEDIUM, 1-24 = LOW, 0 = Clean.
Security Check Reference
Layer: Access Rules
| Check | Severity | Description |
|---|---|---|
| Model without CSV entry | CRITICAL | Any _name model without access rule |
| Wizard without CSV entry | HIGH | TransientModel without access rule |
| Empty group_id in CSV | HIGH | Grants access to ALL authenticated users |
| No multi-company rule | HIGH | Model with company_id but no record rules |
| Overly permissive perms | MEDIUM | DELETE for non-manager groups |
| Unknown group reference | LOW | CSV references undefined group |
Layer: Routes
| Check | Severity | Description |
|---|---|---|
| auth='none' without auth code | CRITICAL | Completely unauthenticated route |
| Missing auth= parameter | HIGH | Implicit default |
| sudo() + sensitive model in public | HIGH | IDOR risk |
| csrf=False on user route | HIGH | CSRF vulnerability |
| auth='public' + sensitive model | MEDIUM | Data exposure |
| Mixed GET/POST methods | MEDIUM | HTTP semantics violation |
Layer: sudo()
| Check | Severity | Description |
|---|---|---|
| sudo() in public + sensitive model | CRITICAL | Bypasses all access controls |
| sudo() in public route | HIGH | Privilege escalation |
| sudo() on sensitive model | HIGH | Broad access |
| sudo() in loop | MEDIUM | Performance + security smell |
| Unscoped sudo() | MEDIUM | No domain filter |
Layer: SQL Injection
| Check | Severity | Description |
|---|---|---|
| f-string in cr.execute() | CRITICAL | Direct SQL injection |
| .format() in cr.execute() | CRITICAL | Direct SQL injection |
| String concat in cr.execute() | HIGH | SQL injection risk |
| % operator in cr.execute() | HIGH | SQL injection risk |
| Variable query in cr.execute() | MEDIUM | Verify parameterization |
| _where_calc without _apply_ir_rules | LOW | Bypasses record rules |
Sensitive Models (elevated risk when accessed via sudo/public)
res.partner, res.users, hr.employee, hr.payslip, account.move,
account.payment, sale.order, purchase.order, stock.picking,
ir.config_parameter, ir.attachment, ir.rule, ir.model.access,
mail.message, res.partner.bank
Configuration
Users can create .odoo-security.json in the module root to customize:
{
"sensitive_models_add": ["custom.sensitive.model"],
"sensitive_models_remove": ["mail.thread"],
"exclude_paths": ["tests/", "demo/"],
"default_severity": "LOW",
"custom_safe_groups": ["my_module.group_special"]
}
Detailed Reference Material
For detailed remediation patterns and code examples, read these files:
memories/security_patterns.md — Severity-graded patterns with detection commands and production-ready remediation code for each issue type (missing access rules, auth='none' routes, sudo() in public controllers, SQL injection, multi-company rules, sensitive fields).
memories/access_rules.md — Complete ir.model.access.csv reference including column definitions, model_id:id derivation rules, 8 standard access patterns (internal, read-only, portal, wizard, multi-company, system-only, public, inherited), group hierarchy, record rules w
Установить odoo-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepВложенные файлы
FAQ
Что делает скилл odoo-security?
Comprehensive Odoo security auditor for model access rules, HTTP route authentication, sudo() usage, SQL injection risks, and record rule completeness across Odoo 14-19. <example> Context: User wants a full security audit user: "Run a complete security audit on my HR module" assistant: "I will audit access rules, HTTP routes, sudo usage, and SQL injection risks across all files in the module." <commentary>Full audit trigger - comprehensive security review.</commentary> </example> <example> Context: User wants to check access rules user: "Check if all models have proper access rules in ir.model.access.csv" assistant: "I will scan all Python model definitions and compare against ir.model.access.csv to find missing read/write/create/unlink rules." <commentary>Access check trigger - ir.model.access.csv completeness.</commentary> </example> <example> Context: User wants to find risky sudo usage user: "Find all places where sudo() is used without proper context" assistant: "I will scan for .sudo() calls, categorize by context (controller, compute, action), and flag privilege escalation risks." <commentary>Sudo finder trigger - privilege escalation risk analysis.</commentary> </example> <example> Context: User wants SQL injection audit user: "Scan my module for SQL injection vulnerabilities" assistant: "I will scan all Python files for unsafe cr.execute() patterns, string formatting in queries, and missing parameterization." <commentary>SQL injection trigger - scans for unsafe database query patterns.</commentary> </example>
Как установить скилл odoo-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл odoo-security запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic