# Class SecurityRule

© 2019 Palo Alto Networks, Inc. All rights reserved.

Licensed under SCRIPT SOFTWARE AGREEMENT, Palo Alto Networks, Inc., at https://www.paloaltonetworks.com/legal/script-software-license-1-0.pdf

  Rule uses PathableName, centralServiceStoreUser, centralAddressStoreUser, ObjectWithDescription, XmlConvertible
  RuleWithUserID
  SecurityRule uses NegatableRule, RulewithLogging

Located at rule-classes/SecurityRule.php

Methods summary
`public` | # `__construct( `RuleStore` $owner, boolean $fromTemplateXML = FALSE )` #### Parameters $owner ``RuleStore`` $owner $fromTemplateXML `boolean` $fromTemplateXML
`public` | # `load_from_domxml( `DOMElement` $xml )` #### Parameters $xml ``DOMElement`` $xml #### Throws ``Exception``
`public string` | # `type( )` #### Returns `string` type of this rule : 'universal', 'intrazone', 'interzone'
`public` | # `setType( mixed $type )`
`public` | # `API_setType( mixed $type )`
`protected` | # `extract_category_from_domxml( )`
`public` | # `securityProfileIsBlank( )`
`public string` | # `securityProfileType( )` return profile type: 'group' or 'profile' or 'none' return profile type: 'group' or 'profile' or 'none' #### Returns `string`
`public` | # `securityProfileGroup( )`
`public` | # `securityProfiles( )`
`public` | # `securityProfiles_obj( )`
`public` | # `removeSecurityProfile( )`
`public` | # `API_removeSecurityProfile( )`
`public` | # `setSecurityProfileGroup( mixed $newgroup )`
`public` | # `API_setSecurityProfileGroup( mixed $newgroup )`
`public` | # `setSecProf_AV( mixed $newAVprof )`
`public` | # `setSecProf_Vuln( mixed $newAVprof )`
`public` | # `setSecProf_URL( mixed $newAVprof )`
`public` | # `setSecProf_DataFilt( mixed $newAVprof )`
`public` | # `setSecProf_FileBlock( mixed $newAVprof )`
`public` | # `setSecProf_Spyware( mixed $newAVprof )`
`public` | # `setSecProf_Wildfire( mixed $newAVprof )`
`public` | # `rewriteSecProfXML( )`
`public` | # `hipProfileIsBlank( )`
`public` | # `urlCategories( )`
`public` | # `urlCategoryIsAny( )`
`public boolean` | # `urlCategoriesHas( string $category )` #### Parameters $category `string` $category #### Returns `boolean` return TRUE if this rule is using the category defined in $category
`public` | # `action( )`
`public` | # `actionIsAllow( )`
`public` | # `actionIsDeny( )`
`public` | # `actionIsDrop( )`
`public` | # `actionIsResetClient( )`
`public` | # `actionIsResetServer( )`
`public` | # `actionIsResetBoth( )`
`public` | # `actionIsNegative( )`
`public` | # `setAction( mixed $newAction )`
`public` | # `API_setAction( mixed $newAction )`
`public boolean` | # `logStart( )` return true if rule is set to Log at Start return true if rule is set to Log at Start #### Returns `boolean`
`public boolean` | # `setLogStart( boolean $yes )` enabled or disabled logging at start enabled or disabled logging at start #### Parameters $yes `boolean` $yes #### Returns `boolean`
`public boolean` | # `logEnd( )` return true if rule is set to Log at End return true if rule is set to Log at End #### Returns `boolean`
`public boolean` | # `setLogEnd( boolean $yes )` enable or disabled logging at end enable or disabled logging at end #### Parameters $yes `boolean` $yes #### Returns `boolean`
`public boolean` | # `API_setLogEnd( boolean $yes )` enable or disabled logging at end enable or disabled logging at end #### Parameters $yes `boolean` $yes #### Returns `boolean`
`public boolean` | # `API_setLogStart( boolean $yes )` enable or disabled logging at end enable or disabled logging at end #### Parameters $yes `boolean` $yes #### Returns `boolean`
`public boolean` | # `isDSRIEnabled( )` #### Returns `boolean`
`public` | # `display( mixed $padding = 0 )` Helper function to quickly print a function properties to CLI Helper function to quickly print a function properties to CLI
`public &` | # `API_getAppStats( mixed $timePeriod, mixed $excludedApps )`
`public &` | # `API_getAppContainerStats( mixed $timePeriod = 'last-30-days', mixed $fastMode = TRUE, mixed $limit = 50, mixed $excludedApps = array() )`
`public array|DomDocument &` | # `API_getAppContainerStats2( integer $startTimestamp, null|integer $endTimestamp = null, boolean|true $fastMode = TRUE, integer $limit = 50, array $excludedApps = array() )` #### Parameters $startTimestamp `integer` $startTimestamp $endTimestamp `null|integer` $endTimestamp $fastMode `boolean|true` $fastMode $limit `integer` $limit $excludedApps `array` $excludedApps #### Returns `array|DomDocument` #### Throws ``Exception``
`public &` | # `API_getServiceStats( mixed $timePeriod = 'last-30-days', mixed $fastMode = TRUE, mixed $limit = 50, mixed $specificApps = null )`
`public &` | # `API_getAddressStats( mixed $timePeriod = 'last-30-days', mixed $srcORdst = 'src', mixed $fastMode = TRUE, mixed $limit = 50, mixed $excludedAddresses = array() )`
`public` | # `cleanForDestruction( )`
`public` | # `isSecurityRule( )` #### Overrides `Rule::isSecurityRule()`
`public` | # `storeVariableName( )`
`public` | # `ruleNature( )` #### Overrides `Rule::ruleNature()`
`protected` | # `rewriteSDsri_XML( )` For developer use only For developer use only
`public boolean` | # `setDsri( boolean $dsri )` disable rule if $disabled = true, enable it if not disable rule if $disabled = true, enable it if not #### Parameters $dsri `boolean` $disabled #### Returns `boolean` true if value has changed
`public boolean` | # `API_setDsri( boolean $dsri )` disable rule if $dsri = true, enable it if not disable rule if $dsri = true, enable it if not #### Parameters $dsri `boolean` $dsri #### Returns `boolean` true if value has changed
`public` | # `rewriteHipProfXML( )`
`public` | # `setHipProfile( mixed $hipProfile )`
`public` | # `API_setHipProfil( mixed $hipProfile )`
`public null` | # `schedule( )` return schedule txt if rule has scheduler set return schedule txt if rule has scheduler set #### Returns `null`
`public boolean` | # `setSchedule( null|string $newSchedule = null )` #### Parameters $newSchedule `null|string` $newSchedule empty or null description will erase existing one #### Returns `boolean` false if no update was made to description (already had same value)
`public boolean` | # `API_setSchedule( mixed $newSchedule )` #### Returns `boolean` true if value was changed
`public boolean` | # `removeSchedule( )` #### Returns `boolean` false if no update was made to description (already had same value)
`public boolean` | # `API_removeSchedule( )` #### Returns `boolean` true if value was changed
`public boolean` | # `setQoSMarking( null|string $arg1 = null, mixed $arg2 = null )` #### Parameters $arg1 `null|string` $newSchedule empty or null description will erase existing one $arg2 #### Returns `boolean` false if no update was made to description (already had same value)
`public boolean` | # `API_setQoSMarking( mixed $arg1, mixed $arg2 )` #### Returns `boolean` true if value was changed
`public boolean` | # `removeQoSmarking( )` #### Returns `boolean` false if no update was made to description (already had same value)
`public boolean` | # `API_removeQoSmarking( )` #### Returns `boolean` true if value was changed
`public boolean` | # `includedInRule( `SecurityRule` $rule, mixed $action = 'none', mixed $isAPI = false, mixed $print = false )` #### Parameters $rule ``SecurityRule`` $rule $action $isAPI $print #### Returns `boolean` false also if service partial match!!!

Methods inherited from RuleWithUserID
`userID_IsAny(), userID_IsCustom(), userID_IsKnown(), userID_IsPreLogon(), userID_IsUnknown(), userID_getUsers(), userID_loadUsersFromXml(), userID_setUsers(), userID_type()`

Methods inherited from Rule
`API_clearPolicyAppUsageDATA(), API_setDisabled(), API_setEnabled(), API_setName(), API_target_addDevice(), API_target_negateSet(), API_target_removeDevice(), API_target_setAny(), getXPath(), isAppOverrideRule(), isAuthenticationRule(), isCaptivePortalRule(), isDecryptionRule(), isDisabled(), isDoSRule(), isEnabled(), isNatRule(), isPbfRule(), isPostRule(), isPreRule(), isQoSRule(), load_common_from_domxml(), load_destination(), load_from(), load_source(), load_to(), name(), rewriteSDisabled_XML(), setDisabled(), setEnabled(), setName(), target_addDevice(), target_hasDeviceAndVsys(), target_isAny(), target_isNegated(), target_negateSet(), target_removeDevice(), target_rewriteXML(), target_setAny(), targets(), targets_toString(), uuid(), zoneCalculation(), zoneCalculationNatClone()`

Methods used from NegatableRule
`(), (), (), (), (), (), ()`

