Skip to content
Smarter by Design.Simpler for Business

waf options ​

The waf options command manages the WAF settings of a vService: it determines how tightly the inspections will be applied, what will be returned to the blocked request, how the body will be processed, how the rules will be learned and in which cases a warning will be produced.

Command Summary ​

TR7 WEB-CLI · waf options
# Tab after the command
admin@TR7LBWAF01> waf options
show update update-many
 
admin@TR7LBWAF01> waf options show poolId <vservice>
admin@TR7LBWAF01> waf options update poolId <vservice> …
admin@TR7LBWAF01> waf options update-many target selected …
admin@TR7LBWAF01>  

This resource is a single setting per vService: it does not have the add and delete actions. In every command, on which vService it is worked is stated by the field name and its value being written together.

Required Fields ​

OrderFieldStatusValue
1poolIdRequiredThe vService record the settings belong to; it is asked for in the show and update commands

In the bulk update, instead of poolId, target is asked for (see Bulk Update).

The Basic Inspections ​

FieldWhat it doesWhat is written after it
--structureChecksTurns on the request passing the structural inspectionstrue · false (the default is false)
--argumentChecksTurns on the request arguments being inspectedtrue · false (the default is false)
--maxAllowedArgumentsDetermines at most how many arguments will be allowed in a request1 or a larger integer (the default is 15)
--owaspProtectionLevelSelects how tightly the OWASP rule set will be applied24 — Elementary · 16 — Normal · 8 — Tight · 4 — Very tight · 2 — Aggressive. As the number gets smaller, the protection gets tighter
--maxOwaspExclusionsLimits at most how many OWASP exclusions can be defined in a rule1 or a larger integer
--syncWithDefaultFwRulesTriggers the default WAF rule set of the service being set up again according to the protection leveltrue (the default) · false. It is not a stored setting but a writing trigger; it is not accepted in the bulk update

The Blocking Page ​

It determines which content and which status code will be returned to the blocked request.

FieldWhat it doesWhat is written after it
--blockingContentSourceSelects where the blocking content will come fromprofile from the content profile (the default) · when it is left empty, the content is written manually
--blockingContentProfileSelects which content profile will be usedThe page content profile. It opens only while --blockingContentSource profile
--blockingContentDetermines the manually written blocking contentThe content text (the default is BLOCKED). It opens only while the source is other than profile
--blockingContentTypeSelects the type of the manually written contenttext/html (the default) · text/plain · text/css · application/json · application/xml · application/x-ns-proxy-autoconfig. It opens only while the source is other than profile
--blockingStatusCodeSelects which HTTP status code will be returned to the blocked requestThe status code (the default is 418); the set covers the 2xx, 3xx, 4xx and 5xx codes
--blockingPageRules.N.condDetermines under which condition a different blocking page will be shownThe condition expression; every rule with its own index
--blockingPageRules.N.pageProfileSelects which page profile will be shown when that condition is metThe page content profile
--blockingPageRules.N.statusCodeSelects the status code to be returned under that conditionThe status code. When it is left empty, the general blocking code is used

The WAF Scope ​

FieldWhat it doesWhat is written after it
--dontWafStaticContentProvides that the static content requests are not passed through the WAF inspectiontrue (the default) · false
--decodePathsTurns on the request paths being decoded before the inspectiontrue (the default) · false
--wafConditionEnabledTurns on the WAF exemption condition being appliedtrue · false (the default is false)
--wafConditionDetermines which requests will be kept exempt from the WAF inspectionThe condition expression. It opens only while --wafConditionEnabled true
--wafLogSuppressionConditionDetermines which WAF events will not be written into the logThe condition expression

Blacklist ​

FieldWhat it doesWhat is written after it
--blacklistProtectionTurns on the protection against the sources in the blacklisttrue · false
--blacklistProtectionCategories.NDetermines which blacklist categories will be appliedThe category name; every category with its own index (the default is user)
--blacklistIpsDetermines the blacklist addresses specific to this serviceThe address list; it is a multi-line text field
--blacklistExclusionsDetermines the addresses to be kept exempt from the blacklistThe address list; it is a multi-line text field

The Body Processing ​

FieldWhat it doesWhat is written after it
--bodyParseLimitDetermines at most how much of the request body will be processedAn integer between 1 and 262144; the unit is kB
--bodyMaxLogSizeDetermines at most how much of the body will be written into the log0 or a larger integer; the unit is kB
--dontBufferRequestTurns on the body being waited for a limited time, without the whole of it being waited fortrue · false (the default is false)
--waitForBodyMs.valDetermines how long the body will be waited forA number (the default is 300). It opens only while --dontBufferRequest true
--waitForBodyMs.unitSelects the unit of that durationms (the default) · s

Rule Management and Sampling ​

FieldWhat it doesWhat is written after it
--createRulePolicySelects how narrowly the learned rules will be writtenloose · onlyVar · strict
--smartSamplingTurns on the repetition of the requests of the same shape being reduced in the learning logtrue (the default) · false
--smartSamplingCopiesDetermines how many full copies will be stored for every request shapeAn integer between 5 and 10000 (the default is 50). It opens only while --smartSampling true

The Trusted Sources ​

It provides that the learning is done only from the traffic that comes from certain sources.

FieldWhat it doesWhat is written after it
--smartLearningTurns on the trusted source learningtrue · false (the default is false)
--smartLearning_ipDetermines the traffic coming from which address will count as trustedThe address. It opens only while --smartLearning true
--smartLearning_cookieDetermines the request carrying which cookie will count as trustedThe cookie name. It opens only while --smartLearning true
--smartLearning_headerDetermines the request carrying which header will count as trustedThe header name. It opens only while --smartLearning true
--fpcFrequencyDetermines with which frequency the learning from the trusted source will be doneThe frequency value

The AI Learning ​

It manages deriving rules from the traffic as a whole and which thresholds the derivation has to meet.

FieldWhat it doesWhat is written after it
--collectiveLearningTurns on the learning from the traffic as a wholetrue · false (the default is false)
--collectiveLearningFrequencyDetermines with which frequency the learning will be doneThe frequency value. It opens only while --collectiveLearning true
--countryFilter_SL.NDetermines the traffic coming from which countries will be counted in the learningThe country value; every country with its own index, the same country cannot be written twice
--onlyBrowsersProvides that only the browser requests take part in the learningtrue · false (the default is false)
--onlyDomainsProvides that only the requests that carry a valid domain name take part in the learningtrue · false (the default is false)
--skipBlacklistIpsProvides that the traffic coming from the addresses in the blacklist does not take part in the learningtrue · false (the default is false)
--minReq_SLDetermines the least number of requests needed for a rule to be derived1 or a larger integer (the default is 10)
--minCi_SLDetermines the least number of clients needed1 or a larger integer
--minCountry_SLDetermines the least number of countries needed1 or a larger integer
--minNetwork_SLDetermines the least number of ASN networks needed1 or a larger integer

The Analysis ​

FieldWhat it doesWhat is written after it
--analyzeTurns on the requests of a certain source being examined in detailtrue · false (the default is false)
--analyze_ipDetermines the requests of which address will be examinedThe address. It opens only while --analyze true
--analyze_cookieDetermines the requests carrying which cookie will be examinedThe cookie name. It opens only while --analyze true
--analyze_headerDetermines the requests carrying which header will be examinedThe header name. It opens only while --analyze true

The E-mail Report ​

It determines to whom, in which format and with which frequency the scheduled WAF report will be sent.

FieldWhat it doesWhat is written after it
--emailReportTurns on the scheduled report sendingtrue · false (the default is false)
--emailAddresses.NDetermines to which addresses the report will be sentThe e-mail address; every address with its own index. It opens only while --emailReport true
--emailFileTypes.NSelects in which format the report will be attachedpdf (the default) · xlsx
--emailFrequency.NSelects with which frequency the report will be sentdaily (the default) · weekly · monthly · annual

The Notifications ​

It determines through which channels the warning produced when the threshold is exceeded will be delivered.

