本文へ移動
cccskills
無料GitHub で公開日本語紹介

configuration-users

ローカルユーザーの名前やメール、パスワード、APIキー、ロール、認証ルールをCaddyfileで登録・更新する設定を扱うスキルです。

原文原文の説明を見る

Configure static local accounts, required identity fields, trusted password imports, bcrypt API keys, roles, and stored challenge rules. Use for Caddyfile-owned users; online administration belongs to scripts-and-automation.

greenpau/caddy-securityスター 2,270(GitHub 2,270 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • ローカルユーザーを追加したいとき
  • 信頼できるパスワードハッシュを取り込みたいとき
  • ユーザーにロールやAPIキーを割り当てたいとき
  • 保存する認証ルールを設定したいとき

日本語での紹介

できること

ローカルIDストア内のユーザーエントリーをCaddyfileで定義し、新規アカウントの作成や一部項目のプロビジョニングを行います。名前、メールアドレス、パスワード、ロール、APIキー、認証チャレンジルールを指定できます。パスワードは平文からのbcrypt生成に加え、形式を確認したbcryptまたはArgon2ハッシュを取り込めます。既存ユーザーでは、指定したパスワードの上書き、APIキー設定、明示した認証ルールの置き換えが対象です。

こんなときに便利

Caddyfileで管理する固定ユーザーを追加するときや、ユーザーごとにロールや認証方法を定めたいときに使えます。パスワードやAPIキーを環境変数、シークレット参照から読み込む構成を確認する場合にも役立ちます。オンラインでのユーザー管理は別のスキルの対象です。

使い方の例

  • 「ローカルIDストアに管理者ユーザーを追加する設定を書いてください」
  • 「既存ユーザーのパスワードを上書きする方法を教えてください」
  • 「ユーザーにパスワードとTOTPの認証ルールを設定してください」

注意点

静的APIキーは24文字のキーIDとbcrypt形式の値が必要です。新規ユーザーには有効なメールアドレスとポリシーに合うパスワードが必要です。既存ユーザーの名前、メール、ロールは同期されず、設定したメールは保存済みの本人情報と一致させます。Caddyfileの認証ルールは認証要素を登録しません。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(3)

  • SKILL.md7.6 KB
  • agents/openai.yaml245 B
  • references/password-hashing.md7.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Configuration Users

Purpose

Use this skill for user <username> entries inside local identity store blocks. The Caddyfile syntax is authoritative in caddyfile_identity_store.go; the provisioning behavior is authoritative in the selected go-authcrunch module, especially pkg/ids/local/user.go, pkg/ids/local/authenticator.go, and pkg/identity/database.go.

The surrounding store belongs to configuration-identity-stores; account changes do not require reloading that router unless store settings change.

Shape

local identity store localdb {
	realm local
	path assets/config/users.json

	user alice {
		name "Alice Example"
		email alice@example.com
		password {env.ALICE_PASSWORD} overwrite
		roles authp/user authp/admin
		api key kid123456789012345678901 {env.ALICE_API_KEY_BCRYPT}
	}
}

kid123456789012345678901 is intentionally 24 characters. For static user API keys, authcrunch treats the Caddyfile key id as the API key prefix and currently requires exactly 24 characters.

Fields

The current Caddyfile parser supports only these subdirectives:

  • name <full name> with one or more words; multi-word names are joined with spaces.
  • email <address>.
  • password <plaintext_or_imported_hash> [overwrite].
  • roles <role> [<role>...].
  • api key <key_id> <bcrypt_value_or_secret_reference>.
  • auth challenges <rule body>; repeat to append ordered rules.

Use overwrite when the configured password should replace the existing stored password during provisioning. Supported passwords may be plaintext, bcrypt:<cost>:<hash>, or argon2:<PHC> imports. The unchanged plaintext path creates bcrypt hashes. Static API-key payloads remain bcrypt; password-import support does not change their format. Read password imports and generation for the exact Argon2 format, generation commands, resource limits, trusted-input boundary, and Caddy qualification.

Duplicate password updates can reuse the active hash while still advancing the account's credential version. Legacy records without credential_version remain supported. See local identity compatibility for update versus reset behavior, invalidation, and Caddy tests.

Static user blocks are not a full sync mechanism. During local store configuration, authcrunch creates the user when it does not exist. When the user already exists, password ... overwrite replaces its password; configured API keys are passed to the upstream key operation, and explicit challenge rules replace its stored rules. Name, email and roles are not synchronized. Keep the configured email consistent with the existing identity.

For api key, use a stable 24-character key id and a bcrypt-formatted payload or a placeholder/secret that resolves to one. Do not generate plaintext static API key payload examples.

Stored authentication rules

For example, inside user alice, repeat rule bodies in preference order:

auth challenges u2f
auth challenges password totp if u2f not available
auth challenges password if u2f and totp not available

The shared challenge parser validates the complete list. Methods are password, totp, u2f, and mfa; adjacent methods require all, or selects the first available choice, and if ... [and ...] not available tests registered credentials. Email challenges/conditions, duplicates, empty and malformed rules fail adaptation. Keywords must be literal. See the conditional transform grammar for selection, precedence and verified AMR. A matching transform policy can replace the stored selection.

Explicit static rules are applied both when creating and when provisioning an existing user. Omitting them preserves the stored policy; removing lines does not reset it. Caddyfile rules do not enroll factors. Ensure users have the credentials required by a rule or provide a deliberate fallback.

Use profile flow management for user-owned changes or an explicit reset with an empty challenges array. security local update user replaces rules through the server API, which requires a nonempty list. The static API-key directive still has no overwrite suffix; do not invent one from the upstream struct field.

Secrets

Prefer environment placeholders or secret lookups for passwords and API keys:

password "{env.USERS_ADMIN_SECRET}" overwrite
password "secrets:users/alice:password" overwrite
api key kid123456789012345678901 "secrets:users/alice:api_key"

Make sure API key placeholders and secret lookups resolve to a value in the bcrypt:<cost>:<hash> form.

Secret-backed values follow the manager contract and runtime field contract.

Review Checklist

Check generated local user entries against these code-backed constraints:

  • The entry is inside local identity store <name> { ... }, not an LDAP store.
  • The username is present and compatible with the local database policy; the default policy requires length 3-50.
  • New users have a password compatible with the local database policy; the default policy requires length 8-128. The default bcrypt creation path also rejects plaintext longer than 72 bytes; the policy's upper bound does not override that algorithm limit. Trusted imported hashes use their own format validation because the underlying plaintext length is unavailable.
  • email is a single valid address. Although its presence is not checked by the Caddyfile parser, new-user provisioning requires it; an existing user's configured username and email must identify the same stored account.
  • roles has at least one role when used.
  • Repeated auth challenges rules form one validated, ordered policy.
  • password overwrite has only the literal overwrite as its second argument.
  • api key has exactly key, a 24-character key id, and one payload value.
  • Static API key payloads are bcrypt-formatted or resolve to bcrypt-formatted values.

Fixtures

Use these examples:

  • caddyfile_identity_store.go for accepted Caddyfile subdirectives.
  • caddyfile_identity_store_test.go for local store parser coverage.
  • testcase_authenticate_with_argon2 for quoted imports, adapt-time environment expansion, runtime placeholders, bcrypt and plaintext compatibility.
  • TestPasswordImportAdaptAndResolve, TestPasswordImportProvisioningRejectsMalformed and TestCaddyPasswordArgon2E2E for preservation, redacted rejection and actual executable TLS login, restart, overwrite and public self-service boundaries.
  • testcase_authenticate_with_challenges for adaptation and resolution.
  • TestCaddyAuthenticationChallengesE2E for stored policy creation, replacement, omission, native login and profile policy management through Caddy.
  • testdata/caddyfile_adapt/testcase_security_authentication_portal.Caddyfile.

testcase_security_with_secrets contains the static API-key lookup form. TestIdentityStoreSecretsFixture checks its local-user block independently of the optional external module, and the challenge E2E provisions a bcrypt API key through the Caddyfile and exercises native login and policy rejection.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

authentication-portal-api

無料概要あり

認証ポータルのログインやトークン更新、プロフィール、管理APIを利用するHTTPクライアントの仕様確認とトラブル対応を支援します。

  • ポータル向けJSONログインを実装したいとき
  • ブラウザーのトークン更新を調べたいとき
  • ネイティブ認証APIを扱いたいとき
greenpau/caddy-security2,2702026年10月28日 更新

break-fix-troubleshooting

無料概要あり

Caddyの認証・認可まわりで起きた設定や実行時の障害を、設定ファイル、ログ、バージョン、HTTPの証拠から切り分け、最小修正や調査報告にまとめます。

  • ログイン障害の原因を調べたいとき
  • OIDCやSAMLの失敗を切り分けたいとき
  • 最小限の設定修正を探したいとき
greenpau/caddy-security2,2702026年10月28日 更新

coding-directives

無料概要あり

caddy-securityのGoコードやCaddyモジュール、Caddyfileパーサー、HTTP連携の実装・レビューで、境界やライフサイクル、エラー処理の規約を確認するスキルです。

  • Caddyfileパーサーの変更をレビューしたいとき
  • CaddyモジュールやHTTP処理を実装したいとき
  • アプリの起動・終了処理を確認したいとき
greenpau/caddy-security2,2702026年10月28日 更新

configuration

無料概要あり

caddy-securityのCaddyfile全体を作成・点検し、認証方式に合う設定ガイドを選びながらsecurityアプリとHTTPルートを配線するスキルです。

  • Caddyfile全体を作成したいとき
  • 認証ポータルをルートに接続したいとき
  • 保護対象パスに認可ポリシーを設定したいとき
greenpau/caddy-security2,2702026年10月28日 更新

Caddyの認証ポータルとルートへの認証処理を設定し、利用するログイン元やリダイレクト先の信頼条件、更新機能などを組み立てるスキルです。

  • 認証ポータルを新しく構成したいとき
  • ログインに使うストアやプロバイダーを選びたいとき
  • 保護ルートをポータル認証につなぎたいとき
greenpau/caddy-security2,2702026年10月28日 更新

認証ポータルのCookie名や接頭辞、属性、ドメインを設定し、認可ポリシーが探すトークンCookieとの対応を整えます。

  • ポータルのCookie名を一括で変更したいとき
  • Cookie属性やドメインを調整したいとき
  • 更新トークン用Cookie名を上書きしたいとき
greenpau/caddy-security2,2702026年10月28日 更新

greenpau のスキルをすべて見る

このスキルの問題を報告する