Share via


Websites - Create Waf Rules

Create web application firewall rules on a Power Pages website.
Create web application firewall rules on the given website.

PUT https://api.powerplatform.com/powerpages/environments/{environmentId}/websites/{id}/createWafRules?api-version=2022-03-01-preview

URI Parameters

Name In Required Type Description
environmentId
path True

string

The environment ID.

id
path True

string

Website unique identifier (ID).

api-version
query True

string

The API version.

Request Body

Name Type Description
customRules

CustomRule[]

managedRules

ManagedRules[]

Responses

Name Type Description
202 Accepted

Accepted

400 Bad Request

ErrorMessage

Bad Request

401 Unauthorized

ErrorMessage

Unauthorized

404 Not Found

ErrorMessage

Not Found

Security

oauth2

Microsoft Entra ID OAuth2

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize?resource=https://api.powerplatform.com

Scopes

Name Description
.default .default

Definitions

Name Description
CustomRule
Details
Error
ErrorMessage
ManagedRules
MatchConditions
RuleGroupOverrides
Rules
WafRuleAction

Action to take for the rule

WafRuleType
WebApplicationFirewallRules

CustomRule

Name Type Description
action enum:
  • Allow
  • Block
  • Log

Action to take when the rule matches

enabledState enum:
  • Disabled
  • Enabled

State of the rule

matchConditions

MatchConditions[]

name

string

Name of the custom rule

priority

integer (int32)

Priority of the rule

rateLimitDurationInMinutes

integer (int32)

Duration in minutes for rate limiting

rateLimitThreshold

integer (int32)

Threshold for rate limiting

ruleType

WafRuleType

Details

Name Type Description
code

string

Error code

message

string

Error message

target

string

Target parameter

Error

Name Type Description
code

string

Error code

details

Details[]

message

string

Error message

target

string

Target parameter

ErrorMessage

Name Type Description
error

Error

ManagedRules

Name Type Description
Exclusions

string[]

List of exclusions for the rule set

RuleGroupOverrides

RuleGroupOverrides[]

RuleSetAction enum:
  • Allow
  • Block
  • Log

Action to take for the rule set

RuleSetType

string

Type of the managed rule set

RuleSetVersion

string

Version of the managed rule set

MatchConditions

Name Type Description
matchValue

string[]

Values to match

matchVariable

string

Variable to match

negateCondition

boolean

Whether to negate the condition

operator enum:
  • Contains
  • EndsWith
  • Equals
  • GeoMatch
  • StartsWith

Operator for the match condition

selector

string

Selector for the match variable

transforms

string[]

Transformations to apply

RuleGroupOverrides

Name Type Description
Exclusions

string[]

List of exclusions for the rule group

RuleGroupName

string

Name of the rule group

Rules

Rules[]

Rules

Name Type Description
Action

WafRuleAction

Action to take for the rule

EnabledState enum:
  • Disabled
  • Enabled

State of the rule

Exclusions

string[]

List of exclusions for the rule

RuleId

string

ID of the rule

WafRuleAction

Action to take for the rule

Value Description
Allow
Block
Log
AnomalyScoring

WafRuleType

Value Description
MatchRule
RateLimitRule

WebApplicationFirewallRules

Name Type Description
customRules

CustomRule[]

managedRules

ManagedRules[]