Logo Auditing Declarative Authorization

Auditing Declarative Authorization

Tổ chức
UnboundCompute
auditing-declarative-authorization

Audit authorization expressed as configuration or framework convention rather than inline code: row-level security and policy rules, framework before-action and middleware filters that must be attached to every protected route, serverless and gateway access rules, and object-ownership checks. Covers routes that skip the filter, policies with a permissive default, rules that check authentication but not ownership, and gaps between where the rule is declared and where the data is accessed. Use when reviewing role- or policy-driven access control. Coverage and correctness are separate checks.

Tổng quan

Nhà phát hànhUnboundCompute
Kho mãsecurity-agent-skills
Tên kỹ năngauditing-declarative-authorization
Sao
27
Bản fork
8
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được UnboundCompute công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Auditing Declarative Authorization trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-declarative-authorization
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-declarative-authorization .claude/skills/auditing-declarative-authorization
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Auditing Declarative Authorization trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Auditing Declarative Authorization ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Auditing Declarative Authorization không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Auditing declarative authorization: coverage and correctness are two audits

Modern authorization is often declarative: a policy attached to a table, a filter registered on a controller, a rule in a gateway or serverless config. The strength of that model is also its weakness, security depends on the rule being attached to every path that needs it, and on the rule actually expressing the intended constraint. The failures are gaps (a route the filter never covers) and mis-statements (a rule that checks the wrong thing), and both are invisible if you only read the routes that are protected.

When to use

  • You are reviewing role- or policy-driven access control.
  • Authorization is enforced by row-level policies, controller filters, middleware, or gateway rules.
  • Protection depends on a rule being attached per route, per table, or per resource.

Scope check

Audit access control in systems you own or are authorized to test, with test accounts across roles and tenants. If you can't name the authorization, stop.

The loop

  1. Locate every declared rule and its scope. Inventory the authorization rules: row-level policies, controller filters, middleware, gateway or serverless access rules, and ownership checks. For each, determine exactly which paths, tables, or resources it covers. The audit is about coverage and correctness, so start by mapping what each rule protects.

  2. Find the paths the rule does not cover. Enumerate every route, query, or resource access and check which are not covered by any rule. A framework filter that must be added per controller is missing wherever a developer forgot it; a policy on one table does not protect a sibling table or a raw query that bypasses the policy layer. The uncovered path is the bug.

  3. Check the default of the policy layer. When no rule matches, does access default to deny or allow? A row-level-security system with policies enabled but a permissive fallback, or a gateway that allows unmatched routes, grants access wherever a rule is absent. Confirm the default is deny.

  4. Check that the rule states ownership, not just presence. Does the rule confirm this user may access this specific object, or only that the user is authenticated? A filter that checks "logged in" but not "owns this record," or a policy that scopes by table but not by row or tenant, lets any authenticated user reach another's data. Authentication is not authorization.

  5. Check the declaration-to-access gap. Is the rule enforced at the same layer the data is actually accessed, or can a code path reach the data beneath the rule (a raw query under row-level security, a direct service call under a gateway rule, an admin path that skips the middleware)? A rule declared in one place and data reached in another is unenforced there.

  6. Confirm and record. Confirm a gap by accessing a protected resource through the uncovered path or as the wrong user; confirm a mis-statement by reaching another user's object through the rule. Kill the lead if every path is covered, the default is deny, and rules enforce ownership at the access layer. Record with the exact uncovered path or wrong-object access.

Where declarative authz leaks

  • Coverage is per path, correctness is per rule. Check both; the protected routes tell you nothing about the unprotected ones.
  • The default when no rule matches is the whole ballgame. Deny-by-default contains mistakes; allow-by-default amplifies them.
  • Authenticated is not authorized. A filter that stops at identity, not ownership, is a horizontal-access bug.
  • Rules and data can drift apart. A path that reaches the data below the rule's layer is unprotected no matter how the rule reads.

Worked example (a confirm and a kill)

Confirm. An app enforces access with a per-controller before-action filter. A newer controller exposing the same records was added without the filter. Requesting those records through the new controller returns any user's data with only a valid session. Confirmed missing-filter gap, high, remediation = enforce authorization globally with explicit opt-out, or add the filter and a test that every controller is covered.

Kill. Row-level security is enabled with a deny-by-default fallback, every table has an ownership-scoped policy keyed to the tenant and user, raw queries run under the same policy, and no code path reaches the data beneath the policy layer. Cross-user and uncovered-path attempts return nothing. Killed, kill_reason = "deny-by-default, ownership-scoped policies on every table enforced at the data layer, no bypass path."

Rationalizations to reject

  • "Authorization is handled by the framework." → Only where the rule is attached. Enumerate the paths that lack it.
  • "The policy is enabled." → Enabled with what default and what scope? A permissive default or table-only scope still leaks.
  • "The user is authenticated." → Authentication is not ownership. Check that the rule constrains which object, not just which user.
  • "The rule is declared on the model." → And the data is reached where? A path under the rule's layer is unprotected.

Executing this in practice

You need the full set of declared rules and their scopes, a complete enumeration of routes and data accesses to find the uncovered ones, and the ability to request protected resources through each path and as different users. A call graph that maps every access to the data and shows which are covered by a guard is ideal; the coverage-and-correctness pass is the method.

Related

  • auditing-guard-gaps - the unguarded-peer pattern, here applied to declarative rules and routes.
  • finding-fail-open-flaws - the permissive-default failure mode of a policy layer.
  • hunting-business-logic-flaws - authorization of outcomes reached through a permitted path.
  • FINDING-SCHEMA.md - source = the uncovered path or wrong-user request, sink = the protected resource it reaches.

Câu hỏi thường gặp

Kỹ năng AI Auditing Declarative Authorization làm được gì?

Audit authorization expressed as configuration or framework convention rather than inline code: row-level security and policy rules, framework before-action and middleware filters that must be attached to every protected route, serverless and gateway access rules, and object-ownership checks. Covers routes that skip the filter, policies with a permissive default, rules that check authentication but not ownership, and gaps between where the rule is declared and where the data is accessed. Use when reviewing role- or policy-driven access control. Coverage and correctness are separate checks.

Vì sao nên dùng Auditing Declarative Authorization trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Auditing Declarative Authorization là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Auditing Declarative Authorization trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-declarative-authorization. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Auditing Declarative Authorization?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Auditing Declarative Authorization với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Auditing Declarative Authorization với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Auditing Declarative Authorization có miễn phí không?

Có. Kỹ năng này được UnboundCompute phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