Logo Auditing Api Key And Token Lifecycle

Auditing Api Key And Token Lifecycle

Tổ chức
UnboundCompute
auditing-api-key-and-token-lifecycle

Audit the lifecycle of API keys and access tokens for weaknesses that let one keep working past its intended bounds: a key issued with broader scope than the caller needs so a leak grants far more than one function, a key or token with no expiry that stays valid indefinitely, a revocation path that does not actually stop the key so a rotated or compromised credential keeps authenticating, a key that leaks into logs, URLs, client-side code, or error messages and is never rotated, and a token whose scope or audience is not enforced on use so it works against endpoints it was never meant for. Use when a long-lived programmatic credential authenticates a caller and the bounds on that credential (scope, expiry, revocability) are the boundary. The over-scoped, unexpiring, or leaked key is the source, the access it grants past its intended bounds is the sink, and the missing scope limit, expiry, or working revocation is the bug.

Tổng quan

Nhà phát hànhUnboundCompute
Kho mãsecurity-agent-skills
Tên kỹ năngauditing-api-key-and-token-lifecycle
Sao
27
Bản fork
8
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được UnboundCompute công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Auditing Api Key And Token Lifecycle trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-api-key-and-token-lifecycle
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-api-key-and-token-lifecycle .claude/skills/auditing-api-key-and-token-lifecycle
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Auditing Api Key And Token Lifecycle trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Auditing Api Key And Token Lifecycle ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Auditing Api Key And Token Lifecycle với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Auditing API key and token lifecycle: a key is a standing credential, so bound it and be able to kill it

An API key or long-lived access token is a bearer credential: whoever holds it is the caller, with no second factor and often no user behind it. That makes the whole security of the key a question of its lifecycle, how narrowly it is scoped, whether it expires, whether you can actually revoke it, and where it might leak, because the moment one of those is loose, a single leaked string becomes standing access. A key issued with broader scope than its caller needs means a leak grants far more than the one function it was for. A key with no expiry stays valid forever, so a credential stolen once works until someone notices, which is often never. A revocation path that does not truly stop the key, a rotation that leaves the old key live, a disable that a cache ignores, means a compromised credential keeps authenticating after you believed you killed it. A key that leaks into logs, URLs, client-side code, or error messages and is never rotated is a published password. And a token whose scope or audience is not enforced on use works against endpoints it was never issued for. The audit follows each key from issuance to revocation and checks it is minimally scoped, expiring, truly revocable, and enforced on use. You audit this by holding a key and testing what it can reach, how long it lasts, and whether you can stop it.

When to use

  • A service issues API keys or long-lived access tokens that authenticate programmatic callers.
  • Keys may be issued with broad scope, no expiry, or without a working revocation path.
  • A key may leak into logs, URLs, or client code, or a token's scope or audience may not be enforced on use.

Scope check

Test key and token lifecycle only against services and credentials you own or are authorized to assess, with test keys. Issuing, exercising, and revoking keys changes real access state, so use test credentials and never use, rotate, or revoke a key that is not yours. If you can't name the authorization, stop.

The loop

  1. Establish each key's intended bounds first. For every kind of key or token, name the minimal scope its caller needs, its intended lifetime, how it is meant to be revoked, and where it is supposed to live. This is the false-positive killer: a key issued with least-privilege scope, a bounded expiry, a revocation path that provably stops it, and no exposure in logs or URLs is behaving correctly. Name the intended bounds, then test each one.

  2. Test scope against need. Compare what each key can actually do against what its caller needs. Exercise the key against endpoints and operations outside its stated purpose and confirm they are refused. A key that carries broad or account-wide scope for a narrow task means any leak of it grants far more than the one function, so confirm keys are minimally scoped.

  3. Test expiry. Determine whether each key or token has an expiry and confirm it is enforced: use a key past its intended lifetime and confirm it is rejected. A key with no expiry stays valid indefinitely, so a credential stolen once works forever; confirm long-lived keys have a bounded, enforced lifetime.

  4. Test revocation and rotation. Revoke and rotate a key, then attempt to keep using the old value. Confirm the revoked or rotated key stops working promptly everywhere, including behind any caching or replica. A revocation that leaves the old key live, or a rotation that does not disable the previous key, means a compromised credential you believed you killed still authenticates.

  5. Check for leakage and enforcement on use. Look for keys in logs, URLs and query strings, client-side code, error messages, and referrer headers, and confirm any exposed key is rotated. Separately, for tokens with a scope or audience claim, confirm it is enforced on use so the token only works against its intended endpoints. A leaked-and-never-rotated key and a token whose scope is not checked on use are both live access past the intended bounds.

  6. Confirm and record. Confirm with test keys by using an over-scoped key beyond its function, an unexpiring key past its intended life, a revoked or rotated key that still works, or a token against an endpoint outside its audience, without touching real credentials. Kill the lead if keys are least-privilege scoped, expiring, provably revocable, unexposed, and scope-enforced on use. Record the over-scoped, unexpiring, or leaked key, the access it grants past its bounds, and the missing scope limit, expiry, or working revocation.

Where key lifecycle leaks

  • Over-scoped keys. A key with broader scope than its caller needs turns any leak into access far beyond the one function it was issued for.
  • No expiry. A key or token with no bounded lifetime stays valid indefinitely, so a credential stolen once keeps working until someone happens to notice.
  • Revocation that does not stop the key. A revoke or rotate that leaves the old value live, or that a cache or replica ignores, means a compromised credential still authenticates after you believed it was killed.
  • Leakage without rotation. A key exposed in logs, URLs, client code, or error messages and never rotated is a published credential anyone who saw it can use.
  • Scope or audience not enforced on use. A token whose scope or audience claim is not checked when it is used works against endpoints it was never issued for.

Worked example (a confirm and a kill)

Confirm. A service issues API keys that all carry account-wide scope regardless of the integration, never expire, and are logged in full in the request access log. On a test account, a key issued for a single read-only integration is used to perform account-wide write operations, still works months later with no expiry, and is recovered verbatim from a log line, and rotating it leaves the previous key authenticating. Confirmed over-scoped, unexpiring, leaked, and non-revoking key lifecycle, high, remediation = issue least-privilege scoped keys, set and enforce a bounded expiry, stop logging key values, and make rotation immediately disable the previous key everywhere.

Kill. Each key is issued with least-privilege scope enforced on every call, carries a bounded enforced expiry, is never written to logs or URLs, and rotation or revocation disables the old value promptly across all nodes and caches; tokens' scope and audience are checked on use. An over-scope call is refused, an expired key is rejected, a revoked key stops working immediately, and no key appears in any log. Killed, kill_reason = "keys are least-privilege scoped, expiring, provably revocable, unexposed, and scope-enforced on use; no key grants access past its intended bounds."

Rationalizations to reject

  • "The key is secret." → Bearer keys leak, into logs, URLs, and repos; scope it minimally, expire it, and be able to revoke it so a leak is bounded rather than total.
  • "It is a machine-to-machine key, it needs to last." → Long-lived is not the same as unexpiring or unrevocable; give it a bounded lifetime and a working rotation so a compromise has an end.
  • "We rotated the key." → Confirm the old key actually stopped working everywhere; a rotation that leaves the previous value live has not revoked anything.
  • "Broad scope is simpler." → Broad scope makes every leak catastrophic; issue a narrow key per integration so a leak grants only that one function.
  • "The token says what it is for." → A scope or audience claim only protects if it is enforced on use; confirm the endpoint rejects a token issued for a different audience or scope.

Executing this in practice

You need each key type's scope, expiry, and revocation mechanism, where keys are stored and whether they appear in logs or URLs, and whether token scope and audience are enforced on use. With test keys, exercise a key beyond its scope, past its expiry, and after revocation, and search logs and client code for exposed values. Reading the issuance and enforcement path shows the intended bounds; a key that works out of scope, past expiry, or after revocation shows where the bounds fail.

Related

  • auditing-service-account-key-lifecycle - the service-account-specific case; a service account's key is a long-lived credential with the same scope, expiry, and rotation questions.
  • auditing-oauth-token-audience-and-scope-trust - the audience and scope enforcement for OAuth tokens; this skill covers the broader key lifecycle around it.
  • hunting-non-human-identity-and-secret-reachability - where a leaked or reachable key can be found; that skill hunts the exposure this one bounds.
  • reviewing-secrets-manager-access-policy-trust - the storage and access policy for the keys; a well-scoped key still needs a sound policy on where it lives.
  • FINDING-SCHEMA.md - source = the over-scoped, unexpiring, or leaked key, sink = the access it grants past its intended bounds, evidence = the missing scope limit, expiry, or working revocation.

Câu hỏi thường gặp

Kỹ năng AI Auditing Api Key And Token Lifecycle làm được gì?

Audit the lifecycle of API keys and access tokens for weaknesses that let one keep working past its intended bounds: a key issued with broader scope than the caller needs so a leak grants far more than one function, a key or token with no expiry that stays valid indefinitely, a revocation path that does not actually stop the key so a rotated or compromised credential keeps authenticating, a key that leaks into logs, URLs, client-side code, or error messages and is never rotated, and a token whose scope or audience is not enforced on use so it works against endpoints it was never meant for....

Vì sao nên dùng Auditing Api Key And Token Lifecycle trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Auditing Api Key And Token Lifecycle là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Auditing Api Key And Token Lifecycle trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-api-key-and-token-lifecycle. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Auditing Api Key And Token Lifecycle?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Auditing Api Key And Token Lifecycle với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Auditing Api Key And Token Lifecycle với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Auditing Api Key And Token Lifecycle có miễn phí không?

Có. Kỹ năng này được UnboundCompute phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