Agent Skillssupercheck-io/supercheck › supercheck-security-auth

supercheck-security-auth

GitHub

规范 Supercheck 系统的认证、RBAC、租户隔离及密钥管理流程,涵盖会话安全、OAuth 配置、权限校验及敏感数据加密存储标准。

.agents/skills/security-auth/SKILL.md supercheck-io/supercheck

Trigger Scenarios

涉及身份认证与会话管理 实现基于角色的访问控制 处理 API 密钥与触发令牌 配置 OAuth 集成 进行安全敏感路由开发

Install

npx skills add supercheck-io/supercheck --skill supercheck-security-auth -g -y
More Options

Non-standard path

npx skills add https://github.com/supercheck-io/supercheck/tree/main/.agents/skills/security-auth -g -y

Use without installing

npx skills use supercheck-io/supercheck@supercheck-security-auth

指定 Agent (Claude Code)

npx skills add supercheck-io/supercheck --skill supercheck-security-auth -a claude-code -g -y

安装 repo 全部 skill

npx skills add supercheck-io/supercheck --all -g -y

预览 repo 内 skill

npx skills add supercheck-io/supercheck --list

SKILL.md

Frontmatter
{
    "name": "supercheck-security-auth",
    "description": "Work on Supercheck authentication, RBAC, tenant isolation, sessions, API and trigger keys, invitations, project membership, project variables, OAuth, super-admin behavior, SSRF, or security-sensitive routes."
}

Supercheck security and authentication

flowchart LR
  REQ[Cookie or bearer request] --> AUTH[Resolve identity]
  AUTH --> SCOPE[Resolve organization/project]
  SCOPE --> RBAC{Authorize exact action}
  RBAC -->|allow| VALIDATE[Validate input]
  VALIDATE --> QUERY[Scoped operation]
  RBAC -->|deny| DENY[401 or 403]

Authentication

  • Better Auth owns browser sessions, users, organizations, and membership. Do not add NextAuth patterns.
  • Browser routes may use session cookies. CLI and API-key routes require bearer-compatible auth context.
  • Never use a cookie-only permission helper in an API route that supports CLI bearer tokens.
  • Return 401 when identity is absent/invalid and 403 when an authenticated identity lacks permission.
  • Session cookies retain secure, HTTP-only, same-site, domain, expiration, revocation, and proxy-aware behavior.
  • OAuth redirect URLs must exactly match provider configuration. GitHub applications require access to user email; Google requires configured consent and callback URLs.

Roles, membership, and scope

  • Read canonical resources, actions, and roles from app/src/lib/rbac; never recreate role strings or a second permission matrix.
  • Resolve tenant context before data access. IDs supplied by clients are selectors, not proof of ownership.
  • Organization resources scope to the authenticated organization. Project resources additionally verify project ownership/membership.
  • Project admins/editors require the applicable project membership relationship. Organization-wide privileges apply only through central RBAC rules.
  • Invitations validate organization/project, role eligibility, normalized email, expiry, reuse/acceptance state, and inviter authority.
  • Super-admin routes require explicit global-admin authorization and must not reuse ordinary tenant authorization as a shortcut.
  • Security, membership, secret, administration, and billing mutations produce redacted audit events.

API and trigger keys

  • CLI/session API tokens, test keys, and job trigger keys are different credential classes. Validate type, prefix/current format, expiry, enabled state, scope, and allowed operation.
  • Store credential material according to the current one-time-display/hash design; never make plaintext recoverable through list/get APIs.
  • Token lists expose safe metadata only. Creation returns a plaintext token only at the intended one-time boundary.
  • Rate-limit authentication and credential-sensitive endpoints and return useful retry metadata where supported.
  • Do not put tokens in repository config, URLs, logs, analytics, error messages, queue payloads, or client persistence beyond the intended secure store.

Project variables and encryption

  • Encrypt secret values server-side with the current scoped encryption context and split keys.
  • List/read APIs return redacted metadata for secrets. Decryption occurs only immediately before authorized isolated execution.
  • Never enqueue decrypted variables or persist them in capacity/job payloads.
  • File variables use the supported upload path and size/type controls. They are not serialized into CLI config.
  • Playwright and k6 variable/file semantics differ. In k6, readFile() is unsupported; use open(getFile('KEY')) during init.
  • Redact resolved secret values from stdout, stderr, execution logs, notifications, traces, and error objects.

Input, browser, and network security

  • Use shared Zod schemas and size/shape bounds for all untrusted data.
  • User-controlled outbound URLs use the shared pinned-public-fetch/SSRF policy. Validate protocol, resolution, every redirect, and final connection target; block private/reserved ranges and metadata endpoints, including IPv4/IPv6 transition forms.
  • Browser messages require event.source, exact parsed origin, allowed protocol/hostname, and schema-valid payloads. Use exact targetOrigin, never *, for privileged communication.
  • Preserve CSRF, CSP, origin, proxy-header, upload, and response-field allowlisting protections.
  • Provider/webhook signatures are verified before parsing side effects; webhook processing is idempotent and tenant-bound.

Required negative tests

  • Cross-organization and cross-project reads/writes.
  • Cookie versus bearer callers for dual-auth routes.
  • Wrong role/action, revoked/expired/wrong-type keys, reused invitations, and super-admin denial.
  • Secret redaction in API output, logs, queues, and failures.
  • SSRF through redirects, DNS rebinding, alternate IP forms, localhost/private/metadata targets.
  • Forged browser origins/sources and malformed messages.

Version History

  • 974a753 Current 2026-09-22 16:22

Same Skill Collection

.agents/skills/architecture/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/data-storage/SKILL.md
.agents/skills/execution-engine/SKILL.md
.agents/skills/feature-implementation/SKILL.md
.agents/skills/infrastructure-deployment/SKILL.md
.agents/skills/integrations-extensions/SKILL.md
.agents/skills/monitoring-alerts/SKILL.md
.agents/skills/platform-features/SKILL.md
.agents/skills/sre-operations/SKILL.md
.agents/skills/testing-qa/SKILL.md
.github/skills/code-review/SKILL.md
.github/skills/docker-compose-deployment/SKILL.md
.github/skills/feature-implementation/SKILL.md

Metadata

Files
0
Version
974a753
Hash
400ef091
Indexed
2026-09-22 16:22

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 12:50
浙ICP备14020137号-1