Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

claude-security-settingsClaude 安全 settings

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

1,469

周安装

60

GitHub Stars

28

下载量

470
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:claude-security-settings(Claude 安全 settings)
来源仓库:https://github.com/laurigates/claude-plugins
仓库路径:skills/claude-security-settings
安装命令:
npx skills add https://github.com/laurigates/claude-plugins --skill claude-security-settings
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill claude-security-settings

简介

Claude Code 安全设置技能用于权限审计与配置管理。

  • 支持权限通配符控制、Shell 操作保护和项目级安全策略配置。
  • 通过 settings.json 文件实现多层级权限管理,按优先级覆盖用户与项目设置。
  • 涉及敏感操作时应验证最小权限原则,避免直接在生产环境启用高危权限。
  • claude-security-settings 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Claude Code Security Settings

Expert knowledge for configuring Claude Code security and permissions.

Core Concepts

Claude Code provides multiple layers of security:

  1. Permission wildcards - Granular tool access control
  2. Shell operator protections - Prevents command injection
  3. Project-level settings - Scoped configurations

Permission Configuration

Settings File Locations

FileScopePriority
~/.claude/settings.jsonUser-level (all projects)Lowest
.claude/settings.jsonProject-level (committed)Medium
.claude/settings.local.jsonLocal project (gitignored)Highest

Permission Structure

{
  "permissions": {
    "allow": [
      "Bash(git status *)",
      "Bash(npm run *)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(sudo *)"
    ]
  }
}

Wildcard Permission Patterns

Syntax

Bash(command *)
  • Bash() - Tool identifier
  • command - Command prefix to match
  • * - Wildcard suffix matching any arguments
  • :ask suffix - Always prompt for user confirmation (e.g., Bash(git push *):ask)

Permission Tiers

TierBehaviorExample
allowAuto-allowed, no prompt"allow": ["Bash(git status *)"]
askAlways prompts for confirmation"allow": ["Bash(git push *):ask"]
denyAuto-denied, blocked"deny": ["Bash(rm -rf *)"]

Pattern Examples

PatternMatchesDoes NOT Match
Bash(git *)git status, git diff HEADgit-lfs pull
Bash(npm run *)npm run test, npm run buildnpm install
Bash(gh pr *)gh pr view 123, gh pr creategh issue list
Bash(./scripts/ *)./scripts/test.sh, ./scripts/build.sh/scripts/other.sh

Pattern Best Practices

Granular permissions:

{
  "permissions": {
    "allow": [
      "Bash(git status *)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git add *)",
      "Bash(git commit *)"
    ]
  }
}

Tool-specific patterns:

{
  "permissions": {
    "allow": [
      "Bash(bun test *)",
      "Bash(bun run *)",
      "Bash(biome check *)",
      "Bash(prettier *)"
    ]
  }
}

Shell Operator Protections

Claude Code 2.1.7+ includes built-in protections against dangerous shell operators.

Protected Operators

OperatorRiskBlocked Example
&&Command chainingls && rm -rf /
`\\`Conditional execution`false \\malicious`
;Command separationsafe; dangerous
`\`Piping`cat /etc/passwd \curl`
> / >>Redirectionecho x > /etc/passwd
$()Command substitution$(curl evil)
` ``Backtick substitution` rm -rf / `

Security Behavior

When a command contains shell operators:

  1. Permission wildcards won't match
  2. User sees explicit approval prompt
  3. Warning explains the blocked operator

Safe Compound Commands

For legitimate compound commands, use scripts:

#!/bin/bash
# scripts/deploy.sh
npm test && npm run build && npm run deploy

Then allow the script:

{
  "permissions": {
    "allow": ["Bash(./scripts/deploy.sh *)"]
  }
}

Common Permission Sets

Read-Only Development

{
  "permissions": {
    "allow": [
      "Bash(git status *)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git branch *)",
      "Bash(npm list *)",
      "Bash(bun pm ls *)"
    ]
  }
}

Full Git Workflow

{
  "permissions": {
    "allow": [
      "Bash(git status *)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git branch *)",
      "Bash(git add *)",
      "Bash(git commit *)",
      "Bash(git push *)",
      "Bash(git pull *)",
      "Bash(git fetch *)",
      "Bash(git checkout *)",
      "Bash(git merge *)",
      "Bash(git rebase *)"
    ]
  }
}

CI/CD Operations

{
  "permissions": {
    "allow": [
      "Bash(gh pr *)",
      "Bash(gh run *)",
      "Bash(gh issue *)",
      "Bash(gh workflow *)"
    ]
  }
}

Testing & Linting

{
  "permissions": {
    "allow": [
      "Bash(bun test *)",
      "Bash(npm test *)",
      "Bash(vitest *)",
      "Bash(jest *)",
      "Bash(biome *)",
      "Bash(eslint *)",
      "Bash(prettier *)"
    ]
  }
}

Security Scanning

{
  "permissions": {
    "allow": [
      "Bash(pre-commit *)",
      "Bash(gitleaks *)",
      "Bash(trivy *)"
    ]
  }
}

Project Setup Guide

1. Create Settings Directory

mkdir -p .claude

2. Create Project Settings

cat > .claude/settings.json << 'EOF'
{
  "permissions": {
    "allow": [
      "Bash(git status *)",
      "Bash(git diff *)",
      "Bash(npm run *)"
    ]
  }
}
EOF

3. Add to.gitignore (for local settings)

echo ".claude/settings.local.json" >> .gitignore

4. Create Local Settings (optional)

cat > .claude/settings.local.json << 'EOF'
{
  "permissions": {
    "allow": [
      "Bash(docker *)"
    ]
  }
}
EOF

Agentic Optimizations

ContextCommand
View project settings`cat.claude/settings.json \jq '.permissions'`
View user settings`cat ~/.claude/settings.json \jq '.permissions'`
Check merged permissionsReview effective settings in Claude Code
Validate JSON`cat.claude/settings.json \jq.`

Quick Reference

Permission Priority

Settings merge with this priority (highest wins):

  1. .claude/settings.local.json (local)
  2. .claude/settings.json (project)
  3. ~/.claude/settings.json (user)

Wildcard Syntax

SyntaxMeaning
Bash(cmd *)Match cmd with any arguments
Bash(cmd arg *)Match cmd arg with any following
Bash(./script.sh *)Match specific script

Deny Patterns

Block specific commands:

{
  "permissions": {
    "deny": [
      "Bash(rm -rf *)",
      "Bash(sudo *)",
      "Bash(chmod 777 *)"
    ]
  }
}

Error Handling

ErrorCauseFix
Permission deniedPattern doesn't matchAdd more specific pattern
Shell operator blockedContains &&, `\`, etc.Use script wrapper
Settings not appliedWrong file locationCheck path and syntax
JSON parse errorInvalid JSONValidate with jq.

Best Practices

  1. Start restrictive - Add permissions as needed
  2. Use project settings - Keep team aligned
  3. Use specific Bash patterns - Bash(git status *) over Bash
  4. Script compound commands - For && and \| workflows
  5. Review periodically - Remove unused permissions

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.08%
按下载量换算174

Claude

30.86%
按下载量换算145

Cursor

16.96%
按下载量换算80

Gemini CLI

8.67%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/laurigates/claude-plugins --skill claude-security-settings 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills