Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

authorization-security

БесплатноЗапускает вложенные скриптыНе проверен

Authorization security standards covering RBAC, ABAC, policy enforcement, OAuth2 scopes, resource-based access control, and NIST 800-53 compliance (AC-3…

williamzujkowskiот williamzujkowski★ 23 звезды на GitHub8 установок в других каталогах

Об этом скилле

Authorization Security

Quick Navigation: Level 1: Quick Start (5 min) → Level 2: Implementation (30 min) → Level 3: Mastery (Extended)


Level 1: Quick Start (<800 tokens, 5 minutes)

Core Principles

  1. Least Privilege: Grant minimum permissions required (NIST AC-6)
  2. Separation of Duties: No single user controls entire critical process
  3. Defense in Depth: Multiple authorization checks at different layers
  4. Fail Secure: Default deny, explicit allow
  5. Audit Everything: Log all authorization decisions (AU-2)

RBAC vs ABAC Comparison

Aspect RBAC (Role-Based) ABAC (Attribute-Based)
Model Roles → Permissions Attributes → Policies
Flexibility Low (fixed roles) High (dynamic rules)
Complexity Simple to implement Complex policy engine
Use Case Traditional enterprise Context-aware access
Example admin, user, guest dept=finance AND time=business_hours
NIST Control AC-3 (Access Enforcement) AC-3, AC-4, AC-16

Essential Checklist

  • Least privilege: Users have minimum required permissions (AC-6)
  • Separation of duties: Critical operations require multiple approvals (AC-5)
  • Role hierarchies: Roles inherit permissions logically
  • Policy enforcement: Authorization checked at API gateway + service level
  • OAuth2 scopes: Fine-grained permissions in access tokens
  • Resource ownership: Users can only access their own resources
  • Deny by default: Unknown requests rejected automatically
  • Audit logging: All authorization decisions logged with user/resource/action
  • Time-based access: Support for temporary permissions
  • Policy testing: Unit tests for all authorization rules

Quick Example

# @nist ac-3 "Access enforcement"
# @nist ac-6 "Least privilege"

# ❌ NEVER do this (no authorization)
@app.route('/api/documents/<doc_id>')
def get_document(doc_id):
    return Document.query.get(doc_id)

# ✅ Enforce ownership and permissions
@app.route('/api/documents/<doc_id>')
@require_auth
def get_document(doc_id):
    doc = Document.query.get_or_404(doc_id)

    # Check ownership OR read permission
    if doc.owner_id != current_user.id and not current_user.has_permission('documents:read'):
        abort(403, "Insufficient permissions")

    # Audit the access
    audit_log.info(f"User {current_user.id} accessed document {doc_id}")
    return doc.to_dict()

Common Patterns

Role Hierarchy:

superadmin
  └── admin
       └── manager
            └── user
                 └── guest

Permission Naming:

  • resource:action (e.g., documents:read, users:write)
  • service:resource:action (e.g., api:documents:delete)

Scope Patterns:

  • read:profile - Read own profile
  • read:all_profiles - Read all profiles (admin)
  • write:documents - Create/update documents
  • admin:* - Full administrative access

Quick Links to Level 2


Level 2:

📚 Full Examples: See REFERENCE.md for complete code samples, detailed configurations, and production-ready implementations.

Implementation (<4,500 tokens, 30 minutes)

RBAC Implementation

Role-Based Access Control assigns permissions to roles, then roles to users. Ideal for traditional enterprise systems with stable organizational structures.

Core Components

  1. Roles: Named collections of permissions (e.g., admin, editor, viewer)
  2. Permissions: Specific actions on resources (e.g., documents:read, users:write)
  3. Users: Assigned one or more roles
  4. Role Hierarchy: Roles can inherit from parent roles

Database Schema

See REFERENCE.md for complete implementation.

Python Implementation

See templates/policy-enforcement.py for complete implementation.

See REFERENCE.md for complete implementation.

Role Hierarchy Example

See REFERENCE.md for complete implementation.

See templates/rbac-policy.yaml for declarative policy definition.


ABAC Implementation

Attribute-Based Access Control uses policies that evaluate attributes (user, resource, environment) to make dynamic authorization decisions. Ideal for complex, context-aware access control.

Core Components

  1. Attributes: Properties of users, resources, or environment (e.g., user.department, `resource.
Полный SKILL.md на GitHub

Установить authorization-security в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

REFERENCE.mdresources/nist-ac-controls.mdscripts/generate-rbac.shtemplates/abac-policy.jsontemplates/middleware.jstemplates/policy-enforcement.pytemplates/rbac-policy.yaml

FAQ

Что делает скилл authorization-security?

Authorization security standards covering RBAC, ABAC, policy enforcement, OAuth2 scopes, resource-based access control, and NIST 800-53 compliance (AC-3, AC-4, AC-6) for production systems

Как установить скилл authorization-security?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл authorization-security запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить authorization-security с