Skip to content

Commit

Permalink
Merge pull request #659 from swaschkut/main
Browse files Browse the repository at this point in the history
final v2.0.58
  • Loading branch information
swaschkut authored Sep 8, 2022
2 parents f28915f + 7670373 commit a2a5b47
Show file tree
Hide file tree
Showing 45 changed files with 4,546 additions and 579 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@ CHANGELOG
2.0.58
UTIL:
* type=rule - improve filters for CI/CD
* type=rule ruletype=any | introduce all filter/actions related to schedule for DoS/Pbf/Qos Rules
* type=rule | introduce ruletype=defaultsecurity
* type=device - extend all parts DG/template / template-stack with config-size information
* type=config-size - optimise output
* type=rule | extend 'filter=(secprof ......)' for ryletype=defaultsecurity
* type=rule | introduce ruletype=sdwan,networkpacketbroker

BUGFIX:
* type=rule/schedule | bugfix for is.expired
* type=rule | actions=securityprofile... - fix to support DefaultSecurityRule
* type=xml-issue | bugfix for Zone
* type=rule ruletype=defaultsecurity | bugfix for actions=exporttoexcel

GENERAL:
* introduce class DefaultSecurityRule - extend on all parts
* extend usage of DefaultSecurityRule to class Container/DeviceCloud/DeviceOnPrem
* class DefaultSecurityRules - skip reading source/destination/from/to
* pan_php_framework - optimise method convert()
* class AddressStore | loop dependencies error with more details
* introduce GTP/SCEP/PacketBroker/SDWAN-ErrorCorrection/-PathQuality/-SaasQuality/-TrafficDistribution Classes
* introduce Profile DataObjects Class


2.0.57 (20220905)
Expand Down
260 changes: 260 additions & 0 deletions lib/device-and-system-classes/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@ class Container
/** @var SecurityProfileStore */
public $HipProfilesProfileStore = null;

/** @var SecurityProfileStore */
public $GTPProfileStore = null;

/** @var SecurityProfileStore */
public $SCEPProfileStore = null;

/** @var SecurityProfileStore */
public $PacketBrokerProfileStore = null;

/** @var SecurityProfileStore */
public $SDWanErrorCorrectionProfileStore = null;

/** @var SecurityProfileStore */
public $SDWanPathQualityProfileStore = null;

/** @var SecurityProfileStore */
public $SDWanSaasQualityProfileStore = null;

/** @var SecurityProfileStore */
public $SDWanTrafficDistributionProfileStore = null;

/** @var SecurityProfileStore */
public $DataObjectsProfileStore = null;


/** @var ScheduleStore */
public $scheduleStore = null;
Expand Down Expand Up @@ -152,6 +176,19 @@ class Container
/** @var RuleStore */
public $dosRules;

/** @var RuleStore */
public $tunnelInspectionRules;

/** @var RuleStore */
public $defaultSecurityRules = null;

/** @var RuleStore */
public $networkPacketBrokerRules;

/** @var RuleStore */
public $sdWanRules;


/**
* @var null|Container
*/
Expand Down Expand Up @@ -240,6 +277,31 @@ public function __construct($owner)
$this->HipProfilesProfileStore = new SecurityProfileStore($this, "HipProfilesProfile");
$this->HipProfilesProfileStore->name = 'HipProfiles';

$this->GTPProfileStore = new SecurityProfileStore($this, "GTPProfile");
$this->GTPProfileStore->name = 'GTPProfiles';

$this->SCEPProfileStore = new SecurityProfileStore($this, "SCEPProfile");
$this->SCEPProfileStore->name = 'SCEPProfiles';

$this->PacketBrokerProfileStore = new SecurityProfileStore($this, "PacketBrokerProfile");
$this->PacketBrokerProfileStore->name = 'PacketBrokerProfiles';

$this->SDWanErrorCorrectionProfileStore = new SecurityProfileStore($this, "SDWanErrorCorrectionProfile");
$this->SDWanErrorCorrectionProfileStore->name = 'SDWanErrorCorrectionProfiles';

$this->SDWanPathQualityProfileStore = new SecurityProfileStore($this, "SDWanPathQualityProfile");
$this->SDWanPathQualityProfileStore->name = 'SDWanPathQualityProfiles';

$this->SDWanSaasQualityProfileStore = new SecurityProfileStore($this, "SDWanSaasQualityProfile");
$this->SDWanSaasQualityProfileStore->name = 'SDWanSaasQualityProfiles';

$this->SDWanTrafficDistributionProfileStore = new SecurityProfileStore($this, "SDWanTrafficDistributionProfile");
$this->SDWanTrafficDistributionProfileStore->name = 'SDWanTrafficDistributionProfiles';

$this->DataObjectsProfileStore = new SecurityProfileStore($this, "DataObjectsProfile");
$this->DataObjectsProfileStore->name = 'DataObjectsProfileStoreProfiles';


$this->scheduleStore = new ScheduleStore($this);
$this->scheduleStore->setName('scheduleStore');

Expand All @@ -252,6 +314,12 @@ public function __construct($owner)
$this->pbfRules = new RuleStore($this, 'PbfRule', TRUE);
$this->qosRules = new RuleStore($this, 'QoSRule', TRUE);
$this->dosRules = new RuleStore($this, 'DoSRule', TRUE);
$this->tunnelInspectionRules = new RuleStore($this, 'TunnelInspectionRule', TRUE);

$this->defaultSecurityRules = new RuleStore($this, 'DefaultSecurityRule', TRUE);

$this->networkPacketBrokerRules = new RuleStore($this, 'NetworkPacketBrokerRule', TRUE);
$this->sdWanRules = new RuleStore($this, 'SDWanRule', TRUE);

$this->_fakeNetworkProperties = $this->owner->_fakeNetworkProperties;
$this->dosRules->_networkStore = $this->_fakeNetworkProperties;
Expand Down Expand Up @@ -470,6 +538,78 @@ public function load_from_domxml($xml)
{
$this->HipProfilesProfileStore->load_from_domxml($tmproot);
}

//
// GTP Profile extraction
//
$tmproot = DH::findFirstElement('gtp', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->GTPProfileStore->load_from_domxml($tmproot);
}

//
// SCEP Profile extraction
//
$tmproot = DH::findFirstElement('scep', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->SCEPProfileStore->load_from_domxml($tmproot);
}

//
// PacketBroker Profile extraction
//
$tmproot = DH::findFirstElement('packet-broker', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->PacketBrokerProfileStore->load_from_domxml($tmproot);
}

//
// SDWan Error Correction Profile extraction
//
$tmproot = DH::findFirstElement('sdwan-error-correction', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->SDWanErrorCorrectionProfileStore->load_from_domxml($tmproot);
}

//
// SDWan Path Quality Profile extraction
//
$tmproot = DH::findFirstElement('sdwan-path-quality', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->SDWanPathQualityProfileStore->load_from_domxml($tmproot);
}

//
// SDWan Saas Quality Profile extraction
//
$tmproot = DH::findFirstElement('sdwan-saas-quality', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->SDWanSaasQualityProfileStore->load_from_domxml($tmproot);
}

//
// SDWan Traffic Distribution Profile extraction
//
$tmproot = DH::findFirstElement('sdwan-traffic-distribution', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->SDWanTrafficDistributionProfileStore->load_from_domxml($tmproot);
}

//
// DataObjects Profile extraction
//
$tmproot = DH::findFirstElement('data-objects', $this->securityProfilebaseroot);
if( $tmproot !== FALSE )
{
$this->DataObjectsProfileStore->load_from_domxml($tmproot);
}
}


Expand Down Expand Up @@ -718,6 +858,102 @@ public function load_from_domxml($xml)
$tmpPost = null;
}
$this->dosRules->load_from_domxml($tmp, $tmpPost);

if( $prerulebase === FALSE )
$tmp = null;
else
{
$tmp = DH::findFirstElement('tunnel-inspect', $prerulebase);
if( $tmp !== FALSE )
$tmp = DH::findFirstElement('rules', $tmp);

if( $tmp === FALSE )
$tmp = null;
}
if( $postrulebase === FALSE )
$tmpPost = null;
else
{
$tmpPost = DH::findFirstElement('tunnel-inspect', $postrulebase);
if( $tmpPost !== FALSE )
$tmpPost = DH::findFirstElement('rules', $tmpPost);

if( $tmpPost === FALSE )
$tmpPost = null;
}
$this->tunnelInspectionRules->load_from_domxml($tmp, $tmpPost);