FieldWhat it doesWhat is written after it
--notifyBlockRateDetermines with the exceeding of which threshold by the number of blockings per second a warning will be produced1 or a larger integer. When it is left empty, this threshold is not applied
--notifyAttackRateDetermines with the exceeding of which threshold by the number of attack detections per second a warning will be produced1 or a larger integer. When it is left empty, this threshold is not applied
--notifyEmail.NDetermines to which e-mail addresses the warning will be sentThe e-mail address; every address with its own index
--notifySms.NDetermines to which telephone numbers the warning will be sentThe telephone number; every number with its own index
--notifySnmpTurns on the warning being sent as an SNMP notificationtrue · false (the default is false)
--notifyUiTurns on the warning being shown in the management interfacetrue (the default) · false

The Advanced Notifications ​

It produces a warning with the exceeding of the threshold by the events counted in a certain scope and in a certain window. Every entry is written with its own index.

FieldWhat it doesWhat is written after it
--advancedNotifications.N.scopeSelects in which scope the count will be keptglobal · src_ip · subnet · country · asn · nettype_group · nettype_category · host
--advancedNotifications.N.maskV4Determines the IPv4 network mask in the subnet scopeThe mask length (the default is 24). It opens only while scope subnet
--advancedNotifications.N.maskV6Determines the IPv6 network mask in the subnet scopeThe mask length (the default is 64). It opens only while scope subnet
--advancedNotifications.N.countTypeSelects which events will be countedblock the blocked requests · detect the detected attacks
--advancedNotifications.N.window.valDetermines in which window the count will be keptA number; the window cannot be shorter than 30 seconds and longer than 1 hour
--advancedNotifications.N.window.unitSelects the unit of that windows · m · h
--advancedNotifications.N.limitDetermines at how many events per window a warning will be produced1 or a larger integer
--advancedNotifications.N.reportFileTypes.NSelects in which format a report will be attached to the warning messagepdf · xlsx. When it is left empty, the message is sent without an attachment

The WAF Info Content ​

It determines the attack details written into the blocking page and into the log records.

FieldWhat it doesWhat is written after it
--wafInfoPayloadSelects whether the attack pattern will be written into the info content or not1 it is written · 0 it is not written. When it is left empty, the field stays undefined
--wafInfoFields.NSelects which details will take place in the info contentscore · severity · scope · monitor · name · desc · category · cwe · mitre · capec · owaspWeb · owaspApi · target. By default score, scope and monitor are selected
--wafInfoLangSelects the language of the info contenten (the default) · tr
--wafInfoDescSelects in which language the attack description will be writtenen · tr. When it is left empty, the description is not written. The --wafInfoFields.N and --wafInfoLang pair has taken its place
--wafInfoSeveritySelects in which language the attack severity will be writtenen · tr. When it is left empty, it is not written. The --wafInfoFields.N and --wafInfoLang pair has taken its place

Bulk Update ​

The update-many applies the same change to many WAF setting records at once. The writing order is the same in every resource.

Step 1 Select the target
The only required field is target: selected for the records selected from the list, all for the entire collection.
Step 2 Add the fields to be written
Only the fields that can be written to many records with the same value are present; the fields specific to the record, such as the identifier, the name and the rule set synchronization, do not take place in this command.
Step 3 Mark the targets from the list
When target selected is written and no id is given, a selection list with checkboxes opens.
Step 4 Confirm
A warning stating how many records will be affected appears; nothing is written until the confirmation word is typed.
FieldStatusValue
targetRequiredselected — the records selected from the list · all — the whole collection
--ids.NConditionalThe target ids for target selected. It is not suggested in the Tab list: the targets are marked from the selection list. In a script and in a pipeline it is written manually.
--onErrorOptionalabort (default) — if even one of the targets does not pass the validation, nothing is written · skip — the targets that pass are written

Writable Fields ​

TR7 WEB-CLI · update-many · Tab output
# Tab after the command
admin@TR7LBWAF01> waf options update-many
--info target
 
# Tab after the target field
admin@TR7LBWAF01> waf options update-many target
all selected
admin@TR7LBWAF01>  

The bulk update list of this command contains almost all of the fields in the single update command (71 fields). What the fields do is written in the sections above.

Fields that exist in the single command but not here, and the reasons:

FieldWhy it is not here
poolIdOn which vService it will be worked is determined with the selection list in the bulk command
--syncWithDefaultFwRulesIt is marked as closed to bulk writing in the schema (batch: false): so as not to set up the rule set of more than one service again silently

