Agent Skillsnetalertx/NetAlertX › netalertx-authentication-tokens

netalertx-authentication-tokens

GitHub

管理NetAlertX的API令牌和认证密钥,涵盖检索、轮换及401/403错误排查。指导通过Python或Docker安全获取Token,利用UI或配置文件轮换密钥,并基于日志诊断认证问题,确保系统访问安全。

.github/skills/authentication/SKILL.md netalertx/NetAlertX

Trigger Scenarios

需要查找或验证NetAlertX API Token 处理401或403认证错误 轮换或生成新的API密钥

Install

npx skills add netalertx/NetAlertX --skill netalertx-authentication-tokens -g -y
More Options

Non-standard path

npx skills add https://github.com/netalertx/NetAlertX/tree/main/.github/skills/authentication -g -y

Use without installing

npx skills use netalertx/NetAlertX@netalertx-authentication-tokens

指定 Agent (Claude Code)

npx skills add netalertx/NetAlertX --skill netalertx-authentication-tokens -a claude-code -g -y

安装 repo 全部 skill

npx skills add netalertx/NetAlertX --all -g -y

预览 repo 内 skill

npx skills add netalertx/NetAlertX --list

SKILL.md

Frontmatter
{
    "name": "netalertx-authentication-tokens",
    "description": "Manage and troubleshoot API tokens and authentication-related secrets. Use this when you need to find, rotate, verify, or debug authentication issues (401\/403) in NetAlertX."
}

Authentication

Purpose ✅

Explain how to locate, validate, rotate, and troubleshoot API tokens and related authentication settings used by NetAlertX.

Pre-Flight Check (MANDATORY) ⚠️

  1. Ensure the backend is running (use devcontainer services or ps/systemd checks).
  2. Verify the API_TOKEN setting can be read with Python (see below).
  3. If a token-related error occurs, gather logs (/tmp/log/app.log, nginx logs) before changing secrets.

Retrieve the API token (Python — preferred) 🐍

Always use Python helpers to read secrets to avoid accidental exposure in shells or logs:

from helper import get_setting_value
token = get_setting_value("API_TOKEN")

If you must inspect from a running container (read-only), use:

docker exec <CONTAINER_ID> python3 -c "from helper import get_setting_value; print(get_setting_value('API_TOKEN'))"

You can also check the runtime config file:

docker exec <CONTAINER_ID> grep API_TOKEN /data/config/app.conf

Rotate / Generate a new token 🔁

  • Preferred: Use the web UI (Settings / System) and click Generate for the API_TOKEN field — this updates the value safely and immediately.
  • Manual: Edit /data/config/app.conf and restart the backend if required (use the existing devcontainer service tasks).
  • After rotation: verify the value with get_setting_value('API_TOKEN') and update any clients or sync nodes to use the new token.

Troubleshooting 401 / 403 Errors 🔍

  1. Confirm backend is running and reachable.
  2. Confirm get_setting_value('API_TOKEN') returns a non-empty value.
  3. Ensure client requests send the header exactly: Authorization: Bearer <API_TOKEN>.
  4. Check /tmp/log/app.log and plugin logs (e.g., sync plugin) for "Incorrect API Token" messages.
  5. If using multiple nodes, ensure the token matches across nodes for sync operations.
  6. If token appears missing or incorrect, rotate via UI or update app.conf and re-verify.

Best Practices & Security 🔐

  • Never commit tokens to source control or paste them in public issues. Redact tokens when sharing logs.
  • Rotate tokens when a secret leak is suspected or per your security policy.
  • Use get_setting_value() in tests and scripts — do not hardcode secrets.

Related Skills & Docs 📚

  • testing-workflow — how to use API_TOKEN in tests
  • settings-management — where settings live and how they are managed
  • Docs: docs/API.md, docs/API_OLD.md, docs/API_SSE.md

Last updated: 2026-01-23

Version History

  • 8aec57b Current 2026-07-24 22:14

Same Skill Collection

.claude/skills/plugin-development/SKILL.md
.claude/skills/pr-analysis/SKILL.md
.claude/skills/testing-workflow/SKILL.md
.gemini/skills/devcontainer-management/SKILL.md
.gemini/skills/logging-standards/SKILL.md
.gemini/skills/mcp-activation/SKILL.md
.gemini/skills/pr-analysis/SKILL.md
.gemini/skills/project-navigation/SKILL.md
.gemini/skills/settings/SKILL.md
.gemini/skills/skills-index/SKILL.md
.gemini/skills/testing-workflow/SKILL.md
.github/skills/api-development/SKILL.md
.github/skills/code-standards/SKILL.md
.github/skills/database-patterns/SKILL.md
.github/skills/database-reset/SKILL.md
.github/skills/devcontainer-configs/SKILL.md
.github/skills/devcontainer-services/SKILL.md
.github/skills/devcontainer-setup/SKILL.md
.github/skills/docker-build/SKILL.md
.github/skills/docker-prune/SKILL.md
.github/skills/logging-standards/SKILL.md
.github/skills/mcp-activation/SKILL.md
.github/skills/plugin-run-development/SKILL.md
.github/skills/pr-analysis/SKILL.md
.github/skills/project-navigation/SKILL.md
.github/skills/sample-data/SKILL.md
.github/skills/settings-management/SKILL.md
.github/skills/skills-overview/SKILL.md
.github/skills/testing-workflow/SKILL.md

Metadata

Files
0
Version
a686a01
Hash
ba4a4374
Indexed
2026-07-24 22:14

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-03 11:09
浙ICP备14020137号-1 $お客様$