microsoft/power-platform-skills / plugins/power-pages/skills/manage-firewall
manage-firewall
UnverifiedInspects and configures the web application firewall (WAF) in front of a Power Pages production site. Lists the current state, recommends enabling protection when it is off, and walks the user through adding, updating, or removing custom rules — IP blocks, country blocks, path blocks, and rate limits. Use when the user wants to turn on WAF, block traffic by IP or country, rate-limit login or signup pages, protect pages from brute-force attempts, restrict access to specific paths, review the current firewall configuration, or asks "is my site protected against bots / common web attacks?" — even if they say "add rate limit" or "protect login page" without mentioning "firewall" or "WAF".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.5 KB |
| references/commands.md | markdown | 11.4 KB |
| references/rule-reference.md | markdown | 8.5 KB |
| scripts/delete-rules.js | script | 1.8 KB |
| scripts/disable.js | script | 2.8 KB |
| scripts/enable.js | script | 3.0 KB |
| scripts/get-rules.js | script | 1.7 KB |
| scripts/get-status.js | script | 1.6 KB |
| scripts/set-rules.js | script | 2.8 KB |
| scripts/transform-firewall.js | script | 6.4 KB |
scripts/get-rules.js
View on GitHub#!/usr/bin/env node
const {
resolveContext,
request,
parseCliArgs,
fail,
isFeatureUnsupported,
runCli,
} = require('../../../scripts/lib/power-platform-api');
const HELP = `get-rules.js — Returns the firewall rules for a site (custom and managed).
Usage:
node get-rules.js --portalId <portal-id> [--ruleType <name>]
Flags:
--portalId Power Platform API portal identifier (resolved during prerequisites)
--ruleType Optional filter: Custom or Managed (omit for both)
--help Show this help message
Exit codes:
0 Success
2 Sign-in required
1 Other failure
Example:
node get-rules.js --portalId <portal-id>
node get-rules.js --portalId <portal-id> --ruleType <Custom|Managed>
`;
async function main() {
if (process.argv.includes('--help')) {
process.stdout.write(HELP);
return;
}
const { portalId, ruleType } = parseCliArgs(process.argv);
if (!portalId) {
fail('Usage: node get-rules.js --portalId <portal-id> [--ruleType <name>]', 1);
}
const ctx = resolveContext();
if (ctx.error) fail(ctx.error, 2);
const res = await request({
context: ctx,
method: 'GET',
path: `/websites/${portalId}/getWafRules`,
query: ruleType ? { ruleType } : undefined,
});
if (isFeatureUnsupported(res, 'B022', 'B023')) {
process.stdout.write(
JSON.stringify({
status: 'unsupported',
message: res.error?.message || 'Firewall not available',
}) + '\n'
);
return;
}
if (!res.ok) {
fail(`Get firewall rules failed (${res.statusCode}): ${res.error?.message || ''}`, 1);
}
process.stdout.write(JSON.stringify({ status: 'ok', body: res.body || {} }) + '\n');
}
runCli(module, main);
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |