backend-rbac-audit-log

Implement RBAC middleware and audit logging for TypeScript backend APIs.

2|Updated May 10, 2026
One-click install
npx skills add https://github.com/freedomw1987/tree_monstor --skill backend-rbac-audit-log
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-rbac-audit-log
Source: https://github.com/freedomw1987/tree_monstor/tree/main/skills/backend/backend-rbac-audit-log
Command: npx skills add https://github.com/freedomw1987/tree_monstor --skill backend-rbac-audit-log

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Backend APIs frequently lack granular role-based access control and reliable audit logging, leading to security vulnerabilities, compliance failures, and inability to trace who modified critical data like user accounts or sales records.

Core Features & Use Cases

  • Centralized Permission Map: Single source of truth for roles and permissions that works across both backend and frontend, supporting frameworks like Elysia, Express, Fastify, Hono, and NestJS.
  • Production-Ready Guardrails: Includes middleware for permission checking, non-throwing audit log helpers that capture user/IP/user-agent without breaking requests, and protections for edge cases like last admin deletion or self-deactivation.
  • Security Auditing Tools: Comes with a script to scan for unauthenticated public endpoints and reference guides for fixing common Elysia plugin boundary issues.
  • Use Case: Ideal for admin panels, CRM systems, or any backend requiring user management, role-based permissions, compliance logging, or tracking of data changes for auditing purposes.

Quick Start

Use the backend-rbac-audit-log skill to implement role-based access control and audit logging for your backend API's user management and CRM routes.

Frequently Asked Questions about backend-rbac-audit-log

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add role-based access control and audit logging to my backend API?

To add role-based access control and audit logging to a backend API, implement a centralized permission map with scoped RBAC middleware and a non-throwing audit log helper to capture user activity without breaking requests.

Can I use this RBAC middleware with frameworks like Express, Fastify, Hono, or NestJS?

Yes, the RBAC middleware and centralized permission map work across TypeScript backend projects using Elysia, Express, Fastify, Hono, and NestJS, ensuring consistent role permissions and compliance logging.

How do I prevent unauthorized access to public endpoints in my Elysia backend?

To prevent unauthorized access to public endpoints in an Elysia backend, run security auditing scripts that scan for unauthenticated routes and use reference guides to fix common plugin boundary issues.

How does audit logging handle edge cases like deleting the last admin account?

Audit logging handles edge cases like last admin deletion or self-deactivation by using production-ready guardrails that protect critical user management operations and prevent accidental permission loss.

What is the best way to track who modified critical data in a CRM system?

The best way to track who modified critical CRM data is to implement audit trails using a non-throwing audit log helper with a Prisma schema, capturing user, IP, and user-agent for full activity traceability.