alibabacloud-waf-lua-extension-dev
БесплатноБез исполняемых скриптовНе проверенUse when creating, editing, or reviewing WAF 3.0 custom Lua extension plugins, plugin parameters, or request validation logic.
от sdk-team592 установки в других каталогахОб этом скилле
WAF Extension Plugin (Lua) Development & Review
Alibaba Cloud WAF 3.0 "Extension Plugins" allow custom Lua scripts to hook into the request processing pipeline and implement security logic beyond the native rules.
Official documentation: https://help.aliyun.com/zh/waf/web-application-firewall-3-0/user-guide/extensions
This feature is supported only on the subscription Enterprise/Flagship editions and the pay-as-you-go edition, and it is a paid service. After a plugin is created, it takes effect only when it is referenced by a "Custom Rules" protection template.
Key Constraints (Read First)
| Constraint | Impact |
|---|---|
| No OpenAPI / CLI | Extension plugins can only be configured in the console; there is no corresponding aliyun command or SDK interface. Do not try to create/query plugins via CLI, and there is no capability to import local files |
| Block-only action | The "plugin action parameter" in debug testing currently supports only block mode; punish() means blocking the request |
| No logging | print/warn have no effect; there is no log output mechanism inside scripts. The only feedback is the execution-result panel of "Run Debug" in the console |
| Association required to take effect | After a plugin is created, it must be referenced by a "Custom Rules" protection template; the plugin logic executes only when the rule matches |
Plugin Composition
An extension plugin consists of four parts in the console. This Skill uses a set of local project files to mirror them, for version control and review — but this file structure is a convention of this Skill; the platform does not consume these files, and they must ultimately be pasted into the console manually:
| Console Configuration | Local Project File | Description |
|---|---|---|
| Basic information (name/description) | plugin.json |
Plugin metadata |
| Plugin code | plugin.lua |
Custom Lua script |
| Parameter definitions | params.json |
Predefined parameters (including type, value, KMS reference) |
| Debug tests | tests/*.json |
Simulated traffic and expected action results |
Workflow
1. Create
- Clarify the protection goal: what kind of requests to block, and which request fields to decide on.
- Create the plugin directory
<plugin-name>/in the workspace and generate the four file types (see "Plugin Project Structure"). - Write
plugin.lua: read the request → evaluate → callaliwaf.func.punish()on a match. - Extract hard-coded values in the script (secrets, thresholds, whitelists, etc.) into
params.xxxand declare them inparams.json. - Write at least one
tests/*.jsoncase for each key scenario (one hit + one pass). - Paste the four configuration blocks into the console → enter the traffic parameters one by one → click "Run Debug", compare the results against the expectations in
tests/*.json, and associate the plugin with the custom rule only after all cases pass.
2. Edit
- Read the existing
plugin.luaandparams.jsonfirst; understand the current logic before changing it. - When changing logic, maintain the parameter definitions and test cases at the same time, so the script never references an undeclared
params.xxx. - Re-run the review checklist after the change.
3. Review
Check item by item against the Code Review Checklist. The review output should indicate: matched items, risk level, specific line numbers/APIs, and fix suggestions.
Plugin Project Structure
<plugin-name>/
├── plugin.json # Basic information: name, description
├── plugin.lua # Custom Lua script
├── params.json # Parameter definitions (array)
└── tests/ # Debug test cases
├── hit.json # Expected hit (punish)
└── pass.json # Expected pass
Fields of a single parameter in params.json: name (corresponds to params.xxx in the script), type (string/number/boolean/json_object/json_array), description, and either value or kms_secret_name (one of the two).
Fields of tests/*.json: traffic (method/uri/query/args/headers/cookies/request_body), expect_punish (boolean). The console's traffic parameters are flat key-value pairs; the nested fields above are the local record format and must be mapped manually when entered.
See references/examples.md for complete templates.
Runtime Environment
The standard library whitelist and prohibition list below, as well as the static-check hints in "Common Errors", come from the platform implementation and are not fully covered in the official documentation.
Available Lua Standard Libraries
base: core basic functions (globally available)table,string,math,utf8cjson: JSON encoding/decoding (safe mode)bit32: 32-bit bitwise operationspb: Protobuf encoding/decoding
Unavailable Standard Libraries
Accessing the following libraries raises an erro
Установить alibabacloud-waf-lua-extension-dev в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл alibabacloud-waf-lua-extension-dev?
Use when creating, editing, or reviewing WAF 3.0 custom Lua extension plugins, plugin parameters, or request validation logic.
Как установить скилл alibabacloud-waf-lua-extension-dev?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл alibabacloud-waf-lua-extension-dev запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic