Netalertx Authentication Tokens
DevOps & Securitynetalertx-authentication-tokensNetalertx Authentication Tokens is an Agent Skill for devops & security published in the netalertx/NetAlertX repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/netalertx/NetAlertX/blob/HEAD/.github/skills/authentication/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/netalertx-authentication-tokens, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Authentication
Purpose ✅
Explain how to locate, validate, rotate, and troubleshoot API tokens and related authentication settings used by NetAlertX.
Pre-Flight Check (MANDATORY) ⚠️
- Ensure the backend is running (use devcontainer services or
ps/systemd checks). - Verify the
API_TOKENsetting can be read with Python (see below). - 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_TOKENfield — this updates the value safely and immediately. - Manual: Edit
/data/config/app.confand 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 🔍
- Confirm backend is running and reachable.
- Confirm
get_setting_value('API_TOKEN')returns a non-empty value. - Ensure client requests send the header exactly:
Authorization: Bearer <API_TOKEN>. - Check
/tmp/log/app.logand plugin logs (e.g., sync plugin) for "Incorrect API Token" messages. - If using multiple nodes, ensure the token matches across nodes for sync operations.
- If token appears missing or incorrect, rotate via UI or update
app.confand 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 useAPI_TOKENin testssettings-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