Methods used from RulewithLogging
`(), (), (), ()`

Methods used from PathableName
`(), (), ()`

Methods used from centralServiceStoreUser
`()`

Methods used from centralAddressStoreUser
`()`

Methods used from ObjectWithDescription
`(), (), (), (), ()`

Methods used from XmlConvertible
`(), (), (), (), ()`

Constants summary
`integer` | `TypeUniversal` | `0` | #
`integer` | `TypeIntrazone` | `1` | #
`integer` | `TypeInterzone` | `2` | #
`integer` | `ActionAllow` | `0` | #
`integer` | `ActionDeny` | `1` | #
`integer` | `ActionDrop` | `2` | #
`integer` | `ActionResetClient` | `3` | #
`integer` | `ActionResetServer` | `4` | #
`integer` | `ActionResetBoth` | `5` | #

Constants inherited from RuleWithUserID
`__UserIDType_Any, __UserIDType_Custom, __UserIDType_Known, __UserIDType_PreLogon, __UserIDType_Unknown`

Properties summary
`protected integer` | $action | ``SecurityRule::ActionAllow`` | #
`protected boolean` | $logstart | `FALSE` | #
`protected boolean` | $logend | `TRUE` | #
`protected mixed` | $schedule | `null` | #
`protected array` | $qosMarking | `array()` | #
`protected null|`DOMElement`` | $categoryroot | `null` | #
`protected string[]` | $_urlCategories | `array()` | #
`public `UrlCategoryRuleContainer`` | $urlCategories | `` | #
`protected boolean` | $dsri | `FALSE` | #
`protected string` | $secproftype | `'none'` | #
`public null|string[]|`DOMElement`` | $secprofroot | `null` | #
`protected mixed` | $secprofgroup | `null` | #
`protected mixed` | $secprofgroup_obj | `null` | #
`protected array` | $secprofProfiles | `array()` | #
`protected array` | $secprofProfiles_obj | `array()` | #
`public mixed` | $hipprofroot | `null` | #
`protected mixed` | $hipprofProfiles | `null` | #
`public `AppRuleContainer`` | $apps | `` | #
`protected integer` | $ruleType | ``SecurityRule::TypeUniversal`` | #
`public static string` | $templatexml | `'<entry name="**temporarynamechangeme**"><option><disable-server-response-inspection>no</disable-server-response-inspection></option><from><member>any</member></from><to><member>any</member></to> <source><member>any</member></source><destination><member>any</member></destination><source-user><member>any</member></source-user><category><member>any</member></category><application><member>any</member></application><service><member>any</member> </service><hip-profiles><member>any</member></hip-profiles><action>allow</action><log-start>no</log-start><log-end>yes</log-end><negate-source>no</negate-source><negate-destination>no</negate-destination><tag/><description/><disabled>no</disabled></entry>'` | #

Properties inherited from RuleWithUserID
`$_userIDType, $_users`

Properties inherited from Rule
`$_targetIsNegated, $_targets, $destination, $disabled, $from, $name, $owner, $services, $source, $tags, $to`

Properties used from centralServiceStoreUser
`$parentServiceStore`

Properties used from centralAddressStoreUser
`$parentAddressStore`

Properties used from ObjectWithDescription
`$_description`

Properties used from XmlConvertible
`$xmlroot`

Properties used from NegatableRule
`$_destinationIsNegated, $_sourceIsNegated`

Properties used from RulewithLogging
`$logSetting`

Magic properties used from PathableName
`$name, $owner`

Magic properties used from ObjectWithDescription
`$xmlroot`