Target Selection and Confirmation ​

TR7 WEB-CLI · selection list and confirmation
admin@TR7LBWAF01> waf options update-many target selected --owaspProtectionLevel 8
 
?  Target objects
    space: mark · ctrl+a: all · enter: confirm
    Filter: (filter by typing) · esc: cancel
 
  [x] <record-1>
  [x] <record-2>
  [ ] <record-3>
    2 selected / 3
 
⚠  2 objects will be updated
    <record-1>, <record-2>
 
Type "yes" to confirm: yes
admin@TR7LBWAF01>  
TR7 WEB-CLI · the whole collection and writing in a script
# the whole collection: the list does not open, the confirmation comes directly
admin@TR7LBWAF01> waf options update-many target all --dontWafStaticContent true
⚠  This operation will update ALL the objects in the collection
Type "yes" to confirm:
 
# in a script or in a pipeline: the targets are written by hand, the list does not open
admin@TR7LBWAF01> waf options update-many target selected \
--ids.0 <id-1> --ids.1 <id-2> --owaspProtectionLevel 8 --onError skip
admin@TR7LBWAF01>  

The screen language depends on the user

The texts in the selection list and on the confirmation screen come according to the language preference of the signed-in user. The confirmation word is yes in the English interface and evet in the Turkish interface.

The detailed behavior of bulk update — which fields can be written in bulk and the report returned for each target — is on the API Commands page.

Examples ​

TR7 WEB-CLI · A) Protection and the blocking page
admin@TR7LBWAF01> waf options update poolId <vservice> \
--structureChecks true --argumentChecks true --owaspProtectionLevel 8 \
--blockingContentSource profile --blockingContentProfile <profile> \
--blockingStatusCode 403
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) Learning and notification
# learning from the traffic as a whole, with thresholds
admin@TR7LBWAF01> waf options update poolId <vservice> \
--collectiveLearning true --minReq_SL 50 --minCi_SL 10 \
--onlyBrowsers true --skipBlacklistIps true
 
# warn at 20 blockings per second, e-mail and interface notification
admin@TR7LBWAF01> waf options update poolId <vservice> \
--notifyBlockRate 20 --notifyEmail.0 guvenlik@kurum.com.tr --notifyUi true
 
# warn if there are 100 blockings in 5 minutes per source address
admin@TR7LBWAF01> waf options update poolId <vservice> \
--advancedNotifications.0.scope src_ip --advancedNotifications.0.countType block \
--advancedNotifications.0.window.val 5 --advancedNotifications.0.window.unit m \
--advancedNotifications.0.limit 100
admin@TR7LBWAF01>  

Things to Know ​

  • A setting belongs to a vService. In every command it is stated with poolId on the settings of which service it is worked.
  • The required fields do not take --. poolId and the target in the bulk command are written with the field name and its value side by side; the other fields are in the --field value form. The detail is on the API Commands page.
  • In the protection level, the tightness increases as the number gets smaller. 24 is the loosest and 2 the tightest level; the tight levels raise the probability of a wrong blocking.
  • --syncWithDefaultFwRules is a trigger. It is not a stored setting: when true is written, the default rule set of the service is set up again according to the protection level. The bulk update does not accept this field.
  • The blocking content comes either from a profile or manually. While --blockingContentSource profile, the profile field opens, and when it is left empty, the content and the content type fields open.
  • The conditional blocking pages are evaluated in order. The --blockingPageRules.N entries take the place of the general blocking page; in the entries whose status code is left empty, the general code is used.
  • The exemption condition depends on its switch. --wafCondition is listed only while --wafConditionEnabled true.
  • The learning has two separate ways. The learning from the trusted sources is turned on with --smartLearning and the learning from the traffic as a whole with --collectiveLearning; the two are independent of each other.
  • Two fields in the info content have now left their place. The --wafInfoDesc and --wafInfoSeverity fields have been replaced by the --wafInfoFields.N and --wafInfoLang pair; the old fields are preserved so that the existing profiles stay valid.
  • The rules are managed in separate commands. The host groups are in the waf host-groups command, the path rules in the waf fw-rules command and the inspection parts in the waf rule-parts command.