Skip to content

Commit

Permalink
add flags check on buildPackagePolicy method
Browse files Browse the repository at this point in the history
  • Loading branch information
chkp-royl committed Jul 12, 2020
1 parent 3c8bbcc commit 4f5134c
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/main/java/com/checkpoint/mgmt_api/examples/ShowPackageTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,22 +569,29 @@ private static PolicyPackage buildPackagePolicy(String packageName, JSONArray ob
configuration.getLogger().debug("Starting to process layers of package '" + packageName + "'");

natLayer = aggregatePackageLayers(packageName, accessLayers, threatLayers);
//Handle access layer
configuration.getLogger().debug("Handle access layers");
for (Layer accessLayer : accessLayers) {
showAccessRulebase(accessLayer, packageName);

if(configuration.showAccessPolicyFlag()){
//Handle access layer
configuration.getLogger().debug("Handle access layers");
for (Layer accessLayer : accessLayers) {
showAccessRulebase(accessLayer, packageName);
}
}

//Handle nat layer
if (natLayer != null) {
configuration.getLogger().debug("Handle nat layer");
showNatRulebase(natLayer, packageName);
if(configuration.showNatPolicyFlag()){
//Handle nat layer
if (natLayer != null) {
configuration.getLogger().debug("Handle nat layer");
showNatRulebase(natLayer, packageName);
}
}

//Handle threat layers
configuration.getLogger().debug("Handle threat layers");
for (Layer threatLayer : threatLayers) {
showThreatRulebase(packageName, threatLayer);
if(configuration.showThreatPolicyFlag()){
//Handle threat layers
configuration.getLogger().debug("Handle threat layers");
for (Layer threatLayer : threatLayers) {
showThreatRulebase(packageName, threatLayer);
}
}

final Queue<String> objectsQueue = configuration.getNestedObjectsToRetrieve();
Expand Down

0 comments on commit 4f5134c

Please sign in to comment.