Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计通过

mapbox-token-securityMapbox 令牌安全

Agent Skill

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

总安装

960

周安装

40

GitHub Stars

44

下载量

320
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mapbox/mcp-devkit-server --skill mapbox-token-security

简介

用于辅助安全审计、权限检查和认证流程分析。

  • 支持梳理敏感配置、检查依赖风险和生成安全复核清单。
  • 通过 npx skills add 命令从 GitHub 仓库安装使用。
  • 不能将工具输出直接作为最终结论,涉及密钥时应先确认最小权限。
  • mapbox-token-security 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Mapbox Token Security Skill

This skill provides security expertise for managing Mapbox access tokens safely and effectively.

Token Types and When to Use Them

Public Tokens (pk.*)

Characteristics:

  • Can be safely exposed in client-side code
  • Limited to specific public scopes only
  • Can have URL restrictions
  • Cannot access sensitive APIs

When to use:

  • Client-side web applications
  • Mobile apps
  • Public-facing demos
  • Embedded maps on websites

Allowed scopes:

  • styles:tiles - Display style tiles (raster)
  • styles:read - Read style specifications
  • fonts:read - Access Mapbox fonts
  • datasets:read - Read dataset data
  • vision:read - Vision API access

Secret Tokens (sk.*)

Characteristics:

  • NEVER expose in client-side code
  • Full API access with any scopes
  • Server-side use only
  • Can create/manage other tokens

When to use:

  • Server-side applications
  • Backend services
  • CI/CD pipelines
  • Administrative tasks
  • Token management

Common scopes:

  • styles:write - Create/modify styles
  • styles:list - List all styles
  • tokens:read - View token information
  • tokens:write - Create/modify tokens
  • User feedback management scopes

Temporary Tokens (tk.*)

Characteristics:

  • Short-lived (max 1 hour)
  • Created by secret tokens
  • Single-purpose use
  • Automatically expire

When to use:

  • One-time operations
  • Temporary delegated access
  • Short-lived demos
  • Security-conscious workflows

Scope Management Best Practices

Principle of Least Privilege

Always grant the minimum scopes needed:

Bad:

// Overly permissive - don't do this
{
  scopes: [
    'styles:read',
    'styles:write',
    'styles:list',
    'styles:delete',
    'tokens:read',
    'tokens:write'
  ];
}

Good:

// Only what's needed for displaying a map
{
  scopes: ['styles:read', 'fonts:read'];
}

Scope Combinations by Use Case

Public Map Display (client-side):

{
  "scopes": ["styles:read", "fonts:read", "styles:tiles"],
  "note": "Public token for map display",
  "allowedUrls": ["https://myapp.com/*"]
}

Style Management (server-side):

{
  "scopes": ["styles:read", "styles:write", "styles:list"],
  "note": "Backend style management - SECRET TOKEN"
}

Token Administration (server-side):

{
  "scopes": ["tokens:read", "tokens:write"],
  "note": "Token management only - SECRET TOKEN"
}

Read-Only Access:

{
  "scopes": ["styles:list", "styles:read", "tokens:read"],
  "note": "Auditing/monitoring - SECRET TOKEN"
}

URL Restrictions

Why URL Restrictions Matter

URL restrictions limit where a public token can be used, preventing unauthorized usage if the token is exposed.

Effective URL Patterns

Recommended patterns:

https://myapp.com/*           # Production domain
https://*.myapp.com/*         # All subdomains
https://staging.myapp.com/*   # Staging environment
http://localhost:*            # Local development

Avoid these:

*                             # No restriction (insecure)
http://*                      # Any HTTP site (insecure)
*.com/*                       # Too broad

Multiple Environment Strategy

Create separate tokens for each environment:

// Production
{
  note: "Production - myapp.com",
  scopes: ["styles:read", "fonts:read"],
  allowedUrls: ["https://myapp.com/*", "https://www.myapp.com/*"]
}

// Staging
{
  note: "Staging - staging.myapp.com",
  scopes: ["styles:read", "fonts:read"],
  allowedUrls: ["https://staging.myapp.com/*"]
}

// Development
{
  note: "Development - localhost",
  scopes: ["styles:read", "fonts:read"],
  allowedUrls: ["http://localhost:*", "http://127.0.0.1:*"]
}

Token Storage and Handling

Server-Side (Secret Tokens)

DO:

  • Store in environment variables
  • Use secret management services (AWS Secrets Manager, HashiCorp Vault)
  • Encrypt at rest
  • Limit access via IAM policies
  • Log token usage

DON'T:

  • Hardcode in source code
  • Commit to version control
  • Store in plaintext configuration files
  • Share via email or Slack
  • Reuse across multiple services

Example: Secure Environment Variable:

# .env (NEVER commit this file)
MAPBOX_SECRET_TOKEN=sk.ey...

# .gitignore (ALWAYS include .env)
.env
.env.local
.env.*.local

Client-Side (Public Tokens)

DO:

  • Use public tokens only
  • Apply URL restrictions
  • Use different tokens per app
  • Rotate periodically
  • Monitor usage

DON'T:

  • Expose secret tokens
  • Use tokens without URL restrictions
  • Share tokens between unrelated apps
  • Use tokens with excessive scopes

Example: Safe Client Usage:

// Public token with URL restrictions - SAFE
const mapboxToken = 'pk.eyJ1IjoiZXhhbXBsZSIsImEiOiJjbGV4YW1wbGUifQ.example';

// This token is restricted to your domain
// and only has styles:read scope
mapboxgl.accessToken = mapboxToken;

Token Rotation Strategy

When to Rotate Tokens

Mandatory rotation:

  • Token exposed in public repository
  • Team member leaves with token access
  • Suspected compromise or breach
  • Service decommissioning
  • Compliance requirements

Scheduled rotation:

  • Every 90 days (recommended for production)
  • Every 30 days (high-security environments)
  • After major deployments
  • During security audits

Rotation Process

Zero-downtime rotation:

  1. Create new token with same scopes
  2. Deploy new token to canary/staging environment
  3. Verify functionality with new token
  4. Gradually roll out to production
  5. Monitor for issues for 24-48 hours
  6. Revoke old token after confirmation
  7. Update documentation with rotation date

Emergency rotation:

  1. Immediately revoke compromised token
  2. Create replacement token
  3. Deploy emergency update to all services
  4. Notify team of incident
  5. Investigate how compromise occurred
  6. Update procedures to prevent recurrence

Monitoring and Auditing

Track Token Usage

Metrics to monitor:

  • API request volume per token
  • Geographic distribution of requests
  • Error rates by token
  • Unexpected spike patterns
  • Requests from unauthorized domains

Alert on:

  • Usage from unexpected IPs/regions
  • Sudden traffic spikes (>200% normal)
  • High error rates (>10%)
  • Requests outside allowed URLs
  • Off-hours access patterns

Regular Security Audits

Monthly checklist:

  • Review all active tokens
  • Verify token scopes are still appropriate
  • Check for unused tokens (revoke if inactive >30 days)
  • Confirm URL restrictions are current
  • Review team member access
  • Check for tokens in public repositories (GitHub scan)
  • Verify documentation is up-to-date

Quarterly checklist:

  • Rotate production tokens
  • Full token inventory
  • Access control review
  • Update incident response procedures
  • Security training for team

Common Security Mistakes

1. Exposing Secret Tokens in Client Code

CRITICAL ERROR:

// NEVER DO THIS - Secret token in client code
const map = new mapboxgl.Map({
  accessToken: 'sk.eyJ1IjoiZXhhbXBsZSIsI...' // SECRET TOKEN
});

Correct:

// Public token only in client code
const map = new mapboxgl.Map({
  accessToken: 'pk.eyJ1IjoiZXhhbXBsZSIsI...' // PUBLIC TOKEN
});

2. Overly Permissive Scopes

Too broad:

{
  "scopes": ["styles:*", "tokens:*"]
}

Specific:

{
  "scopes": ["styles:read"]
}

3. Missing URL Restrictions

No restrictions:

{
  "scopes": ["styles:read"],
  "allowedUrls": [] // Token works anywhere
}

Domain restricted:

{
  "scopes": ["styles:read"],
  "allowedUrls": ["https://myapp.com/*"]
}

4. Long-Lived Tokens Without Rotation

Never rotated:

Token created: Jan 2020
Last rotation: Never
Still in production: Yes

Regular rotation:

Token created: Dec 2024
Last rotation: Dec 2024
Next rotation: Mar 2025

5. Tokens in Version Control

Committed to Git:

// config.js (committed to repo)
export const MAPBOX_TOKEN = 'sk.eyJ1IjoiZXhhbXBsZSI...';

Environment variables:

// config.js
export const MAPBOX_TOKEN = process.env.MAPBOX_SECRET_TOKEN;
# .env (in .gitignore)
MAPBOX_SECRET_TOKEN=sk.eyJ1IjoiZXhhbXBsZSI...

Incident Response Plan

If a Token is Compromised

Immediate actions (first 15 minutes):

  1. Revoke the token via Mapbox dashboard or API
  2. Create replacement token with different scopes/restrictions if needed
  3. Update all services using the compromised token
  4. Notify team via incident channel

Investigation (within 24 hours): 5. Review access logs to understand exposure 6. Check for unauthorized usage in Mapbox dashboard 7. Identify root cause (how was it exposed?) 8. Document incident with timeline and impact

Prevention (within 1 week): 9. Update procedures to prevent recurrence 10. Implement additional safeguards (CI checks, secret scanning) 11. Train team on lessons learned 12. Update documentation with new security measures

Best Practices Summary

Security Checklist

Token Creation:

  • Use public tokens for client-side, secret for server-side
  • Apply principle of least privilege for scopes
  • Add URL restrictions to public tokens
  • Use descriptive names/notes for token identification
  • Document intended use and environment

Token Management:

  • Store secret tokens in environment variables or secret managers
  • Never commit tokens to version control
  • Rotate tokens every 90 days (or per policy)
  • Remove unused tokens promptly
  • Separate tokens by environment (dev/staging/prod)

Monitoring:

  • Track token usage patterns
  • Set up alerts for unusual activity
  • Regular security audits (monthly)
  • Review team access quarterly
  • Scan repositories for exposed tokens

Incident Response:

  • Documented revocation procedure
  • Emergency contact list
  • Rotation process documented
  • Post-incident review template
  • Team training on security procedures

When to Use This Skill

Invoke this skill when:

  • Creating new tokens
  • Deciding between public vs secret tokens
  • Setting up token restrictions
  • Implementing token rotation
  • Investigating security incidents
  • Conducting security audits
  • Training team on token security
  • Reviewing code for token exposure

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

28.8%
按下载量换算92

Antigravity

27.03%
按下载量换算86

OpenCode

16.93%
按下载量换算54

Gemini CLI

12.5%
按下载量换算40

Codex

8.62%
按下载量换算28

windsurf

3.75%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills