$ 92.82
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 4390 |
| Technical Name |
praetorx_security |
| License | OPL-1 |
| Website | https://praetorx.net |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 4390 |
| Technical Name |
praetorx_security |
| License | OPL-1 |
| Website | https://praetorx.net |
MCP Security
API Security — Rate Limiting, Audit Logging & Access Control for Odoo 19
Secure your Odoo data when integrating with Model Context Protocol (MCP) clients.
API key authentication, granular model permissions, IP whitelisting, rate limiting,
audit logging, and real-time security alerts — all enforced on a dedicated
/xmlrpc/2/mcp endpoint.
praetorx.net | Syntax & Sabotage
API Key Management
Keys are hashed with PBKDF2-SHA512 (6 000 rounds) and never stored in plaintext. A one-time wizard displays the key at creation — after that, only the hash remains.
Set an expiration date per key. Enable auto-rotation and a daily cron generates replacement keys before expiry, sends email notifications, and keeps the old key active until its date passes.
Assign scopes (read, write, create, delete) as a Many2many selection. Keys without scopes get full access; keys with scopes are limited to the selected operations only.
Optionally restrict each key to specific Odoo models. If set, the key can only operate on those models — all others are denied regardless of permissions.
Access Control & Permissions
Deny-by-default: only models with an explicit praetorx.permission record are accessible. Each record defines per-model CRUD flags (read, write, create, delete) and optional group restrictions.
Restrict access by IP address. Supports IPv4, IPv6, and CIDR notation (e.g. 192.168.1.0/24). Validated via Python’s ipaddress module. Handles X-Forwarded-For for reverse proxies.
In-memory sliding-window rate limiter with a 60-second window. Configurable max requests per minute per API key. Returns HTTP 429-style XML-RPC faults with X-RateLimit-* headers. No external dependencies.
When enabled, PraetorX API keys are blocked from /xmlrpc/2/object and must use the secured /xmlrpc/2/mcp endpoint. Uses indexed key-prefix lookup for fast detection with minimal overhead.
Monitoring & Audit
Every MCP operation is logged with user, timestamp, model, method, record ID, success/failure, and IP address. Export to CSV or JSON with date-range filtering. Configurable retention with automatic cleanup.
Automatic alerts for failed authentication, rate-limit breaches, blocked IPs, and suspicious activity. Four severity levels (low to critical). Email notifications with configurable thresholds. Resolve/reopen workflow via mail.thread.
Tracks active MCP sessions per API key with configurable timeout and concurrent-session limits. Automatic cleanup of expired sessions via cron. Manual termination from the session list view.
Revoke all active API keys at once via a confirmation wizard. Requires admin group, a written reason, and explicit confirmation. Sends email notifications to all affected users and creates a critical security alert.
How the Security Pipeline Works
Request → API Key Auth → Session Check → IP Whitelist → Rate Limit → Scope Check → Model Restriction → Permission Check → Execute → Audit Log
PraetorX permissions are checked in addition to standard ir.model.access. Both must allow the operation.
Audit log cleanup (daily), expired key cleanup (daily), rate limiter cleanup (5 min), auto key rotation (daily), session cleanup (15 min), old session deletion (daily).
User (read-only), Manager (manage keys, permissions, view logs), Admin (full control including emergency revocation).
Technical Reference
| Component | Details |
|---|---|
| praetorx.api.key | API key lifecycle — PBKDF2 hash, expiration, scope (Many2many), model restrictions, usage tracking, auto-rotation, regeneration |
| praetorx.api.scope | Predefined operations (read, write, create, delete) — prevents typos, uses many2many_tags widget |
| praetorx.permission | Per-model CRUD whitelist — one record per model, optional group restrictions, additive to ir.model.access |
| praetorx.audit.log | Operation log — user, timestamp, model, method, record ID, success/failure, IP address, CSV/JSON export |
| praetorx.security.alert | Security events — 7 alert types, 4 severity levels, mail.thread, email notifications, resolve/reopen |
| praetorx.session | Session tracking — timeout, concurrent limits, request count, automatic cleanup |
| praetorx.rate.limiter | Abstract model — in-memory sliding window, thread-safe, no external dependencies |
| /xmlrpc/2/mcp | Secured endpoint — full security pipeline, drop-in replacement for /xmlrpc/2/object |
Screenshots
API Key Management — key list with expiration, scope, usage count, and last-used timestamp
Permission Configuration — per-model CRUD whitelist with optional group restrictions
Audit Logs — operation history with user, model, method, success/failure, and IP address
Security Alerts — failed auth tracking, severity levels, resolve/reopen workflow
Settings — rate limiting, IP whitelist, session management, key rotation, audit configuration
Setup Guide
- Odoo 19.0 (Community or Enterprise)
- Python 3.10+
- Required modules:
praetorx_base(free),mail,rpc - No external Python dependencies
- No external services or API keys
No Enterprise dependency. Works on Community, Enterprise, and Odoo.sh.
Install from the Odoo Apps menu. Search for “MCP Security” or “PraetorX Security”.
Dependencies (praetorx_base, mail, rpc) are installed automatically.
- Navigate to PraetorX → Security → API Keys
- Click New and enter a descriptive name
- Select scope restrictions and optionally limit to specific models
- Set an expiration date (or leave empty for no expiry)
- Click Save — the key is displayed once in a popup wizard
- Copy the key immediately; it cannot be retrieved later
- Navigate to PraetorX → Security → Permissions
- Click New, select the Odoo model to allow access to
- Enable the required operations (Read, Write, Create, Delete)
- Optionally restrict to specific user groups
- Click Save
Without a permission record, MCP access to that model is denied (whitelist mode).
- Go to Settings → PraetorX Security
- Toggle Enable Rate Limiting and set max requests per minute (default: 60)
- Enter allowed IPs in the IP Whitelist field (comma-separated, CIDR supported)
- Configure session timeout and concurrent session limits
- Click Save
Leaving the IP whitelist empty allows all IP addresses.
User: Read-only access to permissions, audit logs, alerts, and sessions.
Manager: Manage API keys and permissions, view audit logs and alerts. Implies User.
Admin: Full control including emergency key revocation and alert management. Admin user is assigned by default. Implies Manager.
FAQ
execute_kw interface as the standard /xmlrpc/2/object, but runs every request through the full security pipeline: API key authentication, IP whitelist, rate limiting, scope check, model restriction, permission check, and audit logging. MCP clients use this endpoint instead of the standard one.ir.model.access and record rules. Both layers must allow the operation. MCP Security adds an extra security gate specifically for MCP/API traffic without affecting normal Odoo access.res.users.apikeys. The plaintext key is never stored in the database — it is shown once via a wizard at creation time. A prefix (first 8 characters) is stored separately for fast indexed lookups during enforcement.X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After headers. A security alert is also created if alert monitoring is enabled.praetorx_base, mail, and rpc — all available in Community Edition. There is no dependency on any Enterprise-only module.Release History
v19.0.1.2.1 — March 2026
Current Release
- Endpoint enforcement: block PraetorX keys from /xmlrpc/2/object when secured endpoint is required
- Key prefix indexing for fast enforcement lookups
- Security groups migrated to praetorx_base with backward-compatible XML IDs
v19.0.1.2.0
- Export audit logs: CSV and JSON with date-range filtering
- Emergency revoke-all-keys wizard with confirmation, email notifications, and security alert
v19.0.1.1.0
- Auto key rotation with daily cron and email notifications
- Session management: timeout enforcement, concurrent session limits, cleanup crons
v19.0.1.0.0
- API key scope validation (Many2many with predefined scopes)
- IP whitelist with IPv4/IPv6 and CIDR support
- Sliding-window rate limiting with HTTP 429-style responses
- Security alerts with severity levels and email notifications
v19.0.0.1.0 — Initial Release
- API key authentication with PBKDF2-SHA512 hashing
- Whitelist-based model permissions (per-model CRUD)
- Comprehensive audit logging
- Secured /xmlrpc/2/mcp endpoint
You May Also Like
Shared security groups, menus, and technical patterns for all PraetorX modules.
FreeRole-based user group management with date-gated assignments and automatic sync.
FreeBranded backend theme with sidebar, home tiles, activity dashboard, and per-role color theming.
FreeMade with ♥ by Syntax & Sabotage
© 2026 Syntax & Sabotage, Lars Weiler. All rights reserved. OPL-1.
Impressum · support@syntaxandsabotage.io
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module