//default-security-Rules are only available on POST
if( $prerulebase === FALSE )
$tmp = null;
else
$tmp = null;
if( $postrulebase === FALSE )
$tmpPost = null;
else
{
$tmpPost = DH::findFirstElement('default-security-rules', $postrulebase);
if( $tmpPost !== FALSE )
$tmpPost = DH::findFirstElement('rules', $tmpPost);

if( $tmpPost === FALSE )
$tmpPost = null;
}
$this->defaultSecurityRules->load_from_domxml($tmp, $tmpPost);

//network-packet-broker
$xmlTagName = "network-packet-broker";
$var = "networkPacketBrokerRules";
if( $prerulebase === FALSE )
$tmp = null;
else
{
$tmp = DH::findFirstElement($xmlTagName, $prerulebase);
if( $tmp !== FALSE )
$tmp = DH::findFirstElement('rules', $tmp);

if( $tmp === FALSE )
$tmp = null;
}
if( $postrulebase === FALSE )
$tmpPost = null;
else
{
$tmpPost = DH::findFirstElement($xmlTagName, $postrulebase);
if( $tmpPost !== FALSE )
$tmpPost = DH::findFirstElement('rules', $tmpPost);

if( $tmpPost === FALSE )
$tmpPost = null;
}
$this->$var->load_from_domxml($tmp, $tmpPost);

//sdwan
$xmlTagName = "sdwan";
$var = "sdWanRules";
if( $prerulebase === FALSE )
$tmp = null;
else
{
$tmp = DH::findFirstElement($xmlTagName, $prerulebase);
if( $tmp !== FALSE )
$tmp = DH::findFirstElement('rules', $tmp);

if( $tmp === FALSE )
$tmp = null;
}
if( $postrulebase === FALSE )
$tmpPost = null;
else
{
$tmpPost = DH::findFirstElement($xmlTagName, $postrulebase);
if( $tmpPost !== FALSE )
$tmpPost = DH::findFirstElement('rules', $tmpPost);

if( $tmpPost === FALSE )
$tmpPost = null;
}
$this->$var->load_from_domxml($tmp, $tmpPost);
//
// end of policies extraction
//
Expand Down Expand Up @@ -925,6 +1161,30 @@ public function display_statistics()
$stdoutarray['Decryption objects'] = array();
$stdoutarray['Decryption objects']['total'] = $this->DecryptionProfileStore->count();

$stdoutarray['HipObject objects'] = array();
$stdoutarray['HipObject objects']['total'] = $this->HipObjectsProfileStore->count();
$stdoutarray['HipProfile objects'] = array();
$stdoutarray['HipProfile objects']['total'] = $this->HipProfilesProfileStore->count();

$stdoutarray['GTP objects'] = array();
$stdoutarray['GTP objects']['total'] = $this->GTPProfileStore->count();
$stdoutarray['SCEP objects'] = array();
$stdoutarray['SCEP objects']['total'] = $this->SCEPProfileStore->count();
$stdoutarray['PacketBroker objects'] = array();
$stdoutarray['PacketBroker objects']['total'] = $this->PacketBrokerProfileStore->count();

$stdoutarray['SDWanErrorCorrection objects'] = array();
$stdoutarray['SDWanErrorCorrection objects']['total'] = $this->SDWanErrorCorrectionProfileStore->count();
$stdoutarray['SDWanPathQuality objects'] = array();
$stdoutarray['SDWanPathQuality objects']['total'] = $this->SDWanPathQualityProfileStore->count();
$stdoutarray['SDWanSaasQuality objects'] = array();
$stdoutarray['SDWanSaasQuality objects']['total'] = $this->SDWanSaasQualityProfileStore->count();
$stdoutarray['SDWanTrafficDistribution objects'] = array();
$stdoutarray['SDWanTrafficDistribution objects']['total'] = $this->SDWanTrafficDistributionProfileStore->count();

$stdoutarray['DataObjects objects'] = array();
$stdoutarray['DataObjects objects']['total'] = $this->DataObjectsProfileStore->count();

#$stdoutarray['zones'] = $this->zoneStore->count();
#$stdoutarray['apps'] = $this->appStore->count();

Expand Down
Loading

0 comments on commit a2a5b47

Please sign in to comment.