---
name: auditing-access-control
description: Audit access control implementations for security vulnerabilities and misconfigurations. Use when reviewing authentication and authorization. Trigger with 'audit access control', 'check permissions', or 'validate authorization'.
version: 1.25.0
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(security:*), Bash(scan:*), Bash(audit:*)
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
  - security
  - authentication
  - audit
compatibility: Designed for Claude Code
title: auditing-access-control
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/auditing-access-control
last_updated: 2026-10-23T06:01:00.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/auditing-access-control/assets/README.md), [references/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/auditing-access-control/references/README.md), [scripts/access_control_audit.py](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/auditing-access-control/scripts/access_control_audit.py), [scripts/README.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/auditing-access-control/scripts/README.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/auditing-access-control`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/auditing-access-control`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/auditing-access-control) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/auditing-access-control`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/auditing-access-control --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/auditing-access-control --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Access Control Auditing

## Overview

Audit access control implementations across codebases, cloud configurations, and
application layers for security vulnerabilities and policy violations. This skill
targets IAM policies, ACLs, RBAC configurations, file permissions, and API
authorization logic to identify privilege escalation paths, overly permissive
grants, and violations of the principle of least privilege.

## Prerequisites

- Access to the target codebase and configuration files in `${CLAUDE_SKILL_DIR}/`
- Familiarity with the authorization model in use (RBAC, ABAC, ACL, or IAM)
- `grep`, `find`, and standard shell utilities available via Bash
- For cloud audits: CLI tools such as `aws iam`, `gcloud`, or `az role` installed and authenticated
- Reference: [`references/README.md`](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/auditing-access-control/references/README.md) for IAM best practices, ACL vulnerability patterns, and NIST/GDPR access control standards

## Instructions

1. Enumerate all access control definitions by scanning for IAM policy files, RBAC configuration, ACL definitions, middleware authorization checks, and `.htaccess` or equivalent files using Glob and Grep.
2. Map each role or principal to its granted permissions, building a permission matrix that identifies which subjects access which resources at which privilege level.
3. Evaluate each permission grant against the principle of least privilege -- flag any wildcard permissions (`*`), overly broad resource scopes, or administrative access granted to non-admin roles.
4. Check for separation of duties violations where a single role combines mutually exclusive privileges (e.g., both "create user" and "approve user").
5. Identify privilege escalation paths by tracing role inheritance chains, looking for roles that can modify their own permissions or assume higher-privileged roles.
6. Inspect API route handlers and middleware for missing or inconsistent authorization checks -- compare route definitions against their corresponding auth guards.
7. Verify that default-deny is enforced: confirm that unauthenticated or unauthorized requests are rejected unless explicitly allowed.
8. Cross-reference findings against compliance requirements (NIST AC-1 through AC-25, GDPR Article 25, SOC 2 CC6.1) and flag gaps.
9. Classify each finding by severity (critical, high, medium, low) based on exploitability and blast radius.
10. Generate a remediation plan with specific configuration changes, code patches, or policy updates for each finding.

## Output

- **Permission matrix**: Role-to-resource mapping table showing all grants
- **Findings report**: Each finding includes severity, affected resource, description, CWE reference (e.g., CWE-269 Improper Privilege Management, CWE-285 Improper Authorization), and remediation steps
- **Compliance gap analysis**: Checklist of NIST SP 800-53 AC controls and GDPR access control requirements with pass/fail status
- **Privilege escalation paths**: Diagram or list of role chains that enable escalation
- **Executive summary**: Total findings by severity, top risks, and recommended priority actions

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Permission denied reading config files | Insufficient filesystem access | Run with elevated permissions or request read access to the target directory |
| IAM CLI command not found | Cloud CLI tools not installed | Install `aws-cli`, `gcloud`, or `az` and authenticate before running cloud audits |
| Empty role/permission scan results | Incorrect glob patterns for the framework | Adjust search patterns to match the target framework (e.g., `@Roles()` for NestJS, `[Authorize]` for .NET) |
| Timeout scanning large codebases | Too many files in scope | Narrow the scan scope with `--exclude` patterns for `node_modules`, `vendor`, or `dist` directories |
| Inconsistent policy format | Mixed IAM policy versions or formats | Normalize policies to a single format before analysis; flag format inconsistencies in the report |

## Examples

### Auditing a Node.js Express API

Scan route definitions in `${CLAUDE_SKILL_DIR}/src/routes/` for missing authorization
middleware. Grep for `router.post`, `router.put`, `router.delete` and verify
each has a corresponding `authMiddleware` or `requireRole()` call. Flag any
state-changing endpoint lacking authorization as CWE-862 (Missing Authorization),
severity high.

### Reviewing AWS IAM Policies

Parse all JSON policy files in `${CLAUDE_SKILL_DIR}/infra/iam/`. Flag policies containing
`"Effect": "Allow"` with `"Resource": "*"` or `"Action": "*"` as CWE-269
(Improper Privilege Management), severity critical. Recommend scoping to specific
ARNs and actions per the principle of least privilege.

### RBAC Configuration Audit

Analyze role definitions in `${CLAUDE_SKILL_DIR}/config/roles.yaml`. Build a permission
matrix, identify roles with overlapping admin-level privileges, and flag any role
that can both create and approve its own resources as a separation-of-duties
violation (NIST AC-5), severity medium.

## Resources

- [OWASP Access Control Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Access_Control_Cheat_Sheet.html)
- [NIST SP 800-53 AC Controls](https://csf.tools/reference/nist-sp-800-53/r5/ac/)
- [CWE-269: Improper Privilege Management](https://cwe.mitre.org/data/definitions/269.html)
- [CWE-285: Improper Authorization](https://cwe.mitre.org/data/definitions/285.html)
- [CWE-862: Missing Authorization](https://cwe.mitre.org/data/definitions/862.html)
