Fortinet black logo

CLI Reference

waf api-learning-rule

waf api-learning-rule

Use this command to specify the domains to be protected by the ML based API protection model, and the API paths to be learned by the model.

To use this command, your administrator account’s access control profile must have either w or rw permission to the wafgrp area. For details, see Permissions.

Syntax

config waf api-learning-rule

edit <api-protection-policy_ID>

set domain-name <index>

config api-path-list

edit api-path-list <id>

set api-path-type {plain | regular}

set api-path <string>

next

end

next

end

Variable

Description Default

<bot-detection-policy_ID>

Specify the API protection policy ID.

No default

domain-name <string>

Enter the name of the domain to be protected.

No default
api-path-list <index>

Enter the API path list ID.

The system by default learns API requests to all the URL paths of the domain. If you want to restrict the learning to certain API paths, specify the API paths that you want to system to learn.

No default
api-path-type {plain | regular}

Specify whether the API pattern must contain a literal URL (plain), or a regular expression designed to match multiple URLs (regular).

plain
api-path <string>
  • If the api-path-type is plain, then enter the the literal URL, such as /folder1/index.htm that the HTTP request must contain in order to match the rule, or use wildcards to match multiple URLs, such as /folder1/* or /folder1/*/index.htm. The URL must begin with a slash ( / ).
  • If the api-path-type is regular, then enter a regular expression, such as ^/*\.jsp\?uid\=(.*), matching all and only the URLs to which the rule should apply. The pattern does not require a slash ( / ); however, it must at least match URLs that begin with a slash, such as /profile.cfm.
No default

waf api-learning-rule

Use this command to specify the domains to be protected by the ML based API protection model, and the API paths to be learned by the model.

To use this command, your administrator account’s access control profile must have either w or rw permission to the wafgrp area. For details, see Permissions.

Syntax

config waf api-learning-rule

edit <api-protection-policy_ID>

set domain-name <index>

config api-path-list

edit api-path-list <id>

set api-path-type {plain | regular}

set api-path <string>

next

end

next

end

Variable

Description Default

<bot-detection-policy_ID>

Specify the API protection policy ID.

No default

domain-name <string>

Enter the name of the domain to be protected.

No default
api-path-list <index>

Enter the API path list ID.

The system by default learns API requests to all the URL paths of the domain. If you want to restrict the learning to certain API paths, specify the API paths that you want to system to learn.

No default
api-path-type {plain | regular}

Specify whether the API pattern must contain a literal URL (plain), or a regular expression designed to match multiple URLs (regular).

plain
api-path <string>
  • If the api-path-type is plain, then enter the the literal URL, such as /folder1/index.htm that the HTTP request must contain in order to match the rule, or use wildcards to match multiple URLs, such as /folder1/* or /folder1/*/index.htm. The URL must begin with a slash ( / ).
  • If the api-path-type is regular, then enter a regular expression, such as ^/*\.jsp\?uid\=(.*), matching all and only the URLs to which the rule should apply. The pattern does not require a slash ( / ); however, it must at least match URLs that begin with a slash, such as /profile.cfm.
No default