mirror of
https://github.com/openappsec/openappsec.git
synced 2025-06-28 16:41:02 +03:00
AppSec mode fix
This commit is contained in:
parent
16ad370409
commit
d526a070a4
@ -187,11 +187,11 @@ AppSecPracticeWebAttacks::getMinimumConfidence() const
|
||||
const string &
|
||||
AppSecPracticeWebAttacks::getMode(const string &default_mode) const
|
||||
{
|
||||
if (mode == "Unset" || (key_to_practices_val.find(mode) == key_to_practices_val.end())) {
|
||||
if (mode == "Unset" || (key_to_practices_val2.find(mode) == key_to_practices_val2.end())) {
|
||||
dbgError(D_LOCAL_POLICY) << "Couldn't find a value for key: " << mode << ". Returning " << default_mode;
|
||||
return default_mode;
|
||||
}
|
||||
return key_to_practices_val.at(mode);
|
||||
return key_to_practices_val2.at(mode);
|
||||
}
|
||||
|
||||
void
|
||||
@ -433,7 +433,7 @@ WebAppSection::WebAppSection(
|
||||
anti_bots(parsed_appsec_spec.getAntiBot()),
|
||||
trusted_sources({ parsed_trusted_sources })
|
||||
{
|
||||
web_attack_mitigation = true;
|
||||
web_attack_mitigation = web_attack_mitigation_mode != "Disabled";
|
||||
web_attack_mitigation_action =
|
||||
web_attack_mitigation_mode != "Prevent" ? "Transparent" :
|
||||
web_attack_mitigation_severity == "critical" ? "low" :
|
||||
@ -481,7 +481,7 @@ WebAppSection::WebAppSection(
|
||||
anti_bots(_anti_bots),
|
||||
trusted_sources({ parsed_trusted_sources })
|
||||
{
|
||||
web_attack_mitigation = true;
|
||||
web_attack_mitigation = web_attack_mitigation_mode != "Disabled";
|
||||
web_attack_mitigation_action =
|
||||
web_attack_mitigation_mode != "Prevent" ? "Transparent" :
|
||||
web_attack_mitigation_severity == "critical" ? "low" :
|
||||
|
8
components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h
Normal file → Executable file
8
components/security_apps/local_policy_mgmt_gen/include/local_policy_common.h
Normal file → Executable file
@ -56,6 +56,14 @@ static const std::unordered_map<std::string, std::string> key_to_practices_val =
|
||||
{ "inactive", "Inactive"}
|
||||
};
|
||||
|
||||
static const std::unordered_map<std::string, std::string> key_to_practices_val2 = {
|
||||
{ "prevent-learn", "Prevent"},
|
||||
{ "detect-learn", "Learn"},
|
||||
{ "prevent", "Prevent"},
|
||||
{ "detect", "Detect"},
|
||||
{ "inactive", "Disabled"}
|
||||
};
|
||||
|
||||
static const std::string default_appsec_url = "http://*:*";
|
||||
|
||||
template <typename T>
|
||||
|
@ -210,11 +210,11 @@ NewAppSecPracticeWebAttacks::getMinimumConfidence() const
|
||||
const string &
|
||||
NewAppSecPracticeWebAttacks::getMode(const string &default_mode) const
|
||||
{
|
||||
if (mode == "Unset" || (key_to_practices_val.find(mode) == key_to_practices_val.end())) {
|
||||
if (mode == "Unset" || (key_to_practices_val2.find(mode) == key_to_practices_val2.end())) {
|
||||
dbgError(D_LOCAL_POLICY) << "Couldn't find a value for key: " << mode << ". Returning " << default_mode;
|
||||
return default_mode;
|
||||
}
|
||||
return key_to_practices_val.at(mode);
|
||||
return key_to_practices_val2.at(mode);
|
||||
}
|
||||
|
||||
SnortProtectionsSection::SnortProtectionsSection(
|
||||
|
Loading…
x
Reference in New Issue
Block a user