Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

enforcing-password-policies执行密码策略

Agent Skill

enforcing-password-policies 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

392

周安装

16

GitHub Stars

9

下载量

125
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill enforcing-password-policies

简介

执行密码策略用于配置和加强 CockroachDB 集群的密码安全设置。

  • 适用于提升合规性、应对审计或增强抗暴力破解能力的生产环境。
  • 可设置最小长度、bcrypt 哈希成本和登录限流等策略参数。
  • 安装前应验证目标集群权限,避免误操作影响生产认证流程。
  • 涉及敏感配置变更时,建议先在测试环境验证策略效果。

SKILL.md

Enforcing Password Policies

Configures and enforces password policies on CockroachDB clusters by setting minimum password length, bcrypt hash cost, and login throttling. Ensures password strength meets organizational and compliance requirements.

When to Use This Skill

  • Strengthening password requirements to meet compliance standards (SOC 2, HIPAA, NIST 800-63B)
  • Setting up password policies for a new production cluster
  • Responding to a security audit finding about weak password policies
  • Increasing bcrypt hash cost to improve resistance against brute-force attacks
  • Configuring login throttling to mitigate credential stuffing

Prerequisites

  • SQL access with admin role (required to modify cluster settings)
  • Understanding of impact: Password policy changes affect new passwords only, not existing passwords

Check your access:

SELECT member FROM [SHOW GRANTS ON ROLE admin] WHERE member = current_user();

Steps

1. Check Current Password Policy Settings

-- Minimum password length
SHOW CLUSTER SETTING server.user_login.min_password_length;

-- Password hash cost (bcrypt rounds)
SHOW CLUSTER SETTING server.user_login.password_hashes.default_cost.crdb_bcrypt;

-- Login attempt throttling
SHOW CLUSTER SETTING server.user_login.password.min_delay;
SHOW CLUSTER SETTING server.user_login.password.max_delay;

See SQL queries reference for additional password-related queries.

2. Set Minimum Password Length

-- Set minimum password length to 12 characters (recommended)
SET CLUSTER SETTING server.user_login.min_password_length = 12;

Recommended minimums by compliance framework:

FrameworkMinimum LengthRecommendation
NIST 800-63B8 characters12+ recommended
SOC 28 characters12+ recommended
HIPAA8 characters12+ recommended
PCI DSS7 characters12+ recommended
Internal best practice14+ for admin accounts

3. Configure Hash Cost

The bcrypt hash cost controls how computationally expensive password hashing is. Higher values make brute-force attacks slower but increase CPU during authentication.

-- Set bcrypt hash cost (default: 10, recommended: 12)
SET CLUSTER SETTING server.user_login.password_hashes.default_cost.crdb_bcrypt = 12;

Hash cost guidance:

CostTime per Hash (approx.)Recommendation
10~100msDefault, acceptable for most
12~400msRecommended for production
14~1.5sHigh security, slower logins

Trade-off: Higher cost means slower password verification, which affects login latency. Cost 12 is a good balance.

4. Configure Login Throttling

Login throttling introduces delays after failed authentication attempts to slow down brute-force attacks.

-- Minimum delay after failed login attempt
SET CLUSTER SETTING server.user_login.password.min_delay = '0.5s';

-- Maximum delay after repeated failures
SET CLUSTER SETTING server.user_login.password.max_delay = '10s';

The delay increases exponentially between min_delay and max_delay with each consecutive failed attempt.

5. Verify Enforcement

-- Confirm settings
SHOW CLUSTER SETTING server.user_login.min_password_length;
SHOW CLUSTER SETTING server.user_login.password_hashes.default_cost.crdb_bcrypt;
SHOW CLUSTER SETTING server.user_login.password.min_delay;
SHOW CLUSTER SETTING server.user_login.password.max_delay;

Test enforcement:

-- This should fail if min_password_length is 12
CREATE USER test_weak_password WITH PASSWORD 'short';
-- Expected: ERROR: password too short

-- This should succeed
CREATE USER test_strong_password WITH PASSWORD 'a-secure-password-123';
DROP USER test_strong_password;

6. Address Existing Users with Weak Passwords

Password policy changes only apply to new passwords. Existing users retain their old passwords until they change them.

Options for enforcing password rotation:

  1. Communicate the policy change and ask users to update their passwords
  2. Expire existing passwords by requiring a password change on next login (if supported by your application layer)
  3. Reset passwords administratively for critical accounts:
-- Reset a user's password (forces them to use a new, policy-compliant password)
ALTER USER <username> WITH PASSWORD '<new-strong-password>';

7. Manage Password Changes and Rotation

User Self-Service Password Changes

SQL users can change their own passwords:

-- User changes their own password
ALTER USER current_user() WITH PASSWORD '<new-password>';

Note: Non-admin users can change their own passwords by default. If users report they cannot change their password, verify they are connected as the correct user and that there are no HBA rules blocking password-based authentication.

Administrative Password Reset

-- Admin resets another user's password
ALTER USER <username> WITH PASSWORD '<new-strong-password>';

-- Verify the user exists before resetting
SELECT username FROM [SHOW USERS] WHERE username = '<username>';

Cloud Console vs SQL Passwords

CockroachDB Cloud has two separate password domains:

  • Cloud Console password — Managed via Cloud Console UI or SSO. Reset via the Cloud Console login page "Forgot password" flow.
  • SQL user password — Managed via SQL ALTER USER. Independent of the Cloud Console password.

Changing one does not affect the other. Users must manage both if they use both access methods.

Password Rotation Best Practices

  • Rotate service account passwords on a regular schedule (e.g., every 90 days)
  • Use certificate-based authentication for service accounts to avoid password rotation entirely
  • Coordinate password rotation with application deployment cycles to avoid downtime
  • After changing a password, verify the application can connect with the new credentials before decommissioning the old password

8. Troubleshoot Common Password Errors

"password too short"

The password does not meet the min_password_length setting.

-- Check the current minimum
SHOW CLUSTER SETTING server.user_login.min_password_length;

Fix: Use a longer password that meets or exceeds the minimum length.

"bcrypt password hash too long"

The password exceeds the bcrypt input limit of 72 bytes. This can occur with very long passwords or multi-byte Unicode characters.

-- Workaround: use a shorter password (under 72 bytes)
ALTER USER <username> WITH PASSWORD '<shorter-password>';

This is a bcrypt limitation, not a CockroachDB-specific issue.

Authentication failures after password change

If users report authentication failures immediately after changing their password:

  1. Verify the password was set correctly (no copy-paste whitespace)
  2. Check for connection pool caching of old credentials — restart the connection pool
  3. Verify the HBA configuration allows password authentication: SHOW CLUSTER SETTING server.host_based_authentication.configuration;
  4. Check login throttling delays if there were failed attempts: SHOW CLUSTER SETTING server.user_login.password.min_delay; SHOW CLUSTER SETTING server.user_login.password.max_delay;

Safety Considerations

  • New passwords only: Changing min_password_length does not invalidate existing passwords. Users with short passwords can still log in until they change their password.
  • Hash cost latency: Increasing crdb_bcrypt cost increases login time. Test with realistic connection pools before setting cost above 12.
  • Throttling impact: Login throttling delays affect all users after failed attempts, including legitimate users who mistype their password.
  • Service accounts: Ensure service accounts use strong passwords or certificate-based authentication (certificates bypass password policy).

Rollback

-- Reset minimum password length to default (1 = no minimum)
SET CLUSTER SETTING server.user_login.min_password_length = 1;

-- Reset hash cost to default
RESET CLUSTER SETTING server.user_login.password_hashes.default_cost.crdb_bcrypt;

-- Reset login throttling to defaults
RESET CLUSTER SETTING server.user_login.password.min_delay;
RESET CLUSTER SETTING server.user_login.password.max_delay;

References

Skill references:

Related skills:

Official CockroachDB Documentation:

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.25%
按下载量换算44

Claude

27.46%
按下载量换算34

Cursor

19.76%
按下载量换算25

Gemini CLI

9.6%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills