diff --git a/components/security_apps/local_policy_mgmt_gen/appsec_practice_section.cc b/components/security_apps/local_policy_mgmt_gen/appsec_practice_section.cc index bb00d72..b190d6d 100755 --- a/components/security_apps/local_policy_mgmt_gen/appsec_practice_section.cc +++ b/components/security_apps/local_policy_mgmt_gen/appsec_practice_section.cc @@ -539,6 +539,8 @@ bool WebAppSection::operator<(const WebAppSection &other) const { // for sorting from the most specific to the least specific rule + if (application_urls == default_appsec_url) return false; + if (other.application_urls == default_appsec_url) return true; return application_urls.size() > other.application_urls.size(); } @@ -575,6 +577,8 @@ bool WebAPISection::operator<(const WebAPISection &other) const { // for sorting from the most specific to the least specific rule + if (application_urls == default_appsec_url) return false; + if (other.application_urls == default_appsec_url) return true; return application_urls.size() > other.application_urls.size(); } diff --git a/components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h b/components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h index 5c04ef5..85f6d1e 100644 --- a/components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h +++ b/components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h @@ -56,6 +56,8 @@ static const std::unordered_map key_to_practices_val = { "inactive", "Inactive"} }; +static const std::string default_appsec_url = "http://*:*"; + template void parseAppsecJSONKey( diff --git a/components/security_apps/local_policy_mgmt_gen/policy_maker_utils.cc b/components/security_apps/local_policy_mgmt_gen/policy_maker_utils.cc index cd64315..d94a38a 100755 --- a/components/security_apps/local_policy_mgmt_gen/policy_maker_utils.cc +++ b/components/security_apps/local_policy_mgmt_gen/policy_maker_utils.cc @@ -1190,7 +1190,7 @@ PolicyMakerUtils::createWebAppSection( apssec_practice.getWebAttacks().getMaxUrlSizeBytes() ); WebAppSection web_app = WebAppSection( - full_url == "Any" ? "http://*:*" : full_url, + full_url == "Any" ? default_appsec_url : full_url, rule_config.getAssetId(), rule_config.getAssetName(), rule_config.getAssetId(), @@ -1462,7 +1462,7 @@ PolicyMakerUtils::createPolicyElementsByRule( if (!web_apps.count(rule_config.getAssetName())) { WebAppSection web_app = WebAppSection( - full_url == "Any" ? "http://*:*" : full_url, + full_url == "Any" ? default_appsec_url : full_url, rule_config.getAssetId(), rule_config.getAssetName(), rule_config.getAssetId(),