mirror of
https://github.com/openappsec/openappsec.git
synced 2025-06-28 16:41:02 +03:00
Set deafult policy order placament
This commit is contained in:
parent
7bf05192b3
commit
16ad370409
@ -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();
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,8 @@ static const std::unordered_map<std::string, std::string> key_to_practices_val =
|
||||
{ "inactive", "Inactive"}
|
||||
};
|
||||
|
||||
static const std::string default_appsec_url = "http://*:*";
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
parseAppsecJSONKey(
|
||||
|
@ -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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user