diff --git a/headers/modsecurity/actions/action.h b/headers/modsecurity/actions/action.h index 17aa922a..f44b1158 100644 --- a/headers/modsecurity/actions/action.h +++ b/headers/modsecurity/actions/action.h @@ -69,12 +69,6 @@ class Action { return true; } - - virtual bool execute(Transaction *transaction = nullptr) noexcept { - return true; - } - - const std::string *getName() const noexcept { return &m_name; } diff --git a/src/actions/action_type_rule_metadata.h b/src/actions/action_type_rule_metadata.h index a3ba810c..2470a4b8 100644 --- a/src/actions/action_type_rule_metadata.h +++ b/src/actions/action_type_rule_metadata.h @@ -37,10 +37,6 @@ class ActionTypeRuleMetaData : public virtual Action { : Action() { }; - bool execute(Transaction *t) noexcept override { - return true; - } - virtual void configure(RuleWithActions *rule) = 0; }; diff --git a/src/actions/action_with_execution.h b/src/actions/action_with_execution.h new file mode 100644 index 00000000..277b7d0d --- /dev/null +++ b/src/actions/action_with_execution.h @@ -0,0 +1,41 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2020 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +#include "modsecurity/actions/action.h" +#include "src/rule_with_actions.h" + +#ifndef SRC_ACTIONS_ACTION_WITH_EXECUTION_H_ +#define SRC_ACTIONS_ACTION_WITH_EXECUTION_H_ + + +namespace modsecurity { +namespace actions { + + +class ActionWithExecution : public virtual Action { + public: + ActionWithExecution() + : Action() + { }; + + virtual bool execute(Transaction *t) const noexcept = 0; +}; + + +} // namespace actions +} // namespace modsecurity + +#endif // SRC_ACTIONS_ACTION_WITH_EXECUTION_H_ diff --git a/src/actions/ctl/audit_log_parts.cc b/src/actions/ctl/audit_log_parts.cc index 3ee05bb4..d06bd6bc 100644 --- a/src/actions/ctl/audit_log_parts.cc +++ b/src/actions/ctl/audit_log_parts.cc @@ -55,7 +55,7 @@ bool AuditLogParts::init(std::string *error) { } -bool AuditLogParts::execute(Transaction *transaction) noexcept { +bool AuditLogParts::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 7, "AuditLog parts before modification: " + std::to_string(transaction->m_auditLogParts) + "."); diff --git a/src/actions/ctl/audit_log_parts.h b/src/actions/ctl/audit_log_parts.h index 7d1a8d6d..f1a8de67 100644 --- a/src/actions/ctl/audit_log_parts.h +++ b/src/actions/ctl/audit_log_parts.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class AuditLogParts : public Action { +class AuditLogParts : public ActionWithExecution { public: explicit AuditLogParts(const std::string &action) : Action(action), @@ -38,7 +39,7 @@ class AuditLogParts : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; protected: int m_partsToModify; diff --git a/src/actions/ctl/request_body_access.cc b/src/actions/ctl/request_body_access.cc index 24fe6115..e95e2701 100644 --- a/src/actions/ctl/request_body_access.cc +++ b/src/actions/ctl/request_body_access.cc @@ -44,7 +44,7 @@ bool RequestBodyAccess::init(std::string *error) { } -bool RequestBodyAccess::execute(Transaction *transaction) noexcept { +bool RequestBodyAccess::execute(Transaction *transaction) const noexcept { if (m_requestBodyAccess) { transaction->m_requestBodyAccess = RulesSetProperties::TrueConfigBoolean; diff --git a/src/actions/ctl/request_body_access.h b/src/actions/ctl/request_body_access.h index 403b4770..c1cdb5a2 100644 --- a/src/actions/ctl/request_body_access.h +++ b/src/actions/ctl/request_body_access.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_REQUEST_BODY_ACCESS_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class RequestBodyAccess : public Action { +class RequestBodyAccess : public ActionWithExecution { public: explicit RequestBodyAccess(const std::string &action) : Action(action), @@ -38,7 +39,7 @@ class RequestBodyAccess : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: bool m_requestBodyAccess; diff --git a/src/actions/ctl/request_body_processor_json.cc b/src/actions/ctl/request_body_processor_json.cc index a68d41e6..65389955 100644 --- a/src/actions/ctl/request_body_processor_json.cc +++ b/src/actions/ctl/request_body_processor_json.cc @@ -26,7 +26,7 @@ namespace actions { namespace ctl { -bool RequestBodyProcessorJSON::execute(Transaction *transaction) noexcept { +bool RequestBodyProcessorJSON::execute(Transaction *transaction) const noexcept { transaction->m_requestBodyProcessor = Transaction::JSONRequestBody; transaction->m_variableReqbodyProcessor.set("JSON", transaction->m_variableOffset); diff --git a/src/actions/ctl/request_body_processor_json.h b/src/actions/ctl/request_body_processor_json.h index 0cec2a8c..ac0dd41d 100644 --- a/src/actions/ctl/request_body_processor_json.h +++ b/src/actions/ctl/request_body_processor_json.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_REQUEST_BODY_PROCESSOR_JSON_H_ @@ -29,13 +30,13 @@ namespace actions { namespace ctl { -class RequestBodyProcessorJSON : public Action { +class RequestBodyProcessorJSON : public ActionWithExecution { public: explicit RequestBodyProcessorJSON(const std::string &action) : Action(action) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/ctl/request_body_processor_urlencoded.cc b/src/actions/ctl/request_body_processor_urlencoded.cc index 12c0f7e9..9394937b 100644 --- a/src/actions/ctl/request_body_processor_urlencoded.cc +++ b/src/actions/ctl/request_body_processor_urlencoded.cc @@ -27,7 +27,7 @@ namespace ctl { bool RequestBodyProcessorURLENCODED::execute( - Transaction *transaction) noexcept { + Transaction *transaction) const noexcept { transaction->m_requestBodyType = Transaction::WWWFormUrlEncoded; transaction->m_variableReqbodyProcessor.set("URLENCODED", transaction->m_variableOffset); diff --git a/src/actions/ctl/request_body_processor_urlencoded.h b/src/actions/ctl/request_body_processor_urlencoded.h index a4c94e97..28044d65 100644 --- a/src/actions/ctl/request_body_processor_urlencoded.h +++ b/src/actions/ctl/request_body_processor_urlencoded.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_REQUEST_BODY_PROCESSOR_URLENCODED_H_ @@ -29,13 +30,13 @@ namespace actions { namespace ctl { -class RequestBodyProcessorURLENCODED : public Action { +class RequestBodyProcessorURLENCODED : public ActionWithExecution { public: explicit RequestBodyProcessorURLENCODED(const std::string &action) : Action(action) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/ctl/request_body_processor_xml.cc b/src/actions/ctl/request_body_processor_xml.cc index 5331dc55..ca281734 100644 --- a/src/actions/ctl/request_body_processor_xml.cc +++ b/src/actions/ctl/request_body_processor_xml.cc @@ -26,7 +26,7 @@ namespace actions { namespace ctl { -bool RequestBodyProcessorXML::execute(Transaction *transaction) noexcept { +bool RequestBodyProcessorXML::execute(Transaction *transaction) const noexcept { transaction->m_requestBodyProcessor = Transaction::XMLRequestBody; transaction->m_variableReqbodyProcessor.set("XML", transaction->m_variableOffset); diff --git a/src/actions/ctl/request_body_processor_xml.h b/src/actions/ctl/request_body_processor_xml.h index fab8d358..46bb85a7 100644 --- a/src/actions/ctl/request_body_processor_xml.h +++ b/src/actions/ctl/request_body_processor_xml.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_REQUEST_BODY_PROCESSOR_XML_H_ @@ -29,13 +30,13 @@ namespace actions { namespace ctl { -class RequestBodyProcessorXML : public Action { +class RequestBodyProcessorXML : public ActionWithExecution { public: explicit RequestBodyProcessorXML(const std::string &action) : Action(action) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/ctl/rule_engine.cc b/src/actions/ctl/rule_engine.cc index cbd4d073..81612af7 100644 --- a/src/actions/ctl/rule_engine.cc +++ b/src/actions/ctl/rule_engine.cc @@ -47,7 +47,7 @@ bool RuleEngine::init(std::string *error) { } -bool RuleEngine::execute(Transaction *transaction) noexcept { +bool RuleEngine::execute(Transaction *transaction) const noexcept { std::stringstream a; a << "Setting SecRuleEngine to "; a << modsecurity::RulesSetProperties::ruleEngineStateString(m_ruleEngine); diff --git a/src/actions/ctl/rule_engine.h b/src/actions/ctl/rule_engine.h index ee66d55b..c8c87f43 100644 --- a/src/actions/ctl/rule_engine.h +++ b/src/actions/ctl/rule_engine.h @@ -18,6 +18,7 @@ #include "modsecurity/rules_set_properties.h" #include "modsecurity/actions/action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_RULE_ENGINE_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class RuleEngine : public Action { +class RuleEngine : public ActionWithExecution { public: explicit RuleEngine(const std::string &action) : Action(action), @@ -38,7 +39,7 @@ class RuleEngine : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: RulesSetProperties::RuleEngine m_ruleEngine; diff --git a/src/actions/ctl/rule_remove_by_id.cc b/src/actions/ctl/rule_remove_by_id.cc index 846fee82..f6fb9b7b 100644 --- a/src/actions/ctl/rule_remove_by_id.cc +++ b/src/actions/ctl/rule_remove_by_id.cc @@ -88,7 +88,7 @@ bool RuleRemoveById::init(std::string *error) { } -bool RuleRemoveById::execute(Transaction *transaction) noexcept { +bool RuleRemoveById::execute(Transaction *transaction) const noexcept { for (auto &i : m_ids) { transaction->m_ruleRemoveById.push_back(i); } diff --git a/src/actions/ctl/rule_remove_by_id.h b/src/actions/ctl/rule_remove_by_id.h index debd6a66..b4e06fb9 100644 --- a/src/actions/ctl/rule_remove_by_id.h +++ b/src/actions/ctl/rule_remove_by_id.h @@ -20,6 +20,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_RULE_REMOVE_BY_ID_H_ @@ -31,7 +32,7 @@ namespace actions { namespace ctl { -class RuleRemoveById : public Action { +class RuleRemoveById : public ActionWithExecution { public: explicit RuleRemoveById(const std::string &action) : Action(action) @@ -39,7 +40,7 @@ class RuleRemoveById : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: std::list > m_ranges; diff --git a/src/actions/ctl/rule_remove_by_tag.cc b/src/actions/ctl/rule_remove_by_tag.cc index 6ebdc31c..0d491256 100644 --- a/src/actions/ctl/rule_remove_by_tag.cc +++ b/src/actions/ctl/rule_remove_by_tag.cc @@ -34,7 +34,7 @@ bool RuleRemoveByTag::init(std::string *error) { } -bool RuleRemoveByTag::execute(Transaction *transaction) noexcept { +bool RuleRemoveByTag::execute(Transaction *transaction) const noexcept { transaction->m_ruleRemoveByTag.push_back(m_tag); return true; } diff --git a/src/actions/ctl/rule_remove_by_tag.h b/src/actions/ctl/rule_remove_by_tag.h index fa5fd53c..3461b636 100644 --- a/src/actions/ctl/rule_remove_by_tag.h +++ b/src/actions/ctl/rule_remove_by_tag.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_RULE_REMOVE_BY_TAG_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class RuleRemoveByTag : public Action { +class RuleRemoveByTag : public ActionWithExecution { public: explicit RuleRemoveByTag(const std::string &action) : Action(action), @@ -38,7 +39,7 @@ class RuleRemoveByTag : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: std::string m_tag; diff --git a/src/actions/ctl/rule_remove_target_by_id.cc b/src/actions/ctl/rule_remove_target_by_id.cc index 236dfa64..def0ad7d 100644 --- a/src/actions/ctl/rule_remove_target_by_id.cc +++ b/src/actions/ctl/rule_remove_target_by_id.cc @@ -53,7 +53,7 @@ bool RuleRemoveTargetById::init(std::string *error) { } -bool RuleRemoveTargetById::execute(Transaction *transaction) noexcept { +bool RuleRemoveTargetById::execute(Transaction *transaction) const noexcept { transaction->m_ruleRemoveTargetById.push_back( std::make_pair(m_id, m_target)); return true; diff --git a/src/actions/ctl/rule_remove_target_by_id.h b/src/actions/ctl/rule_remove_target_by_id.h index 62ac870e..7dfec0f1 100644 --- a/src/actions/ctl/rule_remove_target_by_id.h +++ b/src/actions/ctl/rule_remove_target_by_id.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_RULE_REMOVE_TARGET_BY_ID_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class RuleRemoveTargetById : public Action { +class RuleRemoveTargetById : public ActionWithExecution { public: explicit RuleRemoveTargetById(const std::string &action) : Action(action), @@ -39,7 +40,7 @@ class RuleRemoveTargetById : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: int m_id; diff --git a/src/actions/ctl/rule_remove_target_by_tag.cc b/src/actions/ctl/rule_remove_target_by_tag.cc index 8d676a14..6f30df65 100644 --- a/src/actions/ctl/rule_remove_target_by_tag.cc +++ b/src/actions/ctl/rule_remove_target_by_tag.cc @@ -46,7 +46,7 @@ bool RuleRemoveTargetByTag::init(std::string *error) { } -bool RuleRemoveTargetByTag::execute(Transaction *transaction) noexcept { +bool RuleRemoveTargetByTag::execute(Transaction *transaction) const noexcept { transaction->m_ruleRemoveTargetByTag.push_back( std::make_pair(m_tag, m_target)); return true; diff --git a/src/actions/ctl/rule_remove_target_by_tag.h b/src/actions/ctl/rule_remove_target_by_tag.h index 90ab530d..eadc4e0f 100644 --- a/src/actions/ctl/rule_remove_target_by_tag.h +++ b/src/actions/ctl/rule_remove_target_by_tag.h @@ -18,6 +18,7 @@ #include "modsecurity/actions/action.h" #include "modsecurity/transaction.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_CTL_RULE_REMOVE_TARGET_BY_TAG_H_ @@ -29,7 +30,7 @@ namespace actions { namespace ctl { -class RuleRemoveTargetByTag : public Action { +class RuleRemoveTargetByTag : public ActionWithExecution { public: explicit RuleRemoveTargetByTag(const std::string &action) : Action(action) @@ -37,7 +38,7 @@ class RuleRemoveTargetByTag : public Action { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: std::string m_tag; diff --git a/src/actions/data/status.cc b/src/actions/data/status.cc index a6702e89..93213316 100644 --- a/src/actions/data/status.cc +++ b/src/actions/data/status.cc @@ -38,7 +38,7 @@ bool Status::init(std::string *error) { } -bool Status::execute(Transaction *transaction) noexcept { +bool Status::execute(Transaction *transaction) const noexcept { transaction->m_it.status = m_status; return true; } diff --git a/src/actions/data/status.h b/src/actions/data/status.h index b96a3d4a..b5d51ba7 100644 --- a/src/actions/data/status.h +++ b/src/actions/data/status.h @@ -20,6 +20,7 @@ #include "modsecurity/transaction.h" #include "src/actions/action_allowed_in_sec_default_action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DATA_STATUS_H_ @@ -31,7 +32,7 @@ namespace actions { namespace data { -class Status : public ActionAllowedAsSecDefaultAction { +class Status : public ActionAllowedAsSecDefaultAction, public ActionWithExecution { public: explicit Status(const std::string &action) : Action(action), @@ -40,7 +41,7 @@ class Status : public ActionAllowedAsSecDefaultAction { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: int m_status; diff --git a/src/actions/disruptive/allow.cc b/src/actions/disruptive/allow.cc index 9d1b0575..c644ee74 100644 --- a/src/actions/disruptive/allow.cc +++ b/src/actions/disruptive/allow.cc @@ -52,7 +52,7 @@ bool Allow::init(std::string *error) { } -bool Allow::execute(Transaction *transaction) noexcept { +bool Allow::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 4, "Dropping the evaluation of upcoming rules " \ "in favor of an `allow' action of type: " \ + allowTypeToName(m_allowType)); diff --git a/src/actions/disruptive/allow.h b/src/actions/disruptive/allow.h index 2f94f961..e8dd14e7 100644 --- a/src/actions/disruptive/allow.h +++ b/src/actions/disruptive/allow.h @@ -20,6 +20,7 @@ #include "modsecurity/transaction.h" #include "src/actions/disruptive/disruptive_action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DISRUPTIVE_ALLOW_H_ @@ -51,7 +52,7 @@ enum AllowType : int { }; -class Allow : public ActionDisruptive { +class Allow : public ActionDisruptive, public ActionWithExecution { public: explicit Allow(const std::string &action) : Action(action), @@ -60,7 +61,7 @@ class Allow : public ActionDisruptive { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: AllowType m_allowType; diff --git a/src/actions/disruptive/deny.cc b/src/actions/disruptive/deny.cc index 89d2b871..44e17621 100644 --- a/src/actions/disruptive/deny.cc +++ b/src/actions/disruptive/deny.cc @@ -32,7 +32,7 @@ namespace actions { namespace disruptive { -bool Deny::execute(Transaction *transaction) noexcept { +bool Deny::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 8, "Running action deny"); if (transaction->m_it.status == 200) { diff --git a/src/actions/disruptive/deny.h b/src/actions/disruptive/deny.h index 703f3742..21381f49 100644 --- a/src/actions/disruptive/deny.h +++ b/src/actions/disruptive/deny.h @@ -20,6 +20,7 @@ #include "modsecurity/transaction.h" #include "src/actions/disruptive/disruptive_action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DISRUPTIVE_DENY_H_ @@ -31,13 +32,13 @@ namespace actions { namespace disruptive { -class Deny : public ActionDisruptive { +class Deny : public ActionDisruptive, public ActionWithExecution { public: Deny() : Action("deny") { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/disruptive/drop.cc b/src/actions/disruptive/drop.cc index 3243e471..a4f1864a 100644 --- a/src/actions/disruptive/drop.cc +++ b/src/actions/disruptive/drop.cc @@ -32,7 +32,7 @@ namespace actions { namespace disruptive { -bool Drop::execute(Transaction *transaction) noexcept { +bool Drop::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 8, "Running action drop " \ "[executing deny instead of drop.]"); diff --git a/src/actions/disruptive/drop.h b/src/actions/disruptive/drop.h index d9ac8be4..840bf830 100644 --- a/src/actions/disruptive/drop.h +++ b/src/actions/disruptive/drop.h @@ -20,6 +20,7 @@ #include "modsecurity/transaction.h" #include "src/actions/disruptive/disruptive_action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DISRUPTIVE_DROP_H_ @@ -31,13 +32,13 @@ namespace actions { namespace disruptive { -class Drop : public ActionDisruptive { +class Drop : public ActionDisruptive, public ActionWithExecution { public: Drop() : Action("drop") { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/disruptive/pass.cc b/src/actions/disruptive/pass.cc index ee20ed14..84941334 100644 --- a/src/actions/disruptive/pass.cc +++ b/src/actions/disruptive/pass.cc @@ -31,7 +31,7 @@ namespace actions { namespace disruptive { -bool Pass::execute(Transaction *transaction) noexcept { +bool Pass::execute(Transaction *transaction) const noexcept { intervention::free(&transaction->m_it); intervention::reset(&transaction->m_it); diff --git a/src/actions/disruptive/pass.h b/src/actions/disruptive/pass.h index a09e3fa5..023aa210 100644 --- a/src/actions/disruptive/pass.h +++ b/src/actions/disruptive/pass.h @@ -20,6 +20,7 @@ #include "modsecurity/transaction.h" #include "src/actions/disruptive/disruptive_action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DISRUPTIVE_PASS_H_ @@ -31,13 +32,13 @@ namespace actions { namespace disruptive { -class Pass : public ActionDisruptive { +class Pass : public ActionDisruptive, public ActionWithExecution { public: Pass() : Action("pass") { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; }; diff --git a/src/actions/disruptive/redirect.cc b/src/actions/disruptive/redirect.cc index 13a64643..fd419386 100644 --- a/src/actions/disruptive/redirect.cc +++ b/src/actions/disruptive/redirect.cc @@ -32,7 +32,7 @@ namespace actions { namespace disruptive { -bool Redirect::execute(Transaction *transaction) noexcept { +bool Redirect::execute(Transaction *transaction) const noexcept { std::string m_urlExpanded(getEvaluatedRunTimeString(transaction)); /* if it was changed before, lets keep it. */ if (transaction->m_it.status == 200 diff --git a/src/actions/disruptive/redirect.h b/src/actions/disruptive/redirect.h index 6f00af7f..a4094b63 100644 --- a/src/actions/disruptive/redirect.h +++ b/src/actions/disruptive/redirect.h @@ -24,6 +24,7 @@ #include "src/actions/action_with_run_time_string.h" #include "src/actions/disruptive/disruptive_action.h" #include "src/run_time_string.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_DISRUPTIVE_REDIRECT_H_ @@ -35,7 +36,8 @@ namespace actions { namespace disruptive { -class Redirect : public ActionWithRunTimeString, public ActionDisruptive { +class Redirect : public ActionWithRunTimeString, public ActionDisruptive, + public ActionWithExecution { public: explicit Redirect(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -52,7 +54,7 @@ class Redirect : public ActionWithRunTimeString, public ActionDisruptive { { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { diff --git a/src/actions/exec.cc b/src/actions/exec.cc index 3d8b6601..5047846f 100644 --- a/src/actions/exec.cc +++ b/src/actions/exec.cc @@ -52,7 +52,7 @@ bool Exec::init(std::string *error) { } -bool Exec::execute(Transaction *t) noexcept { +bool Exec::execute(Transaction *t) const noexcept { ms_dbg_a(t, 8, "Running script... " + m_script); m_lua.run(t); return true; diff --git a/src/actions/exec.h b/src/actions/exec.h index 7fca049f..6398ea9d 100644 --- a/src/actions/exec.h +++ b/src/actions/exec.h @@ -18,6 +18,8 @@ #include "modsecurity/actions/action.h" #include "src/engine/lua.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_EXEC_H_ #define SRC_ACTIONS_EXEC_H_ @@ -27,7 +29,7 @@ namespace modsecurity { namespace actions { -class Exec : public Action { +class Exec : public ActionWithExecution { public: explicit Exec(const std::string &action) : Action(action), @@ -36,7 +38,7 @@ class Exec : public Action { ~Exec() { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; bool init(std::string *error) override; private: diff --git a/src/actions/expire_var.h b/src/actions/expire_var.h new file mode 100644 index 00000000..415fb146 --- /dev/null +++ b/src/actions/expire_var.h @@ -0,0 +1,54 @@ +/* + * ModSecurity, http://www.modsecurity.org/ + * Copyright (c) 2015 - 2020 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * + * You may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * If any of the files related to licensing are missing or if you have any + * other questions related to licensing please contact Trustwave Holdings, Inc. + * directly using the email address security@modsecurity.org. + * + */ + + +#include +#include +#include + +#include "modsecurity/actions/action.h" +#include "modsecurity/transaction.h" +#include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + + +#ifndef SRC_ACTIONS_EXPIRE_VAR_H_ +#define SRC_ACTIONS_EXPIRE_VAR_H_ + + +namespace modsecurity { +namespace actions { + + +class ExpireVar : public ActionWithExecution { + public: + explicit ExpireVar(const std::string &action) + : Action(action) + { } + + ~ExpireVar() { } + + bool execute(Transaction *transaction) const noexcept override { return true; }; + bool init(std::string *error) override { return true; }; + + private: +}; + + +} // namespace actions +} // namespace modsecurity + + +#endif // SRC_ACTIONS_EXPIRE_VAR_H_ diff --git a/src/actions/init_col.cc b/src/actions/init_col.cc index 2de14054..fb4b48b8 100644 --- a/src/actions/init_col.cc +++ b/src/actions/init_col.cc @@ -57,7 +57,7 @@ bool InitCol::init(std::string *error) { } -bool InitCol::execute(Transaction *t) noexcept { +bool InitCol::execute(Transaction *t) const noexcept { std::string collectionName(getEvaluatedRunTimeString(t)); if (m_collection_key == "ip") { diff --git a/src/actions/init_col.h b/src/actions/init_col.h index 3554a17d..58a34de8 100644 --- a/src/actions/init_col.h +++ b/src/actions/init_col.h @@ -20,6 +20,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_INIT_COL_H_ #define SRC_ACTIONS_INIT_COL_H_ @@ -30,7 +32,7 @@ class Transaction; namespace actions { -class InitCol : public ActionWithRunTimeString { +class InitCol : public ActionWithRunTimeString, public ActionWithExecution { public: InitCol( const std::string &action, @@ -47,7 +49,7 @@ class InitCol : public ActionWithRunTimeString { bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new InitCol(*this); diff --git a/src/actions/log_data.cc b/src/actions/log_data.cc index f9a73b7d..ed8fa44b 100644 --- a/src/actions/log_data.cc +++ b/src/actions/log_data.cc @@ -25,7 +25,7 @@ namespace modsecurity { namespace actions { -bool LogData::execute(Transaction *transaction) noexcept { +bool LogData::execute(Transaction *transaction) const noexcept { transaction->messageGetLast()->m_data = getEvaluatedRunTimeString(transaction); return true; diff --git a/src/actions/log_data.h b/src/actions/log_data.h index a4f8fabf..3aacd7f4 100644 --- a/src/actions/log_data.h +++ b/src/actions/log_data.h @@ -18,6 +18,7 @@ #include "src/actions/action_with_run_time_string.h" #include "src/run_time_string.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_LOG_DATA_H_ @@ -28,7 +29,7 @@ namespace modsecurity { namespace actions { -class LogData : public ActionWithRunTimeString { +class LogData : public ActionWithRunTimeString, public ActionWithExecution { public: explicit LogData(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -40,7 +41,7 @@ class LogData : public ActionWithRunTimeString { Action(data) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new LogData(*this); diff --git a/src/actions/msg.cc b/src/actions/msg.cc index e882fab3..157e7104 100644 --- a/src/actions/msg.cc +++ b/src/actions/msg.cc @@ -49,7 +49,7 @@ namespace modsecurity { namespace actions { -bool Msg::execute(Transaction *transaction) noexcept { +bool Msg::execute(Transaction *transaction) const noexcept { std::string msg = getEvaluatedRunTimeString(transaction); transaction->messageGetLast()->m_message = msg; ms_dbg_a(transaction, 9, "Saving msg: " + msg); diff --git a/src/actions/msg.h b/src/actions/msg.h index eea2ce67..5379258a 100644 --- a/src/actions/msg.h +++ b/src/actions/msg.h @@ -21,6 +21,8 @@ #include "modsecurity/actions/action.h" #include "modsecurity/rule_message.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_MSG_H_ #define SRC_ACTIONS_MSG_H_ @@ -32,7 +34,7 @@ class Transaction; namespace actions { -class Msg : public ActionWithRunTimeString { +class Msg : public ActionWithRunTimeString, public ActionWithExecution { public: explicit Msg(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -44,7 +46,7 @@ class Msg : public ActionWithRunTimeString { Action(action) { }; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new Msg(*this); diff --git a/src/actions/set_env.cc b/src/actions/set_env.cc index 38131973..f802954c 100644 --- a/src/actions/set_env.cc +++ b/src/actions/set_env.cc @@ -32,7 +32,7 @@ namespace modsecurity { namespace actions { -bool SetENV::execute(Transaction *t) noexcept { +bool SetENV::execute(Transaction *t) const noexcept { std::string colNameExpanded(getEvaluatedRunTimeString(t)); ms_dbg_a(t, 8, "Setting envoriment variable: " diff --git a/src/actions/set_env.h b/src/actions/set_env.h index d150b6aa..d60a11da 100644 --- a/src/actions/set_env.h +++ b/src/actions/set_env.h @@ -20,6 +20,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_SET_ENV_H_ #define SRC_ACTIONS_SET_ENV_H_ @@ -31,7 +33,7 @@ class Transaction; namespace actions { -class SetENV : public ActionWithRunTimeString { +class SetENV : public ActionWithRunTimeString, public ActionWithExecution { public: explicit SetENV(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -43,7 +45,7 @@ class SetENV : public ActionWithRunTimeString { Action(action) { }; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new SetENV(*this); diff --git a/src/actions/set_rsc.cc b/src/actions/set_rsc.cc index dc3ddbea..75c35e05 100644 --- a/src/actions/set_rsc.cc +++ b/src/actions/set_rsc.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { -bool SetRSC::execute(Transaction *t) noexcept { +bool SetRSC::execute(Transaction *t) const noexcept { std::string colNameExpanded(getEvaluatedRunTimeString(t)); ms_dbg_a(t, 8, "RESOURCE initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/actions/set_rsc.h b/src/actions/set_rsc.h index f83bd479..058f5365 100644 --- a/src/actions/set_rsc.h +++ b/src/actions/set_rsc.h @@ -20,6 +20,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_SET_RSC_H_ #define SRC_ACTIONS_SET_RSC_H_ @@ -31,7 +33,7 @@ class Transaction; namespace actions { -class SetRSC : public ActionWithRunTimeString { +class SetRSC : public ActionWithRunTimeString, public ActionWithExecution { public: explicit SetRSC(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -43,7 +45,7 @@ class SetRSC : public ActionWithRunTimeString { Action(action) { }; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new SetRSC(*this); diff --git a/src/actions/set_sid.cc b/src/actions/set_sid.cc index 5983745e..820edb4e 100644 --- a/src/actions/set_sid.cc +++ b/src/actions/set_sid.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { -bool SetSID::execute(Transaction *t) noexcept { +bool SetSID::execute(Transaction *t) const noexcept { std::string colNameExpanded(getEvaluatedRunTimeString(t)); ms_dbg_a(t, 8, "Session ID initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/actions/set_sid.h b/src/actions/set_sid.h index d7b8c1a4..2928a18a 100644 --- a/src/actions/set_sid.h +++ b/src/actions/set_sid.h @@ -20,6 +20,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_SET_SID_H_ #define SRC_ACTIONS_SET_SID_H_ @@ -31,7 +33,7 @@ class Transaction; namespace actions { -class SetSID : public ActionWithRunTimeString { +class SetSID : public ActionWithRunTimeString, public ActionWithExecution { public: explicit SetSID(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -43,7 +45,7 @@ class SetSID : public ActionWithRunTimeString { Action(action) { }; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new SetSID(*this); diff --git a/src/actions/set_uid.cc b/src/actions/set_uid.cc index 958d634b..7069a1ca 100644 --- a/src/actions/set_uid.cc +++ b/src/actions/set_uid.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { -bool SetUID::execute(Transaction *t) noexcept { +bool SetUID::execute(Transaction *t) const noexcept { std::string colNameExpanded(getEvaluatedRunTimeString(t)); ms_dbg_a(t, 8, "User collection initiated with value: \'" + colNameExpanded + "\'."); diff --git a/src/actions/set_uid.h b/src/actions/set_uid.h index 5eaa2a0c..4a7c363a 100644 --- a/src/actions/set_uid.h +++ b/src/actions/set_uid.h @@ -20,6 +20,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_SET_UID_H_ #define SRC_ACTIONS_SET_UID_H_ @@ -31,7 +33,7 @@ class Transaction; namespace actions { -class SetUID : public ActionWithRunTimeString { +class SetUID : public ActionWithRunTimeString, public ActionWithExecution { public: explicit SetUID(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -43,7 +45,7 @@ class SetUID : public ActionWithRunTimeString { Action(action) { }; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; ActionWithRunTimeString *clone() override { return new SetUID(*this); diff --git a/src/actions/set_var.cc b/src/actions/set_var.cc index 2b07940c..a69a16e6 100644 --- a/src/actions/set_var.cc +++ b/src/actions/set_var.cc @@ -42,7 +42,7 @@ bool SetVar::init(std::string *error) { } -bool SetVar::execute(Transaction *t) noexcept { +bool SetVar::execute(Transaction *t) const noexcept { std::string targetValue; std::string resolvedPre; diff --git a/src/actions/set_var.h b/src/actions/set_var.h index e200447c..3e1f29b7 100644 --- a/src/actions/set_var.h +++ b/src/actions/set_var.h @@ -23,6 +23,7 @@ #include "src/actions/action_with_run_time_string.h" #include "src/variables/variable_with_runtime_string.h" #include "src/rule_with_operator.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_SET_VAR_H_ @@ -47,7 +48,7 @@ enum SetVarOperation { }; -class SetVar : public ActionWithRunTimeString { +class SetVar : public ActionWithRunTimeString, public ActionWithExecution { public: SetVar(SetVarOperation operation, std::unique_ptr variable, @@ -84,7 +85,7 @@ class SetVar : public ActionWithRunTimeString { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; bool init(std::string *error) override; void populate(RuleWithActions *rule) override { diff --git a/src/actions/skip.cc b/src/actions/skip.cc index 07e69693..994e9e91 100644 --- a/src/actions/skip.cc +++ b/src/actions/skip.cc @@ -42,7 +42,7 @@ bool Skip::init(std::string *error) { } -bool Skip::execute(Transaction *transaction) noexcept { +bool Skip::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 5, "Skipping the next " + \ std::to_string(m_skip_next) + " rules."); diff --git a/src/actions/skip.h b/src/actions/skip.h index 35898e2b..6d362eb5 100644 --- a/src/actions/skip.h +++ b/src/actions/skip.h @@ -17,6 +17,7 @@ #include #include "modsecurity/actions/action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_SKIP_H_ @@ -29,14 +30,14 @@ class Transaction; namespace actions { -class Skip : public Action { +class Skip : public ActionWithExecution { public: explicit Skip(const std::string &action) : Action(action), m_skip_next(0) { } bool init(std::string *error) override; - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: int m_skip_next; diff --git a/src/actions/skip_after.cc b/src/actions/skip_after.cc index 5033df95..61daf115 100644 --- a/src/actions/skip_after.cc +++ b/src/actions/skip_after.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { -bool SkipAfter::execute(Transaction *transaction) noexcept { +bool SkipAfter::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 5, "Setting skipAfter for: " + *m_skipName); transaction->addMarker(m_skipName); return true; diff --git a/src/actions/skip_after.h b/src/actions/skip_after.h index 6c812b89..eee6e826 100644 --- a/src/actions/skip_after.h +++ b/src/actions/skip_after.h @@ -18,6 +18,7 @@ #include #include "modsecurity/actions/action.h" +#include "src/actions/action_with_execution.h" #ifndef SRC_ACTIONS_SKIP_AFTER_H_ @@ -28,14 +29,14 @@ namespace modsecurity { namespace actions { -class SkipAfter : public Action { +class SkipAfter : public ActionWithExecution { public: explicit SkipAfter(const std::string &action) : Action(action), m_skipName(std::make_shared(m_parserPayload)) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; private: // FIXME: This should be a regular pointer instead of a shared pointer. diff --git a/src/actions/tag.cc b/src/actions/tag.cc index 0ec22abb..a880d483 100644 --- a/src/actions/tag.cc +++ b/src/actions/tag.cc @@ -52,7 +52,7 @@ namespace modsecurity { namespace actions { -bool Tag::execute(Transaction *transaction) noexcept { +bool Tag::execute(Transaction *transaction) const noexcept { ms_dbg_a(transaction, 9, "Rule tag: " + getTagName(transaction)); return true; } diff --git a/src/actions/tag.h b/src/actions/tag.h index 8ff9ebbc..e11605ac 100644 --- a/src/actions/tag.h +++ b/src/actions/tag.h @@ -21,6 +21,8 @@ #include "modsecurity/actions/action.h" #include "src/actions/action_with_run_time_string.h" #include "src/actions/action_allowed_in_sec_default_action.h" +#include "src/actions/action_with_execution.h" + #ifndef SRC_ACTIONS_TAG_H_ #define SRC_ACTIONS_TAG_H_ @@ -31,7 +33,7 @@ namespace actions { class Tag : public ActionWithRunTimeString, - public ActionAllowedAsSecDefaultAction { + public ActionAllowedAsSecDefaultAction, public ActionWithExecution { public: explicit Tag(std::unique_ptr runTimeString) : ActionWithRunTimeString(std::move(runTimeString)), @@ -43,7 +45,7 @@ class Tag : public ActionWithRunTimeString, Action(action) { } - bool execute(Transaction *transaction) noexcept override; + bool execute(Transaction *transaction) const noexcept override; inline std::string getTagName(Transaction *transaction) const { return getEvaluatedRunTimeString(transaction); diff --git a/src/parser/seclang-parser.cc b/src/parser/seclang-parser.cc index cb910430..a7a2d084 100644 --- a/src/parser/seclang-parser.cc +++ b/src/parser/seclang-parser.cc @@ -42,7 +42,7 @@ // Unqualified %code blocks. -#line 326 "seclang-parser.yy" +#line 327 "seclang-parser.yy" #include "src/parser/driver.h" @@ -1314,7 +1314,7 @@ namespace yy { // User initialization code. -#line 319 "seclang-parser.yy" +#line 320 "seclang-parser.yy" { // Initialize the initial location. yyla.location.begin.filename = yyla.location.end.filename = new std::string(driver.file); @@ -1685,7 +1685,7 @@ namespace yy { switch (yyn) { case 2: -#line 711 "seclang-parser.yy" +#line 712 "seclang-parser.yy" { return 0; } @@ -1693,7 +1693,7 @@ namespace yy { break; case 6: -#line 724 "seclang-parser.yy" +#line 725 "seclang-parser.yy" { driver.m_auditLog->setStorageDirMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } @@ -1701,7 +1701,7 @@ namespace yy { break; case 7: -#line 730 "seclang-parser.yy" +#line 731 "seclang-parser.yy" { driver.m_auditLog->setStorageDir(yystack_[0].value.as < std::string > ()); } @@ -1709,7 +1709,7 @@ namespace yy { break; case 8: -#line 736 "seclang-parser.yy" +#line 737 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::RelevantOnlyAuditLogStatus); } @@ -1717,7 +1717,7 @@ namespace yy { break; case 9: -#line 740 "seclang-parser.yy" +#line 741 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OffAuditLogStatus); } @@ -1725,7 +1725,7 @@ namespace yy { break; case 10: -#line 744 "seclang-parser.yy" +#line 745 "seclang-parser.yy" { driver.m_auditLog->setStatus(modsecurity::audit_log::AuditLog::OnAuditLogStatus); } @@ -1733,7 +1733,7 @@ namespace yy { break; case 11: -#line 750 "seclang-parser.yy" +#line 751 "seclang-parser.yy" { driver.m_auditLog->setFileMode(strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8)); } @@ -1741,7 +1741,7 @@ namespace yy { break; case 12: -#line 756 "seclang-parser.yy" +#line 757 "seclang-parser.yy" { driver.m_auditLog->setFilePath2(yystack_[0].value.as < std::string > ()); } @@ -1749,7 +1749,7 @@ namespace yy { break; case 13: -#line 762 "seclang-parser.yy" +#line 763 "seclang-parser.yy" { driver.m_auditLog->setParts(yystack_[0].value.as < std::string > ()); } @@ -1757,7 +1757,7 @@ namespace yy { break; case 14: -#line 768 "seclang-parser.yy" +#line 769 "seclang-parser.yy" { driver.m_auditLog->setFilePath1(yystack_[0].value.as < std::string > ()); } @@ -1765,7 +1765,7 @@ namespace yy { break; case 15: -#line 773 "seclang-parser.yy" +#line 774 "seclang-parser.yy" { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::JSONAuditLogFormat); } @@ -1773,7 +1773,7 @@ namespace yy { break; case 16: -#line 778 "seclang-parser.yy" +#line 779 "seclang-parser.yy" { driver.m_auditLog->setFormat(modsecurity::audit_log::AuditLog::NativeAuditLogFormat); } @@ -1781,7 +1781,7 @@ namespace yy { break; case 17: -#line 784 "seclang-parser.yy" +#line 785 "seclang-parser.yy" { std::string relevant_status(yystack_[0].value.as < std::string > ()); driver.m_auditLog->setRelevantStatus(relevant_status); @@ -1790,7 +1790,7 @@ namespace yy { break; case 18: -#line 791 "seclang-parser.yy" +#line 792 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::SerialAuditLogType); } @@ -1798,7 +1798,7 @@ namespace yy { break; case 19: -#line 795 "seclang-parser.yy" +#line 796 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::ParallelAuditLogType); } @@ -1806,7 +1806,7 @@ namespace yy { break; case 20: -#line 799 "seclang-parser.yy" +#line 800 "seclang-parser.yy" { driver.m_auditLog->setType(modsecurity::audit_log::AuditLog::HttpsAuditLogType); } @@ -1814,7 +1814,7 @@ namespace yy { break; case 21: -#line 805 "seclang-parser.yy" +#line 806 "seclang-parser.yy" { driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -1822,7 +1822,7 @@ namespace yy { break; case 22: -#line 809 "seclang-parser.yy" +#line 810 "seclang-parser.yy" { driver.m_uploadKeepFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -1830,7 +1830,7 @@ namespace yy { break; case 23: -#line 813 "seclang-parser.yy" +#line 814 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecUploadKeepFiles RelevantOnly is not currently supported. Accepted values are On or Off"); YYERROR; @@ -1839,7 +1839,7 @@ namespace yy { break; case 24: -#line 818 "seclang-parser.yy" +#line 819 "seclang-parser.yy" { driver.m_uploadFileLimit.m_set = true; driver.m_uploadFileLimit.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 10); @@ -1848,7 +1848,7 @@ namespace yy { break; case 25: -#line 823 "seclang-parser.yy" +#line 824 "seclang-parser.yy" { driver.m_uploadFileMode.m_set = true; driver.m_uploadFileMode.m_value = strtol(yystack_[0].value.as < std::string > ().c_str(), NULL, 8); @@ -1857,7 +1857,7 @@ namespace yy { break; case 26: -#line 828 "seclang-parser.yy" +#line 829 "seclang-parser.yy" { driver.m_uploadDirectory.m_set = true; driver.m_uploadDirectory.m_value = yystack_[0].value.as < std::string > (); @@ -1866,7 +1866,7 @@ namespace yy { break; case 27: -#line 833 "seclang-parser.yy" +#line 834 "seclang-parser.yy" { driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -1874,7 +1874,7 @@ namespace yy { break; case 28: -#line 837 "seclang-parser.yy" +#line 838 "seclang-parser.yy" { driver.m_tmpSaveUploadedFiles = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -1882,7 +1882,7 @@ namespace yy { break; case 29: -#line 844 "seclang-parser.yy" +#line 845 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } @@ -1890,7 +1890,7 @@ namespace yy { break; case 30: -#line 848 "seclang-parser.yy" +#line 849 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } @@ -1898,7 +1898,7 @@ namespace yy { break; case 31: -#line 855 "seclang-parser.yy" +#line 856 "seclang-parser.yy" { ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[3].location) yystack_[2].value.as < std::unique_ptr > > > ()->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); @@ -1908,7 +1908,7 @@ namespace yy { break; case 32: -#line 861 "seclang-parser.yy" +#line 862 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); ACTION_INIT(yystack_[0].value.as < std::unique_ptr > (), yystack_[1].location) @@ -1919,7 +1919,7 @@ namespace yy { break; case 33: -#line 871 "seclang-parser.yy" +#line 872 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); std::string error; @@ -1932,7 +1932,7 @@ namespace yy { break; case 34: -#line 880 "seclang-parser.yy" +#line 881 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); yylhs.value.as < std::unique_ptr > ()->m_negation = true; @@ -1946,7 +1946,7 @@ namespace yy { break; case 35: -#line 890 "seclang-parser.yy" +#line 891 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); std::string error; @@ -1959,7 +1959,7 @@ namespace yy { break; case 36: -#line 899 "seclang-parser.yy" +#line 900 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yylhs.value.as < std::unique_ptr > ()->m_negation = true; @@ -1973,7 +1973,7 @@ namespace yy { break; case 37: -#line 912 "seclang-parser.yy" +#line 913 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::UnconditionalMatch()); } @@ -1981,7 +1981,7 @@ namespace yy { break; case 38: -#line 916 "seclang-parser.yy" +#line 917 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectSQLi()); } @@ -1989,7 +1989,7 @@ namespace yy { break; case 39: -#line 920 "seclang-parser.yy" +#line 921 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::DetectXSS()); } @@ -1997,7 +1997,7 @@ namespace yy { break; case 40: -#line 924 "seclang-parser.yy" +#line 925 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUrlEncoding()); } @@ -2005,7 +2005,7 @@ namespace yy { break; case 41: -#line 928 "seclang-parser.yy" +#line 929 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateUtf8Encoding()); } @@ -2013,7 +2013,7 @@ namespace yy { break; case 42: -#line 932 "seclang-parser.yy" +#line 933 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::InspectFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2021,7 +2021,7 @@ namespace yy { break; case 43: -#line 936 "seclang-parser.yy" +#line 937 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::FuzzyHash(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2029,7 +2029,7 @@ namespace yy { break; case 44: -#line 940 "seclang-parser.yy" +#line 941 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateByteRange(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2037,7 +2037,7 @@ namespace yy { break; case 45: -#line 944 "seclang-parser.yy" +#line 945 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateDTD(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2045,7 +2045,7 @@ namespace yy { break; case 46: -#line 948 "seclang-parser.yy" +#line 949 "seclang-parser.yy" { /* $$ = new operators::ValidateHash($1); */ OPERATOR_NOT_SUPPORTED("ValidateHash", yystack_[2].location); @@ -2054,7 +2054,7 @@ namespace yy { break; case 47: -#line 953 "seclang-parser.yy" +#line 954 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ValidateSchema(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2062,7 +2062,7 @@ namespace yy { break; case 48: -#line 957 "seclang-parser.yy" +#line 958 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2070,7 +2070,7 @@ namespace yy { break; case 49: -#line 961 "seclang-parser.yy" +#line 962 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifyCPF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2078,7 +2078,7 @@ namespace yy { break; case 50: -#line 965 "seclang-parser.yy" +#line 966 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySSN(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2086,7 +2086,7 @@ namespace yy { break; case 51: -#line 969 "seclang-parser.yy" +#line 970 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::VerifySVNR(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2094,7 +2094,7 @@ namespace yy { break; case 52: -#line 973 "seclang-parser.yy" +#line 974 "seclang-parser.yy" { /* $$ = new operators::GsbLookup($1); */ OPERATOR_NOT_SUPPORTED("GsbLookup", yystack_[2].location); @@ -2103,7 +2103,7 @@ namespace yy { break; case 53: -#line 978 "seclang-parser.yy" +#line 979 "seclang-parser.yy" { /* $$ = new operators::Rsub($1); */ OPERATOR_NOT_SUPPORTED("Rsub", yystack_[2].location); @@ -2112,7 +2112,7 @@ namespace yy { break; case 54: -#line 983 "seclang-parser.yy" +#line 984 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Within(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2120,7 +2120,7 @@ namespace yy { break; case 55: -#line 987 "seclang-parser.yy" +#line 988 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::ContainsWord(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2128,7 +2128,7 @@ namespace yy { break; case 56: -#line 991 "seclang-parser.yy" +#line 992 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Contains(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2136,7 +2136,7 @@ namespace yy { break; case 57: -#line 995 "seclang-parser.yy" +#line 996 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::EndsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2144,7 +2144,7 @@ namespace yy { break; case 58: -#line 999 "seclang-parser.yy" +#line 1000 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Eq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2152,7 +2152,7 @@ namespace yy { break; case 59: -#line 1003 "seclang-parser.yy" +#line 1004 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Ge(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2160,7 +2160,7 @@ namespace yy { break; case 60: -#line 1007 "seclang-parser.yy" +#line 1008 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Gt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2168,7 +2168,7 @@ namespace yy { break; case 61: -#line 1011 "seclang-parser.yy" +#line 1012 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatchF(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2176,7 +2176,7 @@ namespace yy { break; case 62: -#line 1015 "seclang-parser.yy" +#line 1016 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::IpMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2184,7 +2184,7 @@ namespace yy { break; case 63: -#line 1019 "seclang-parser.yy" +#line 1020 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Le(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2192,7 +2192,7 @@ namespace yy { break; case 64: -#line 1023 "seclang-parser.yy" +#line 1024 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Lt(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2200,7 +2200,7 @@ namespace yy { break; case 65: -#line 1027 "seclang-parser.yy" +#line 1028 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::PmFromFile(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2208,7 +2208,7 @@ namespace yy { break; case 66: -#line 1031 "seclang-parser.yy" +#line 1032 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Pm(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2216,7 +2216,7 @@ namespace yy { break; case 67: -#line 1035 "seclang-parser.yy" +#line 1036 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rbl(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2224,7 +2224,7 @@ namespace yy { break; case 68: -#line 1039 "seclang-parser.yy" +#line 1040 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::Rx(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2232,7 +2232,7 @@ namespace yy { break; case 69: -#line 1043 "seclang-parser.yy" +#line 1044 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrEq(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2240,7 +2240,7 @@ namespace yy { break; case 70: -#line 1047 "seclang-parser.yy" +#line 1048 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::StrMatch(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2248,7 +2248,7 @@ namespace yy { break; case 71: -#line 1051 "seclang-parser.yy" +#line 1052 "seclang-parser.yy" { OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::BeginsWith(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -2256,7 +2256,7 @@ namespace yy { break; case 72: -#line 1055 "seclang-parser.yy" +#line 1056 "seclang-parser.yy" { #if defined(WITH_GEOIP) or defined(WITH_MAXMIND) OPERATOR_CONTAINER(yylhs.value.as < std::unique_ptr > (), new operators::GeoLookup()); @@ -2271,7 +2271,7 @@ namespace yy { break; case 74: -#line 1070 "seclang-parser.yy" +#line 1071 "seclang-parser.yy" { std::vector *a = new std::vector(); std::vector > *t = new std::vector >(); @@ -2307,7 +2307,7 @@ namespace yy { break; case 75: -#line 1102 "seclang-parser.yy" +#line 1103 "seclang-parser.yy" { variables::Variables *v = new variables::Variables(); for (auto &i : *yystack_[1].value.as < std::unique_ptr > > > ().get()) { @@ -2330,7 +2330,7 @@ namespace yy { break; case 76: -#line 1121 "seclang-parser.yy" +#line 1122 "seclang-parser.yy" { std::vector *a = new std::vector(); std::vector > *t = new std::vector >(); @@ -2355,7 +2355,7 @@ namespace yy { break; case 77: -#line 1142 "seclang-parser.yy" +#line 1143 "seclang-parser.yy" { std::string err; std::vector *a = new std::vector(); @@ -2389,7 +2389,7 @@ namespace yy { break; case 78: -#line 1172 "seclang-parser.yy" +#line 1173 "seclang-parser.yy" { bool hasDisruptive = false; std::vector *actions = new std::vector(); @@ -2451,7 +2451,7 @@ namespace yy { break; case 79: -#line 1230 "seclang-parser.yy" +#line 1231 "seclang-parser.yy" { driver.addSecMarker(modsecurity::utils::string::removeBracketsIfNeeded(yystack_[0].value.as < std::string > ()), /* file name */ std::unique_ptr(new std::string(*yystack_[0].location.end.filename)), @@ -2462,7 +2462,7 @@ namespace yy { break; case 80: -#line 1237 "seclang-parser.yy" +#line 1238 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::DisabledRuleEngine; } @@ -2470,7 +2470,7 @@ namespace yy { break; case 81: -#line 1241 "seclang-parser.yy" +#line 1242 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::EnabledRuleEngine; } @@ -2478,7 +2478,7 @@ namespace yy { break; case 82: -#line 1245 "seclang-parser.yy" +#line 1246 "seclang-parser.yy" { driver.m_secRuleEngine = modsecurity::RulesSet::DetectionOnlyRuleEngine; } @@ -2486,7 +2486,7 @@ namespace yy { break; case 83: -#line 1249 "seclang-parser.yy" +#line 1250 "seclang-parser.yy" { driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -2494,7 +2494,7 @@ namespace yy { break; case 84: -#line 1253 "seclang-parser.yy" +#line 1254 "seclang-parser.yy" { driver.m_secRequestBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -2502,7 +2502,7 @@ namespace yy { break; case 85: -#line 1257 "seclang-parser.yy" +#line 1258 "seclang-parser.yy" { driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -2510,7 +2510,7 @@ namespace yy { break; case 86: -#line 1261 "seclang-parser.yy" +#line 1262 "seclang-parser.yy" { driver.m_secResponseBodyAccess = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -2518,7 +2518,7 @@ namespace yy { break; case 87: -#line 1265 "seclang-parser.yy" +#line 1266 "seclang-parser.yy" { if (yystack_[0].value.as < std::string > ().length() != 1) { driver.error(yystack_[1].location, "Argument separator should be set to a single character."); @@ -2531,7 +2531,7 @@ namespace yy { break; case 88: -#line 1274 "seclang-parser.yy" +#line 1275 "seclang-parser.yy" { driver.m_components.push_back(yystack_[0].value.as < std::string > ()); } @@ -2539,7 +2539,7 @@ namespace yy { break; case 89: -#line 1278 "seclang-parser.yy" +#line 1279 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecConnEngine is not yet supported."); YYERROR; @@ -2548,14 +2548,14 @@ namespace yy { break; case 90: -#line 1283 "seclang-parser.yy" +#line 1284 "seclang-parser.yy" { } #line 2555 "seclang-parser.cc" break; case 91: -#line 1286 "seclang-parser.yy" +#line 1287 "seclang-parser.yy" { driver.m_secWebAppId.m_value = yystack_[0].value.as < std::string > (); driver.m_secWebAppId.m_set = true; @@ -2564,7 +2564,7 @@ namespace yy { break; case 92: -#line 1291 "seclang-parser.yy" +#line 1292 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecServerSignature is not supported."); YYERROR; @@ -2573,7 +2573,7 @@ namespace yy { break; case 93: -#line 1296 "seclang-parser.yy" +#line 1297 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecCacheTransformations is not supported."); YYERROR; @@ -2582,7 +2582,7 @@ namespace yy { break; case 94: -#line 1301 "seclang-parser.yy" +#line 1302 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecDisableBackendCompression is not supported."); YYERROR; @@ -2591,14 +2591,14 @@ namespace yy { break; case 95: -#line 1306 "seclang-parser.yy" +#line 1307 "seclang-parser.yy" { } #line 2598 "seclang-parser.cc" break; case 96: -#line 1309 "seclang-parser.yy" +#line 1310 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecContentInjection is not yet supported."); YYERROR; @@ -2607,14 +2607,14 @@ namespace yy { break; case 97: -#line 1314 "seclang-parser.yy" +#line 1315 "seclang-parser.yy" { } #line 2614 "seclang-parser.cc" break; case 98: -#line 1317 "seclang-parser.yy" +#line 1318 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecChrootDir is not supported."); YYERROR; @@ -2623,7 +2623,7 @@ namespace yy { break; case 99: -#line 1322 "seclang-parser.yy" +#line 1323 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecHashEngine is not yet supported."); YYERROR; @@ -2632,14 +2632,14 @@ namespace yy { break; case 100: -#line 1327 "seclang-parser.yy" +#line 1328 "seclang-parser.yy" { } #line 2639 "seclang-parser.cc" break; case 101: -#line 1330 "seclang-parser.yy" +#line 1331 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashKey is not yet supported."); YYERROR; @@ -2648,7 +2648,7 @@ namespace yy { break; case 102: -#line 1335 "seclang-parser.yy" +#line 1336 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashParam is not yet supported."); YYERROR; @@ -2657,7 +2657,7 @@ namespace yy { break; case 103: -#line 1340 "seclang-parser.yy" +#line 1341 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashMethodRx is not yet supported."); YYERROR; @@ -2666,7 +2666,7 @@ namespace yy { break; case 104: -#line 1345 "seclang-parser.yy" +#line 1346 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecHashMethodPm is not yet supported."); YYERROR; @@ -2675,7 +2675,7 @@ namespace yy { break; case 105: -#line 1350 "seclang-parser.yy" +#line 1351 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecGsbLookupDb is not supported."); YYERROR; @@ -2684,7 +2684,7 @@ namespace yy { break; case 106: -#line 1355 "seclang-parser.yy" +#line 1356 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecGuardianLog is not supported."); YYERROR; @@ -2693,7 +2693,7 @@ namespace yy { break; case 107: -#line 1360 "seclang-parser.yy" +#line 1361 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecInterceptOnError is not yet supported."); YYERROR; @@ -2702,14 +2702,14 @@ namespace yy { break; case 108: -#line 1365 "seclang-parser.yy" +#line 1366 "seclang-parser.yy" { } #line 2709 "seclang-parser.cc" break; case 109: -#line 1368 "seclang-parser.yy" +#line 1369 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecConnReadStateLimit is not yet supported."); YYERROR; @@ -2718,7 +2718,7 @@ namespace yy { break; case 110: -#line 1373 "seclang-parser.yy" +#line 1374 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecConnWriteStateLimit is not yet supported."); YYERROR; @@ -2727,7 +2727,7 @@ namespace yy { break; case 111: -#line 1378 "seclang-parser.yy" +#line 1379 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecSensorId is not yet supported."); YYERROR; @@ -2736,7 +2736,7 @@ namespace yy { break; case 112: -#line 1383 "seclang-parser.yy" +#line 1384 "seclang-parser.yy" { driver.error(yystack_[2].location, "SecRuleInheritance is not yet supported."); YYERROR; @@ -2745,14 +2745,14 @@ namespace yy { break; case 113: -#line 1388 "seclang-parser.yy" +#line 1389 "seclang-parser.yy" { } #line 2752 "seclang-parser.cc" break; case 114: -#line 1391 "seclang-parser.yy" +#line 1392 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecRulePerfTime is not yet supported."); YYERROR; @@ -2761,7 +2761,7 @@ namespace yy { break; case 115: -#line 1396 "seclang-parser.yy" +#line 1397 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecStreamInBodyInspection is not supported."); YYERROR; @@ -2770,7 +2770,7 @@ namespace yy { break; case 116: -#line 1401 "seclang-parser.yy" +#line 1402 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecStreamOutBodyInspection is not supported."); YYERROR; @@ -2779,7 +2779,7 @@ namespace yy { break; case 117: -#line 1406 "seclang-parser.yy" +#line 1407 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.load(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2796,7 +2796,7 @@ namespace yy { break; case 118: -#line 1419 "seclang-parser.yy" +#line 1420 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadRemoveRuleByTag(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2813,7 +2813,7 @@ namespace yy { break; case 119: -#line 1432 "seclang-parser.yy" +#line 1433 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadRemoveRuleByMsg(yystack_[0].value.as < std::string > (), &error) == false) { @@ -2830,7 +2830,7 @@ namespace yy { break; case 120: -#line 1445 "seclang-parser.yy" +#line 1446 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadUpdateTargetByTag(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) { @@ -2847,7 +2847,7 @@ namespace yy { break; case 121: -#line 1458 "seclang-parser.yy" +#line 1459 "seclang-parser.yy" { std::string error; if (driver.m_exceptions.loadUpdateTargetByMsg(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > > > ()), &error) == false) { @@ -2864,7 +2864,7 @@ namespace yy { break; case 122: -#line 1471 "seclang-parser.yy" +#line 1472 "seclang-parser.yy" { std::string error; double ruleId; @@ -2894,7 +2894,7 @@ namespace yy { break; case 123: -#line 1497 "seclang-parser.yy" +#line 1498 "seclang-parser.yy" { std::string error; double ruleId; @@ -2925,7 +2925,7 @@ namespace yy { break; case 124: -#line 1525 "seclang-parser.yy" +#line 1526 "seclang-parser.yy" { if (driver.m_debugLog != NULL) { driver.m_debugLog->setDebugLogLevel(atoi(yystack_[0].value.as < std::string > ().c_str())); @@ -2941,7 +2941,7 @@ namespace yy { break; case 125: -#line 1537 "seclang-parser.yy" +#line 1538 "seclang-parser.yy" { if (driver.m_debugLog != NULL) { std::string error; @@ -2964,7 +2964,7 @@ namespace yy { break; case 126: -#line 1557 "seclang-parser.yy" +#line 1558 "seclang-parser.yy" { #if defined(WITH_GEOIP) or defined(WITH_MAXMIND) std::string err; @@ -2995,7 +2995,7 @@ namespace yy { break; case 127: -#line 1584 "seclang-parser.yy" +#line 1585 "seclang-parser.yy" { driver.m_argumentsLimit.m_set = true; driver.m_argumentsLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3004,7 +3004,7 @@ namespace yy { break; case 128: -#line 1590 "seclang-parser.yy" +#line 1591 "seclang-parser.yy" { driver.m_requestBodyLimit.m_set = true; driver.m_requestBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3013,7 +3013,7 @@ namespace yy { break; case 129: -#line 1595 "seclang-parser.yy" +#line 1596 "seclang-parser.yy" { driver.m_requestBodyNoFilesLimit.m_set = true; driver.m_requestBodyNoFilesLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3022,7 +3022,7 @@ namespace yy { break; case 130: -#line 1600 "seclang-parser.yy" +#line 1601 "seclang-parser.yy" { std::stringstream ss; ss << "As of ModSecurity version 3.0, SecRequestBodyInMemoryLimit is no longer "; @@ -3035,7 +3035,7 @@ namespace yy { break; case 131: -#line 1609 "seclang-parser.yy" +#line 1610 "seclang-parser.yy" { driver.m_responseBodyLimit.m_set = true; driver.m_responseBodyLimit.m_value = atoi(yystack_[0].value.as < std::string > ().c_str()); @@ -3044,7 +3044,7 @@ namespace yy { break; case 132: -#line 1614 "seclang-parser.yy" +#line 1615 "seclang-parser.yy" { driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } @@ -3052,7 +3052,7 @@ namespace yy { break; case 133: -#line 1618 "seclang-parser.yy" +#line 1619 "seclang-parser.yy" { driver.m_requestBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } @@ -3060,7 +3060,7 @@ namespace yy { break; case 134: -#line 1622 "seclang-parser.yy" +#line 1623 "seclang-parser.yy" { driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::ProcessPartialBodyLimitAction; } @@ -3068,7 +3068,7 @@ namespace yy { break; case 135: -#line 1626 "seclang-parser.yy" +#line 1627 "seclang-parser.yy" { driver.m_responseBodyLimitAction = modsecurity::RulesSet::BodyLimitAction::RejectBodyLimitAction; } @@ -3076,7 +3076,7 @@ namespace yy { break; case 136: -#line 1630 "seclang-parser.yy" +#line 1631 "seclang-parser.yy" { driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::AbortOnFailedRemoteRulesAction; } @@ -3084,7 +3084,7 @@ namespace yy { break; case 137: -#line 1634 "seclang-parser.yy" +#line 1635 "seclang-parser.yy" { driver.m_remoteRulesActionOnFailed = RulesSet::OnFailedRemoteRulesAction::WarnOnFailedRemoteRulesAction; } @@ -3092,7 +3092,7 @@ namespace yy { break; case 140: -#line 1648 "seclang-parser.yy" +#line 1649 "seclang-parser.yy" { std::istringstream buf(yystack_[0].value.as < std::string > ()); std::istream_iterator beg(buf), end; @@ -3108,7 +3108,7 @@ namespace yy { break; case 141: -#line 1660 "seclang-parser.yy" +#line 1661 "seclang-parser.yy" { driver.m_responseBodyTypeToBeInspected.m_set = true; driver.m_responseBodyTypeToBeInspected.m_clear = true; @@ -3118,7 +3118,7 @@ namespace yy { break; case 142: -#line 1666 "seclang-parser.yy" +#line 1667 "seclang-parser.yy" { driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::FalseConfigBoolean; } @@ -3126,7 +3126,7 @@ namespace yy { break; case 143: -#line 1670 "seclang-parser.yy" +#line 1671 "seclang-parser.yy" { driver.m_secXMLExternalEntity = modsecurity::RulesSetProperties::TrueConfigBoolean; } @@ -3134,7 +3134,7 @@ namespace yy { break; case 144: -#line 1674 "seclang-parser.yy" +#line 1675 "seclang-parser.yy" { /* Parser error disabled to avoid breaking default installations with modsecurity.conf-recommended std::stringstream ss; @@ -3149,7 +3149,7 @@ namespace yy { break; case 147: -#line 1695 "seclang-parser.yy" +#line 1696 "seclang-parser.yy" { if (atoi(yystack_[0].value.as < std::string > ().c_str()) == 1) { driver.error(yystack_[1].location, "SecCookieFormat 1 is not yet supported."); @@ -3160,7 +3160,7 @@ namespace yy { break; case 148: -#line 1702 "seclang-parser.yy" +#line 1703 "seclang-parser.yy" { driver.error(yystack_[1].location, "SecCookieV0Separator is not yet supported."); YYERROR; @@ -3169,7 +3169,7 @@ namespace yy { break; case 150: -#line 1712 "seclang-parser.yy" +#line 1713 "seclang-parser.yy" { std::string error; std::vector param; @@ -3227,7 +3227,7 @@ namespace yy { break; case 151: -#line 1766 "seclang-parser.yy" +#line 1767 "seclang-parser.yy" { /* Parser error disabled to avoid breaking default CRS installations with crs-setup.conf-recommended driver.error(@0, "SecCollectionTimeout is not yet supported."); @@ -3238,7 +3238,7 @@ namespace yy { break; case 152: -#line 1773 "seclang-parser.yy" +#line 1774 "seclang-parser.yy" { driver.m_httpblKey.m_set = true; driver.m_httpblKey.m_value = yystack_[0].value.as < std::string > (); @@ -3247,7 +3247,7 @@ namespace yy { break; case 153: -#line 1781 "seclang-parser.yy" +#line 1782 "seclang-parser.yy" { std::unique_ptr > > originalList = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); std::unique_ptr>> newList(new std::vector>()); @@ -3285,7 +3285,7 @@ namespace yy { break; case 154: -#line 1818 "seclang-parser.yy" +#line 1819 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[0].value.as < std::unique_ptr > > > ()); } @@ -3293,7 +3293,7 @@ namespace yy { break; case 155: -#line 1822 "seclang-parser.yy" +#line 1823 "seclang-parser.yy" { yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[1].value.as < std::unique_ptr > > > ()); } @@ -3301,7 +3301,7 @@ namespace yy { break; case 156: -#line 1829 "seclang-parser.yy" +#line 1830 "seclang-parser.yy" { yystack_[2].value.as < std::unique_ptr > > > ()->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > > > () = std::move(yystack_[2].value.as < std::unique_ptr > > > ()); @@ -3310,7 +3310,7 @@ namespace yy { break; case 157: -#line 1834 "seclang-parser.yy" +#line 1835 "seclang-parser.yy" { std::unique_ptr c(new VariableModificatorExclusion(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yystack_[3].value.as < std::unique_ptr > > > ()->push_back(std::move(c)); @@ -3320,7 +3320,7 @@ namespace yy { break; case 158: -#line 1840 "seclang-parser.yy" +#line 1841 "seclang-parser.yy" { std::unique_ptr c(new VariableModificatorCount(std::move(yystack_[0].value.as < std::unique_ptr > ()))); yystack_[3].value.as < std::unique_ptr > > > ()->push_back(std::move(c)); @@ -3330,7 +3330,7 @@ namespace yy { break; case 159: -#line 1846 "seclang-parser.yy" +#line 1847 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); b->push_back(std::move(yystack_[0].value.as < std::unique_ptr > ())); @@ -3340,7 +3340,7 @@ namespace yy { break; case 160: -#line 1852 "seclang-parser.yy" +#line 1853 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); std::unique_ptr c(new VariableModificatorExclusion(std::move(yystack_[0].value.as < std::unique_ptr > ()))); @@ -3351,7 +3351,7 @@ namespace yy { break; case 161: -#line 1859 "seclang-parser.yy" +#line 1860 "seclang-parser.yy" { std::unique_ptr>> b(new std::vector>()); std::unique_ptr c(new VariableModificatorCount(std::move(yystack_[0].value.as < std::unique_ptr > ()))); @@ -3362,7 +3362,7 @@ namespace yy { break; case 162: -#line 1869 "seclang-parser.yy" +#line 1870 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3370,7 +3370,7 @@ namespace yy { break; case 163: -#line 1873 "seclang-parser.yy" +#line 1874 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3378,7 +3378,7 @@ namespace yy { break; case 164: -#line 1877 "seclang-parser.yy" +#line 1878 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Args_NoDictElement()); } @@ -3386,7 +3386,7 @@ namespace yy { break; case 165: -#line 1881 "seclang-parser.yy" +#line 1882 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3394,7 +3394,7 @@ namespace yy { break; case 166: -#line 1885 "seclang-parser.yy" +#line 1886 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3402,7 +3402,7 @@ namespace yy { break; case 167: -#line 1889 "seclang-parser.yy" +#line 1890 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPost_NoDictElement()); } @@ -3410,7 +3410,7 @@ namespace yy { break; case 168: -#line 1893 "seclang-parser.yy" +#line 1894 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3418,7 +3418,7 @@ namespace yy { break; case 169: -#line 1897 "seclang-parser.yy" +#line 1898 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3426,7 +3426,7 @@ namespace yy { break; case 170: -#line 1901 "seclang-parser.yy" +#line 1902 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGet_NoDictElement()); } @@ -3434,7 +3434,7 @@ namespace yy { break; case 171: -#line 1905 "seclang-parser.yy" +#line 1906 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3442,7 +3442,7 @@ namespace yy { break; case 172: -#line 1909 "seclang-parser.yy" +#line 1910 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3450,7 +3450,7 @@ namespace yy { break; case 173: -#line 1913 "seclang-parser.yy" +#line 1914 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesSizes_NoDictElement()); } @@ -3458,7 +3458,7 @@ namespace yy { break; case 174: -#line 1917 "seclang-parser.yy" +#line 1918 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3466,7 +3466,7 @@ namespace yy { break; case 175: -#line 1921 "seclang-parser.yy" +#line 1922 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3474,7 +3474,7 @@ namespace yy { break; case 176: -#line 1925 "seclang-parser.yy" +#line 1926 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesNames_NoDictElement()); } @@ -3482,7 +3482,7 @@ namespace yy { break; case 177: -#line 1929 "seclang-parser.yy" +#line 1930 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3490,7 +3490,7 @@ namespace yy { break; case 178: -#line 1933 "seclang-parser.yy" +#line 1934 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3498,7 +3498,7 @@ namespace yy { break; case 179: -#line 1937 "seclang-parser.yy" +#line 1938 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpContent_NoDictElement()); } @@ -3506,7 +3506,7 @@ namespace yy { break; case 180: -#line 1941 "seclang-parser.yy" +#line 1942 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3514,7 +3514,7 @@ namespace yy { break; case 181: -#line 1945 "seclang-parser.yy" +#line 1946 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3522,7 +3522,7 @@ namespace yy { break; case 182: -#line 1949 "seclang-parser.yy" +#line 1950 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartFileName_NoDictElement()); } @@ -3530,7 +3530,7 @@ namespace yy { break; case 183: -#line 1953 "seclang-parser.yy" +#line 1954 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3538,7 +3538,7 @@ namespace yy { break; case 184: -#line 1957 "seclang-parser.yy" +#line 1958 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3546,7 +3546,7 @@ namespace yy { break; case 185: -#line 1961 "seclang-parser.yy" +#line 1962 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultiPartName_NoDictElement()); } @@ -3554,7 +3554,7 @@ namespace yy { break; case 186: -#line 1965 "seclang-parser.yy" +#line 1966 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3562,7 +3562,7 @@ namespace yy { break; case 187: -#line 1969 "seclang-parser.yy" +#line 1970 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3570,7 +3570,7 @@ namespace yy { break; case 188: -#line 1973 "seclang-parser.yy" +#line 1974 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarsNames_NoDictElement()); } @@ -3578,7 +3578,7 @@ namespace yy { break; case 189: -#line 1977 "seclang-parser.yy" +#line 1978 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3586,7 +3586,7 @@ namespace yy { break; case 190: -#line 1981 "seclang-parser.yy" +#line 1982 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3594,7 +3594,7 @@ namespace yy { break; case 191: -#line 1985 "seclang-parser.yy" +#line 1986 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVars_NoDictElement()); } @@ -3602,7 +3602,7 @@ namespace yy { break; case 192: -#line 1989 "seclang-parser.yy" +#line 1990 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3610,7 +3610,7 @@ namespace yy { break; case 193: -#line 1993 "seclang-parser.yy" +#line 1994 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3618,7 +3618,7 @@ namespace yy { break; case 194: -#line 1997 "seclang-parser.yy" +#line 1998 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Files_NoDictElement()); } @@ -3626,7 +3626,7 @@ namespace yy { break; case 195: -#line 2001 "seclang-parser.yy" +#line 2002 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3634,7 +3634,7 @@ namespace yy { break; case 196: -#line 2005 "seclang-parser.yy" +#line 2006 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3642,7 +3642,7 @@ namespace yy { break; case 197: -#line 2009 "seclang-parser.yy" +#line 2010 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookies_NoDictElement()); } @@ -3650,7 +3650,7 @@ namespace yy { break; case 198: -#line 2013 "seclang-parser.yy" +#line 2014 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3658,7 +3658,7 @@ namespace yy { break; case 199: -#line 2017 "seclang-parser.yy" +#line 2018 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3666,7 +3666,7 @@ namespace yy { break; case 200: -#line 2021 "seclang-parser.yy" +#line 2022 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeaders_NoDictElement()); } @@ -3674,7 +3674,7 @@ namespace yy { break; case 201: -#line 2025 "seclang-parser.yy" +#line 2026 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3682,7 +3682,7 @@ namespace yy { break; case 202: -#line 2029 "seclang-parser.yy" +#line 2030 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3690,7 +3690,7 @@ namespace yy { break; case 203: -#line 2033 "seclang-parser.yy" +#line 2034 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeaders_NoDictElement()); } @@ -3698,7 +3698,7 @@ namespace yy { break; case 204: -#line 2037 "seclang-parser.yy" +#line 2038 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3706,7 +3706,7 @@ namespace yy { break; case 205: -#line 2041 "seclang-parser.yy" +#line 2042 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3714,7 +3714,7 @@ namespace yy { break; case 206: -#line 2045 "seclang-parser.yy" +#line 2046 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Geo_NoDictElement()); } @@ -3722,7 +3722,7 @@ namespace yy { break; case 207: -#line 2049 "seclang-parser.yy" +#line 2050 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3730,7 +3730,7 @@ namespace yy { break; case 208: -#line 2053 "seclang-parser.yy" +#line 2054 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3738,7 +3738,7 @@ namespace yy { break; case 209: -#line 2057 "seclang-parser.yy" +#line 2058 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestCookiesNames_NoDictElement()); } @@ -3746,7 +3746,7 @@ namespace yy { break; case 210: -#line 2061 "seclang-parser.yy" +#line 2062 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3754,7 +3754,7 @@ namespace yy { break; case 211: -#line 2065 "seclang-parser.yy" +#line 2066 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3762,7 +3762,7 @@ namespace yy { break; case 212: -#line 2069 "seclang-parser.yy" +#line 2070 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Rule_NoDictElement()); } @@ -3770,7 +3770,7 @@ namespace yy { break; case 213: -#line 2073 "seclang-parser.yy" +#line 2074 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } @@ -3778,7 +3778,7 @@ namespace yy { break; case 214: -#line 2077 "seclang-parser.yy" +#line 2078 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV:" + yystack_[0].value.as < std::string > ())); } @@ -3786,7 +3786,7 @@ namespace yy { break; case 215: -#line 2081 "seclang-parser.yy" +#line 2082 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Env("ENV")); } @@ -3794,7 +3794,7 @@ namespace yy { break; case 216: -#line 2085 "seclang-parser.yy" +#line 2086 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } @@ -3802,7 +3802,7 @@ namespace yy { break; case 217: -#line 2089 "seclang-parser.yy" +#line 2090 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML("XML:" + yystack_[0].value.as < std::string > ())); } @@ -3810,7 +3810,7 @@ namespace yy { break; case 218: -#line 2093 "seclang-parser.yy" +#line 2094 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::XML_NoDictElement()); } @@ -3818,7 +3818,7 @@ namespace yy { break; case 219: -#line 2097 "seclang-parser.yy" +#line 2098 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3826,7 +3826,7 @@ namespace yy { break; case 220: -#line 2101 "seclang-parser.yy" +#line 2102 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3834,7 +3834,7 @@ namespace yy { break; case 221: -#line 2105 "seclang-parser.yy" +#line 2106 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesTmpNames_NoDictElement()); } @@ -3842,7 +3842,7 @@ namespace yy { break; case 222: -#line 2109 "seclang-parser.yy" +#line 2110 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3850,7 +3850,7 @@ namespace yy { break; case 223: -#line 2113 "seclang-parser.yy" +#line 2114 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3858,7 +3858,7 @@ namespace yy { break; case 224: -#line 2117 "seclang-parser.yy" +#line 2118 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3866,7 +3866,7 @@ namespace yy { break; case 225: -#line 2121 "seclang-parser.yy" +#line 2122 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Resource_NoDictElement()); } @@ -3874,7 +3874,7 @@ namespace yy { break; case 226: -#line 2125 "seclang-parser.yy" +#line 2126 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3882,7 +3882,7 @@ namespace yy { break; case 227: -#line 2129 "seclang-parser.yy" +#line 2130 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3890,7 +3890,7 @@ namespace yy { break; case 228: -#line 2133 "seclang-parser.yy" +#line 2134 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3898,7 +3898,7 @@ namespace yy { break; case 229: -#line 2137 "seclang-parser.yy" +#line 2138 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Ip_NoDictElement()); } @@ -3906,7 +3906,7 @@ namespace yy { break; case 230: -#line 2141 "seclang-parser.yy" +#line 2142 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3914,7 +3914,7 @@ namespace yy { break; case 231: -#line 2145 "seclang-parser.yy" +#line 2146 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3922,7 +3922,7 @@ namespace yy { break; case 232: -#line 2149 "seclang-parser.yy" +#line 2150 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3930,7 +3930,7 @@ namespace yy { break; case 233: -#line 2153 "seclang-parser.yy" +#line 2154 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Global_NoDictElement()); } @@ -3938,7 +3938,7 @@ namespace yy { break; case 234: -#line 2157 "seclang-parser.yy" +#line 2158 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3946,7 +3946,7 @@ namespace yy { break; case 235: -#line 2161 "seclang-parser.yy" +#line 2162 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3954,7 +3954,7 @@ namespace yy { break; case 236: -#line 2165 "seclang-parser.yy" +#line 2166 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3962,7 +3962,7 @@ namespace yy { break; case 237: -#line 2169 "seclang-parser.yy" +#line 2170 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::User_NoDictElement()); } @@ -3970,7 +3970,7 @@ namespace yy { break; case 238: -#line 2173 "seclang-parser.yy" +#line 2174 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -3978,7 +3978,7 @@ namespace yy { break; case 239: -#line 2177 "seclang-parser.yy" +#line 2178 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElement(yystack_[0].value.as < std::string > ())); } @@ -3986,7 +3986,7 @@ namespace yy { break; case 240: -#line 2181 "seclang-parser.yy" +#line 2182 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -3994,7 +3994,7 @@ namespace yy { break; case 241: -#line 2185 "seclang-parser.yy" +#line 2186 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Tx_NoDictElement()); } @@ -4002,7 +4002,7 @@ namespace yy { break; case 242: -#line 2189 "seclang-parser.yy" +#line 2190 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DynamicElement(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } @@ -4010,7 +4010,7 @@ namespace yy { break; case 243: -#line 2193 "seclang-parser.yy" +#line 2194 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4018,7 +4018,7 @@ namespace yy { break; case 244: -#line 2197 "seclang-parser.yy" +#line 2198 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4026,7 +4026,7 @@ namespace yy { break; case 245: -#line 2201 "seclang-parser.yy" +#line 2202 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Session_NoDictElement()); } @@ -4034,7 +4034,7 @@ namespace yy { break; case 246: -#line 2205 "seclang-parser.yy" +#line 2206 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4042,7 +4042,7 @@ namespace yy { break; case 247: -#line 2209 "seclang-parser.yy" +#line 2210 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4050,7 +4050,7 @@ namespace yy { break; case 248: -#line 2213 "seclang-parser.yy" +#line 2214 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsNames_NoDictElement()); } @@ -4058,7 +4058,7 @@ namespace yy { break; case 249: -#line 2217 "seclang-parser.yy" +#line 2218 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4066,7 +4066,7 @@ namespace yy { break; case 250: -#line 2221 "seclang-parser.yy" +#line 2222 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4074,7 +4074,7 @@ namespace yy { break; case 251: -#line 2225 "seclang-parser.yy" +#line 2226 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsGetNames_NoDictElement()); } @@ -4082,7 +4082,7 @@ namespace yy { break; case 252: -#line 2230 "seclang-parser.yy" +#line 2231 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4090,7 +4090,7 @@ namespace yy { break; case 253: -#line 2234 "seclang-parser.yy" +#line 2235 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4098,7 +4098,7 @@ namespace yy { break; case 254: -#line 2238 "seclang-parser.yy" +#line 2239 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsPostNames_NoDictElement()); } @@ -4106,7 +4106,7 @@ namespace yy { break; case 255: -#line 2243 "seclang-parser.yy" +#line 2244 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4114,7 +4114,7 @@ namespace yy { break; case 256: -#line 2247 "seclang-parser.yy" +#line 2248 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4122,7 +4122,7 @@ namespace yy { break; case 257: -#line 2251 "seclang-parser.yy" +#line 2252 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestHeadersNames_NoDictElement()); } @@ -4130,7 +4130,7 @@ namespace yy { break; case 258: -#line 2256 "seclang-parser.yy" +#line 2257 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentType()); } @@ -4138,7 +4138,7 @@ namespace yy { break; case 259: -#line 2261 "seclang-parser.yy" +#line 2262 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElement(yystack_[0].value.as < std::string > ())); } @@ -4146,7 +4146,7 @@ namespace yy { break; case 260: -#line 2265 "seclang-parser.yy" +#line 2266 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_DictElementRegexp(yystack_[0].value.as < std::string > ())); } @@ -4154,7 +4154,7 @@ namespace yy { break; case 261: -#line 2269 "seclang-parser.yy" +#line 2270 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseHeadersNames_NoDictElement()); } @@ -4162,7 +4162,7 @@ namespace yy { break; case 262: -#line 2273 "seclang-parser.yy" +#line 2274 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ArgsCombinedSize()); } @@ -4170,7 +4170,7 @@ namespace yy { break; case 263: -#line 2277 "seclang-parser.yy" +#line 2278 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::AuthType()); } @@ -4178,7 +4178,7 @@ namespace yy { break; case 264: -#line 2281 "seclang-parser.yy" +#line 2282 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FilesCombinedSize()); } @@ -4186,7 +4186,7 @@ namespace yy { break; case 265: -#line 2285 "seclang-parser.yy" +#line 2286 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequest()); } @@ -4194,7 +4194,7 @@ namespace yy { break; case 266: -#line 2289 "seclang-parser.yy" +#line 2290 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::FullRequestLength()); } @@ -4202,7 +4202,7 @@ namespace yy { break; case 267: -#line 2293 "seclang-parser.yy" +#line 2294 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::InboundDataError()); } @@ -4210,7 +4210,7 @@ namespace yy { break; case 268: -#line 2297 "seclang-parser.yy" +#line 2298 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVar()); } @@ -4218,7 +4218,7 @@ namespace yy { break; case 269: -#line 2301 "seclang-parser.yy" +#line 2302 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MatchedVarName()); } @@ -4226,7 +4226,7 @@ namespace yy { break; case 270: -#line 2305 "seclang-parser.yy" +#line 2306 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryQuoted()); } @@ -4234,7 +4234,7 @@ namespace yy { break; case 271: -#line 2309 "seclang-parser.yy" +#line 2310 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartBoundaryWhiteSpace()); } @@ -4242,7 +4242,7 @@ namespace yy { break; case 272: -#line 2313 "seclang-parser.yy" +#line 2314 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartCrlfLFLines()); } @@ -4250,7 +4250,7 @@ namespace yy { break; case 273: -#line 2317 "seclang-parser.yy" +#line 2318 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateAfter()); } @@ -4258,7 +4258,7 @@ namespace yy { break; case 274: -#line 2321 "seclang-parser.yy" +#line 2322 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartDateBefore()); } @@ -4266,7 +4266,7 @@ namespace yy { break; case 275: -#line 2325 "seclang-parser.yy" +#line 2326 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartFileLimitExceeded()); } @@ -4274,7 +4274,7 @@ namespace yy { break; case 276: -#line 2329 "seclang-parser.yy" +#line 2330 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartHeaderFolding()); } @@ -4282,7 +4282,7 @@ namespace yy { break; case 277: -#line 2333 "seclang-parser.yy" +#line 2334 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidHeaderFolding()); } @@ -4290,7 +4290,7 @@ namespace yy { break; case 278: -#line 2337 "seclang-parser.yy" +#line 2338 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidPart()); } @@ -4298,7 +4298,7 @@ namespace yy { break; case 279: -#line 2341 "seclang-parser.yy" +#line 2342 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartInvalidQuoting()); } @@ -4306,7 +4306,7 @@ namespace yy { break; case 280: -#line 2345 "seclang-parser.yy" +#line 2346 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartLFLine()); } @@ -4314,7 +4314,7 @@ namespace yy { break; case 281: -#line 2349 "seclang-parser.yy" +#line 2350 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } @@ -4322,7 +4322,7 @@ namespace yy { break; case 282: -#line 2353 "seclang-parser.yy" +#line 2354 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartMissingSemicolon()); } @@ -4330,7 +4330,7 @@ namespace yy { break; case 283: -#line 2357 "seclang-parser.yy" +#line 2358 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartStrictError()); } @@ -4338,7 +4338,7 @@ namespace yy { break; case 284: -#line 2361 "seclang-parser.yy" +#line 2362 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::MultipartUnmatchedBoundary()); } @@ -4346,7 +4346,7 @@ namespace yy { break; case 285: -#line 2365 "seclang-parser.yy" +#line 2366 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::OutboundDataError()); } @@ -4354,7 +4354,7 @@ namespace yy { break; case 286: -#line 2369 "seclang-parser.yy" +#line 2370 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::PathInfo()); } @@ -4362,7 +4362,7 @@ namespace yy { break; case 287: -#line 2373 "seclang-parser.yy" +#line 2374 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::QueryString()); } @@ -4370,7 +4370,7 @@ namespace yy { break; case 288: -#line 2377 "seclang-parser.yy" +#line 2378 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteAddr()); } @@ -4378,7 +4378,7 @@ namespace yy { break; case 289: -#line 2381 "seclang-parser.yy" +#line 2382 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemoteHost()); } @@ -4386,7 +4386,7 @@ namespace yy { break; case 290: -#line 2385 "seclang-parser.yy" +#line 2386 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RemotePort()); } @@ -4394,7 +4394,7 @@ namespace yy { break; case 291: -#line 2389 "seclang-parser.yy" +#line 2390 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyError()); } @@ -4402,7 +4402,7 @@ namespace yy { break; case 292: -#line 2393 "seclang-parser.yy" +#line 2394 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyErrorMsg()); } @@ -4410,7 +4410,7 @@ namespace yy { break; case 293: -#line 2397 "seclang-parser.yy" +#line 2398 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessor()); } @@ -4418,7 +4418,7 @@ namespace yy { break; case 294: -#line 2401 "seclang-parser.yy" +#line 2402 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorError()); } @@ -4426,7 +4426,7 @@ namespace yy { break; case 295: -#line 2405 "seclang-parser.yy" +#line 2406 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ReqbodyProcessorErrorMsg()); } @@ -4434,7 +4434,7 @@ namespace yy { break; case 296: -#line 2409 "seclang-parser.yy" +#line 2410 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBasename()); } @@ -4442,7 +4442,7 @@ namespace yy { break; case 297: -#line 2413 "seclang-parser.yy" +#line 2414 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBody()); } @@ -4450,7 +4450,7 @@ namespace yy { break; case 298: -#line 2417 "seclang-parser.yy" +#line 2418 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestBodyLength()); } @@ -4458,7 +4458,7 @@ namespace yy { break; case 299: -#line 2421 "seclang-parser.yy" +#line 2422 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestFilename()); } @@ -4466,7 +4466,7 @@ namespace yy { break; case 300: -#line 2425 "seclang-parser.yy" +#line 2426 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestLine()); } @@ -4474,7 +4474,7 @@ namespace yy { break; case 301: -#line 2429 "seclang-parser.yy" +#line 2430 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestMethod()); } @@ -4482,7 +4482,7 @@ namespace yy { break; case 302: -#line 2433 "seclang-parser.yy" +#line 2434 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestProtocol()); } @@ -4490,7 +4490,7 @@ namespace yy { break; case 303: -#line 2437 "seclang-parser.yy" +#line 2438 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURI()); } @@ -4498,7 +4498,7 @@ namespace yy { break; case 304: -#line 2441 "seclang-parser.yy" +#line 2442 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::RequestURIRaw()); } @@ -4506,7 +4506,7 @@ namespace yy { break; case 305: -#line 2445 "seclang-parser.yy" +#line 2446 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseBody()); } @@ -4514,7 +4514,7 @@ namespace yy { break; case 306: -#line 2449 "seclang-parser.yy" +#line 2450 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseContentLength()); } @@ -4522,7 +4522,7 @@ namespace yy { break; case 307: -#line 2453 "seclang-parser.yy" +#line 2454 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseProtocol()); } @@ -4530,7 +4530,7 @@ namespace yy { break; case 308: -#line 2457 "seclang-parser.yy" +#line 2458 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ResponseStatus()); } @@ -4538,7 +4538,7 @@ namespace yy { break; case 309: -#line 2461 "seclang-parser.yy" +#line 2462 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerAddr()); } @@ -4546,7 +4546,7 @@ namespace yy { break; case 310: -#line 2465 "seclang-parser.yy" +#line 2466 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerName()); } @@ -4554,7 +4554,7 @@ namespace yy { break; case 311: -#line 2469 "seclang-parser.yy" +#line 2470 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::ServerPort()); } @@ -4562,7 +4562,7 @@ namespace yy { break; case 312: -#line 2473 "seclang-parser.yy" +#line 2474 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::SessionID()); } @@ -4570,7 +4570,7 @@ namespace yy { break; case 313: -#line 2477 "seclang-parser.yy" +#line 2478 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UniqueID()); } @@ -4578,7 +4578,7 @@ namespace yy { break; case 314: -#line 2481 "seclang-parser.yy" +#line 2482 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UrlEncodedError()); } @@ -4586,7 +4586,7 @@ namespace yy { break; case 315: -#line 2485 "seclang-parser.yy" +#line 2486 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::UserID()); } @@ -4594,7 +4594,7 @@ namespace yy { break; case 316: -#line 2489 "seclang-parser.yy" +#line 2490 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } @@ -4602,7 +4602,7 @@ namespace yy { break; case 317: -#line 2493 "seclang-parser.yy" +#line 2494 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::Status()); } @@ -4610,7 +4610,7 @@ namespace yy { break; case 318: -#line 2497 "seclang-parser.yy" +#line 2498 "seclang-parser.yy" { VARIABLE_CONTAINER(yylhs.value.as < std::unique_ptr > (), new variables::WebAppId()); } @@ -4618,7 +4618,7 @@ namespace yy { break; case 319: -#line 2501 "seclang-parser.yy" +#line 2502 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4629,7 +4629,7 @@ namespace yy { break; case 320: -#line 2509 "seclang-parser.yy" +#line 2510 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4640,7 +4640,7 @@ namespace yy { break; case 321: -#line 2516 "seclang-parser.yy" +#line 2517 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4651,7 +4651,7 @@ namespace yy { break; case 322: -#line 2523 "seclang-parser.yy" +#line 2524 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4662,7 +4662,7 @@ namespace yy { break; case 323: -#line 2530 "seclang-parser.yy" +#line 2531 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4673,7 +4673,7 @@ namespace yy { break; case 324: -#line 2537 "seclang-parser.yy" +#line 2538 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4684,7 +4684,7 @@ namespace yy { break; case 325: -#line 2544 "seclang-parser.yy" +#line 2545 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4695,7 +4695,7 @@ namespace yy { break; case 326: -#line 2551 "seclang-parser.yy" +#line 2552 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4706,7 +4706,7 @@ namespace yy { break; case 327: -#line 2558 "seclang-parser.yy" +#line 2559 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4717,7 +4717,7 @@ namespace yy { break; case 328: -#line 2565 "seclang-parser.yy" +#line 2566 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4728,7 +4728,7 @@ namespace yy { break; case 329: -#line 2572 "seclang-parser.yy" +#line 2573 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4739,7 +4739,7 @@ namespace yy { break; case 330: -#line 2579 "seclang-parser.yy" +#line 2580 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4750,7 +4750,7 @@ namespace yy { break; case 331: -#line 2586 "seclang-parser.yy" +#line 2587 "seclang-parser.yy" { std::string name(yystack_[0].value.as < std::string > ()); char z = name.at(0); @@ -4761,7 +4761,7 @@ namespace yy { break; case 332: -#line 2596 "seclang-parser.yy" +#line 2597 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Accuracy(yystack_[0].value.as < std::string > ())); } @@ -4769,7 +4769,7 @@ namespace yy { break; case 333: -#line 2600 "seclang-parser.yy" +#line 2601 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Allow(yystack_[0].value.as < std::string > ())); } @@ -4777,7 +4777,7 @@ namespace yy { break; case 334: -#line 2604 "seclang-parser.yy" +#line 2605 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("Append", yystack_[1].location); } @@ -4785,7 +4785,7 @@ namespace yy { break; case 335: -#line 2608 "seclang-parser.yy" +#line 2609 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::AuditLog()); } @@ -4793,7 +4793,7 @@ namespace yy { break; case 336: -#line 2612 "seclang-parser.yy" +#line 2613 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Block()); } @@ -4801,7 +4801,7 @@ namespace yy { break; case 337: -#line 2616 "seclang-parser.yy" +#line 2617 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Capture()); } @@ -4809,7 +4809,7 @@ namespace yy { break; case 338: -#line 2620 "seclang-parser.yy" +#line 2621 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Chain()); } @@ -4817,7 +4817,7 @@ namespace yy { break; case 339: -#line 2624 "seclang-parser.yy" +#line 2625 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4826,7 +4826,7 @@ namespace yy { break; case 340: -#line 2629 "seclang-parser.yy" +#line 2630 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4835,7 +4835,7 @@ namespace yy { break; case 341: -#line 2634 "seclang-parser.yy" +#line 2635 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlAuditEngine", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4844,7 +4844,7 @@ namespace yy { break; case 342: -#line 2639 "seclang-parser.yy" +#line 2640 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::AuditLogParts(yystack_[0].value.as < std::string > ())); } @@ -4852,7 +4852,7 @@ namespace yy { break; case 343: -#line 2643 "seclang-parser.yy" +#line 2644 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorJSON(yystack_[0].value.as < std::string > ())); } @@ -4860,7 +4860,7 @@ namespace yy { break; case 344: -#line 2647 "seclang-parser.yy" +#line 2648 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorXML(yystack_[0].value.as < std::string > ())); } @@ -4868,7 +4868,7 @@ namespace yy { break; case 345: -#line 2651 "seclang-parser.yy" +#line 2652 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyProcessorURLENCODED(yystack_[0].value.as < std::string > ())); } @@ -4876,7 +4876,7 @@ namespace yy { break; case 346: -#line 2655 "seclang-parser.yy" +#line 2656 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4885,7 +4885,7 @@ namespace yy { break; case 347: -#line 2660 "seclang-parser.yy" +#line 2661 "seclang-parser.yy" { //ACTION_NOT_SUPPORTED("CtlForceReequestBody", @0); ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[1].value.as < std::string > ())); @@ -4894,7 +4894,7 @@ namespace yy { break; case 348: -#line 2665 "seclang-parser.yy" +#line 2666 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "true")); } @@ -4902,7 +4902,7 @@ namespace yy { break; case 349: -#line 2669 "seclang-parser.yy" +#line 2670 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RequestBodyAccess(yystack_[1].value.as < std::string > () + "false")); } @@ -4910,7 +4910,7 @@ namespace yy { break; case 350: -#line 2673 "seclang-parser.yy" +#line 2674 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=on")); } @@ -4918,7 +4918,7 @@ namespace yy { break; case 351: -#line 2677 "seclang-parser.yy" +#line 2678 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=off")); } @@ -4926,7 +4926,7 @@ namespace yy { break; case 352: -#line 2681 "seclang-parser.yy" +#line 2682 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleEngine("ctl:RuleEngine=detectiononly")); } @@ -4934,7 +4934,7 @@ namespace yy { break; case 353: -#line 2685 "seclang-parser.yy" +#line 2686 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveById(yystack_[0].value.as < std::string > ())); } @@ -4942,7 +4942,7 @@ namespace yy { break; case 354: -#line 2689 "seclang-parser.yy" +#line 2690 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveByTag(yystack_[0].value.as < std::string > ())); } @@ -4950,7 +4950,7 @@ namespace yy { break; case 355: -#line 2693 "seclang-parser.yy" +#line 2694 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetById(yystack_[0].value.as < std::string > ())); } @@ -4958,7 +4958,7 @@ namespace yy { break; case 356: -#line 2697 "seclang-parser.yy" +#line 2698 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ctl::RuleRemoveTargetByTag(yystack_[0].value.as < std::string > ())); } @@ -4966,7 +4966,7 @@ namespace yy { break; case 357: -#line 2701 "seclang-parser.yy" +#line 2702 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Deny()); } @@ -4974,7 +4974,7 @@ namespace yy { break; case 358: -#line 2705 "seclang-parser.yy" +#line 2706 "seclang-parser.yy" { ACTION_NOT_SUPPORTED("DeprecateVar", yystack_[1].location); } @@ -4982,7 +4982,7 @@ namespace yy { break; case 359: -#line 2709 "seclang-parser.yy" +#line 2710 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Drop()); } @@ -4990,7 +4990,7 @@ namespace yy { break; case 360: -#line 2713 "seclang-parser.yy" +#line 2714 "seclang-parser.yy" { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Exec(yystack_[0].value.as < std::string > ())); } @@ -4998,12 +4998,11 @@ namespace yy { break; case 361: -#line 2717 "seclang-parser.yy" +#line 2718 "seclang-parser.yy" { - //ACTION_NOT_SUPPORTED("ExpireVar", @0); - ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Action(yystack_[0].value.as < std::string > ())); + ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::ExpireVar(yystack_[0].value.as < std::string > ())); } -#line 5007 "seclang-parser.cc" +#line 5006 "seclang-parser.cc" break; case 362: @@ -5011,7 +5010,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::RuleId(yystack_[0].value.as < std::string > ())); } -#line 5015 "seclang-parser.cc" +#line 5014 "seclang-parser.cc" break; case 363: @@ -5019,7 +5018,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::InitCol(yystack_[1].value.as < std::string > (), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5023 "seclang-parser.cc" +#line 5022 "seclang-parser.cc" break; case 364: @@ -5027,7 +5026,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::LogData(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5031 "seclang-parser.cc" +#line 5030 "seclang-parser.cc" break; case 365: @@ -5035,7 +5034,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Log()); } -#line 5039 "seclang-parser.cc" +#line 5038 "seclang-parser.cc" break; case 366: @@ -5043,7 +5042,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Maturity(yystack_[0].value.as < std::string > ())); } -#line 5047 "seclang-parser.cc" +#line 5046 "seclang-parser.cc" break; case 367: @@ -5051,7 +5050,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Msg(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5055 "seclang-parser.cc" +#line 5054 "seclang-parser.cc" break; case 368: @@ -5059,7 +5058,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::MultiMatch()); } -#line 5063 "seclang-parser.cc" +#line 5062 "seclang-parser.cc" break; case 369: @@ -5067,7 +5066,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoAuditLog()); } -#line 5071 "seclang-parser.cc" +#line 5070 "seclang-parser.cc" break; case 370: @@ -5075,7 +5074,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::NoLog()); } -#line 5079 "seclang-parser.cc" +#line 5078 "seclang-parser.cc" break; case 371: @@ -5083,7 +5082,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Pass()); } -#line 5087 "seclang-parser.cc" +#line 5086 "seclang-parser.cc" break; case 372: @@ -5091,7 +5090,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("Pause", yystack_[1].location); } -#line 5095 "seclang-parser.cc" +#line 5094 "seclang-parser.cc" break; case 373: @@ -5099,7 +5098,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Phase(yystack_[0].value.as < std::string > ())); } -#line 5103 "seclang-parser.cc" +#line 5102 "seclang-parser.cc" break; case 374: @@ -5107,7 +5106,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("Prepend", yystack_[1].location); } -#line 5111 "seclang-parser.cc" +#line 5110 "seclang-parser.cc" break; case 375: @@ -5115,7 +5114,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("Proxy", yystack_[1].location); } -#line 5119 "seclang-parser.cc" +#line 5118 "seclang-parser.cc" break; case 376: @@ -5123,7 +5122,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::disruptive::Redirect(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5127 "seclang-parser.cc" +#line 5126 "seclang-parser.cc" break; case 377: @@ -5131,7 +5130,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Rev(yystack_[0].value.as < std::string > ())); } -#line 5135 "seclang-parser.cc" +#line 5134 "seclang-parser.cc" break; case 378: @@ -5139,7 +5138,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("SanitiseArg", yystack_[1].location); } -#line 5143 "seclang-parser.cc" +#line 5142 "seclang-parser.cc" break; case 379: @@ -5147,7 +5146,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("SanitiseMatched", yystack_[1].location); } -#line 5151 "seclang-parser.cc" +#line 5150 "seclang-parser.cc" break; case 380: @@ -5155,7 +5154,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("SanitiseMatchedBytes", yystack_[1].location); } -#line 5159 "seclang-parser.cc" +#line 5158 "seclang-parser.cc" break; case 381: @@ -5163,7 +5162,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("SanitiseRequestHeader", yystack_[1].location); } -#line 5167 "seclang-parser.cc" +#line 5166 "seclang-parser.cc" break; case 382: @@ -5171,7 +5170,7 @@ namespace yy { { ACTION_NOT_SUPPORTED("SanitiseResponseHeader", yystack_[1].location); } -#line 5175 "seclang-parser.cc" +#line 5174 "seclang-parser.cc" break; case 383: @@ -5179,7 +5178,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetENV(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5183 "seclang-parser.cc" +#line 5182 "seclang-parser.cc" break; case 384: @@ -5187,7 +5186,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetRSC(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5191 "seclang-parser.cc" +#line 5190 "seclang-parser.cc" break; case 385: @@ -5195,7 +5194,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetSID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5199 "seclang-parser.cc" +#line 5198 "seclang-parser.cc" break; case 386: @@ -5203,7 +5202,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetUID(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5207 "seclang-parser.cc" +#line 5206 "seclang-parser.cc" break; case 387: @@ -5211,7 +5210,7 @@ namespace yy { { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } -#line 5215 "seclang-parser.cc" +#line 5214 "seclang-parser.cc" break; case 388: @@ -5219,7 +5218,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Severity(yystack_[0].value.as < std::string > ())); } -#line 5223 "seclang-parser.cc" +#line 5222 "seclang-parser.cc" break; case 389: @@ -5227,7 +5226,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Skip(yystack_[0].value.as < std::string > ())); } -#line 5231 "seclang-parser.cc" +#line 5230 "seclang-parser.cc" break; case 390: @@ -5235,7 +5234,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SkipAfter(yystack_[0].value.as < std::string > ())); } -#line 5239 "seclang-parser.cc" +#line 5238 "seclang-parser.cc" break; case 391: @@ -5243,7 +5242,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::data::Status(yystack_[0].value.as < std::string > ())); } -#line 5247 "seclang-parser.cc" +#line 5246 "seclang-parser.cc" break; case 392: @@ -5251,7 +5250,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Tag(std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5255 "seclang-parser.cc" +#line 5254 "seclang-parser.cc" break; case 393: @@ -5259,7 +5258,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::Ver(yystack_[0].value.as < std::string > ())); } -#line 5263 "seclang-parser.cc" +#line 5262 "seclang-parser.cc" break; case 394: @@ -5267,7 +5266,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::XmlNS(yystack_[0].value.as < std::string > ())); } -#line 5271 "seclang-parser.cc" +#line 5270 "seclang-parser.cc" break; case 395: @@ -5275,7 +5274,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityZero7bit()); } -#line 5279 "seclang-parser.cc" +#line 5278 "seclang-parser.cc" break; case 396: @@ -5283,7 +5282,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityOdd7bit()); } -#line 5287 "seclang-parser.cc" +#line 5286 "seclang-parser.cc" break; case 397: @@ -5291,7 +5290,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ParityEven7bit()); } -#line 5295 "seclang-parser.cc" +#line 5294 "seclang-parser.cc" break; case 398: @@ -5299,7 +5298,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::SqlHexDecode()); } -#line 5303 "seclang-parser.cc" +#line 5302 "seclang-parser.cc" break; case 399: @@ -5307,7 +5306,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Encode()); } -#line 5311 "seclang-parser.cc" +#line 5310 "seclang-parser.cc" break; case 400: @@ -5315,7 +5314,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64Decode()); } -#line 5319 "seclang-parser.cc" +#line 5318 "seclang-parser.cc" break; case 401: @@ -5323,7 +5322,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Base64DecodeExt()); } -#line 5327 "seclang-parser.cc" +#line 5326 "seclang-parser.cc" break; case 402: @@ -5331,7 +5330,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CmdLine()); } -#line 5335 "seclang-parser.cc" +#line 5334 "seclang-parser.cc" break; case 403: @@ -5339,7 +5338,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Sha1()); } -#line 5343 "seclang-parser.cc" +#line 5342 "seclang-parser.cc" break; case 404: @@ -5347,7 +5346,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Md5()); } -#line 5351 "seclang-parser.cc" +#line 5350 "seclang-parser.cc" break; case 405: @@ -5355,7 +5354,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::EscapeSeqDecode()); } -#line 5359 "seclang-parser.cc" +#line 5358 "seclang-parser.cc" break; case 406: @@ -5363,7 +5362,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexEncode()); } -#line 5367 "seclang-parser.cc" +#line 5366 "seclang-parser.cc" break; case 407: @@ -5371,7 +5370,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HexDecode()); } -#line 5375 "seclang-parser.cc" +#line 5374 "seclang-parser.cc" break; case 408: @@ -5379,7 +5378,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::LowerCase()); } -#line 5383 "seclang-parser.cc" +#line 5382 "seclang-parser.cc" break; case 409: @@ -5387,7 +5386,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UpperCase()); } -#line 5391 "seclang-parser.cc" +#line 5390 "seclang-parser.cc" break; case 410: @@ -5395,7 +5394,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecodeUni()); } -#line 5399 "seclang-parser.cc" +#line 5398 "seclang-parser.cc" break; case 411: @@ -5403,7 +5402,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlDecode()); } -#line 5407 "seclang-parser.cc" +#line 5406 "seclang-parser.cc" break; case 412: @@ -5411,7 +5410,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::UrlEncode()); } -#line 5415 "seclang-parser.cc" +#line 5414 "seclang-parser.cc" break; case 413: @@ -5419,7 +5418,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::None()); } -#line 5423 "seclang-parser.cc" +#line 5422 "seclang-parser.cc" break; case 414: @@ -5427,7 +5426,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CompressWhitespace()); } -#line 5431 "seclang-parser.cc" +#line 5430 "seclang-parser.cc" break; case 415: @@ -5435,7 +5434,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveWhitespace()); } -#line 5439 "seclang-parser.cc" +#line 5438 "seclang-parser.cc" break; case 416: @@ -5443,7 +5442,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceNulls()); } -#line 5447 "seclang-parser.cc" +#line 5446 "seclang-parser.cc" break; case 417: @@ -5451,7 +5450,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveNulls()); } -#line 5455 "seclang-parser.cc" +#line 5454 "seclang-parser.cc" break; case 418: @@ -5459,7 +5458,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::HtmlEntityDecode()); } -#line 5463 "seclang-parser.cc" +#line 5462 "seclang-parser.cc" break; case 419: @@ -5467,7 +5466,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::JsDecode()); } -#line 5471 "seclang-parser.cc" +#line 5470 "seclang-parser.cc" break; case 420: @@ -5475,7 +5474,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::CssDecode()); } -#line 5479 "seclang-parser.cc" +#line 5478 "seclang-parser.cc" break; case 421: @@ -5483,7 +5482,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Trim()); } -#line 5487 "seclang-parser.cc" +#line 5486 "seclang-parser.cc" break; case 422: @@ -5491,7 +5490,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimLeft()); } -#line 5495 "seclang-parser.cc" +#line 5494 "seclang-parser.cc" break; case 423: @@ -5499,7 +5498,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::TrimRight()); } -#line 5503 "seclang-parser.cc" +#line 5502 "seclang-parser.cc" break; case 424: @@ -5507,7 +5506,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePathWin()); } -#line 5511 "seclang-parser.cc" +#line 5510 "seclang-parser.cc" break; case 425: @@ -5515,7 +5514,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::NormalisePath()); } -#line 5519 "seclang-parser.cc" +#line 5518 "seclang-parser.cc" break; case 426: @@ -5523,7 +5522,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Length()); } -#line 5527 "seclang-parser.cc" +#line 5526 "seclang-parser.cc" break; case 427: @@ -5531,7 +5530,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::Utf8ToUnicode()); } -#line 5535 "seclang-parser.cc" +#line 5534 "seclang-parser.cc" break; case 428: @@ -5539,7 +5538,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveCommentsChar()); } -#line 5543 "seclang-parser.cc" +#line 5542 "seclang-parser.cc" break; case 429: @@ -5547,7 +5546,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::RemoveComments()); } -#line 5551 "seclang-parser.cc" +#line 5550 "seclang-parser.cc" break; case 430: @@ -5555,7 +5554,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::transformations::ReplaceComments()); } -#line 5559 "seclang-parser.cc" +#line 5558 "seclang-parser.cc" break; case 431: @@ -5563,7 +5562,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::unsetOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5567 "seclang-parser.cc" +#line 5566 "seclang-parser.cc" break; case 432: @@ -5571,7 +5570,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setToOneOperation, std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5575 "seclang-parser.cc" +#line 5574 "seclang-parser.cc" break; case 433: @@ -5579,7 +5578,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::setOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5583 "seclang-parser.cc" +#line 5582 "seclang-parser.cc" break; case 434: @@ -5587,7 +5586,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::sumAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5591 "seclang-parser.cc" +#line 5590 "seclang-parser.cc" break; case 435: @@ -5595,7 +5594,7 @@ namespace yy { { ACTION_CONTAINER(yylhs.value.as < std::unique_ptr > (), new actions::SetVar(actions::SetVarOperation::substractAndSetOperation, std::move(yystack_[2].value.as < std::unique_ptr > ()), std::move(yystack_[0].value.as < std::unique_ptr > ()))); } -#line 5599 "seclang-parser.cc" +#line 5598 "seclang-parser.cc" break; case 436: @@ -5604,7 +5603,7 @@ namespace yy { yystack_[1].value.as < std::unique_ptr > ()->appendText(yystack_[0].value.as < std::string > ()); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); } -#line 5608 "seclang-parser.cc" +#line 5607 "seclang-parser.cc" break; case 437: @@ -5613,7 +5612,7 @@ namespace yy { yystack_[1].value.as < std::unique_ptr > ()->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); } -#line 5617 "seclang-parser.cc" +#line 5616 "seclang-parser.cc" break; case 438: @@ -5623,7 +5622,7 @@ namespace yy { r->appendText(yystack_[0].value.as < std::string > ()); yylhs.value.as < std::unique_ptr > () = std::move(r); } -#line 5627 "seclang-parser.cc" +#line 5626 "seclang-parser.cc" break; case 439: @@ -5633,11 +5632,11 @@ namespace yy { r->appendVar(std::move(yystack_[0].value.as < std::unique_ptr > ())); yylhs.value.as < std::unique_ptr > () = std::move(r); } -#line 5637 "seclang-parser.cc" +#line 5636 "seclang-parser.cc" break; -#line 5641 "seclang-parser.cc" +#line 5640 "seclang-parser.cc" default: break; @@ -7127,43 +7126,43 @@ namespace yy { const short seclang_parser::yyrline_[] = { - 0, 710, 710, 714, 715, 718, 723, 729, 735, 739, - 743, 749, 755, 761, 767, 772, 777, 783, 790, 794, - 798, 804, 808, 812, 817, 822, 827, 832, 836, 843, - 847, 854, 860, 870, 879, 889, 898, 911, 915, 919, - 923, 927, 931, 935, 939, 943, 947, 952, 956, 960, - 964, 968, 972, 977, 982, 986, 990, 994, 998, 1002, - 1006, 1010, 1014, 1018, 1022, 1026, 1030, 1034, 1038, 1042, - 1046, 1050, 1054, 1068, 1069, 1101, 1120, 1141, 1171, 1229, - 1236, 1240, 1244, 1248, 1252, 1256, 1260, 1264, 1273, 1277, - 1282, 1285, 1290, 1295, 1300, 1305, 1308, 1313, 1316, 1321, - 1326, 1329, 1334, 1339, 1344, 1349, 1354, 1359, 1364, 1367, - 1372, 1377, 1382, 1387, 1390, 1395, 1400, 1405, 1418, 1431, - 1444, 1457, 1470, 1496, 1524, 1536, 1556, 1583, 1589, 1594, - 1599, 1608, 1613, 1617, 1621, 1625, 1629, 1633, 1637, 1642, - 1647, 1659, 1665, 1669, 1673, 1684, 1693, 1694, 1701, 1706, - 1711, 1765, 1772, 1780, 1817, 1821, 1828, 1833, 1839, 1845, - 1851, 1858, 1868, 1872, 1876, 1880, 1884, 1888, 1892, 1896, - 1900, 1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, - 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, - 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012, 2016, - 2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, - 2060, 2064, 2068, 2072, 2076, 2080, 2084, 2088, 2092, 2096, - 2100, 2104, 2108, 2112, 2116, 2120, 2124, 2128, 2132, 2136, - 2140, 2144, 2148, 2152, 2156, 2160, 2164, 2168, 2172, 2176, - 2180, 2184, 2188, 2192, 2196, 2200, 2204, 2208, 2212, 2216, - 2220, 2224, 2229, 2233, 2237, 2242, 2246, 2250, 2255, 2260, - 2264, 2268, 2272, 2276, 2280, 2284, 2288, 2292, 2296, 2300, - 2304, 2308, 2312, 2316, 2320, 2324, 2328, 2332, 2336, 2340, - 2344, 2348, 2352, 2356, 2360, 2364, 2368, 2372, 2376, 2380, - 2384, 2388, 2392, 2396, 2400, 2404, 2408, 2412, 2416, 2420, - 2424, 2428, 2432, 2436, 2440, 2444, 2448, 2452, 2456, 2460, - 2464, 2468, 2472, 2476, 2480, 2484, 2488, 2492, 2496, 2500, - 2508, 2515, 2522, 2529, 2536, 2543, 2550, 2557, 2564, 2571, - 2578, 2585, 2595, 2599, 2603, 2607, 2611, 2615, 2619, 2623, - 2628, 2633, 2638, 2642, 2646, 2650, 2654, 2659, 2664, 2668, - 2672, 2676, 2680, 2684, 2688, 2692, 2696, 2700, 2704, 2708, - 2712, 2716, 2721, 2725, 2729, 2733, 2737, 2741, 2745, 2749, + 0, 711, 711, 715, 716, 719, 724, 730, 736, 740, + 744, 750, 756, 762, 768, 773, 778, 784, 791, 795, + 799, 805, 809, 813, 818, 823, 828, 833, 837, 844, + 848, 855, 861, 871, 880, 890, 899, 912, 916, 920, + 924, 928, 932, 936, 940, 944, 948, 953, 957, 961, + 965, 969, 973, 978, 983, 987, 991, 995, 999, 1003, + 1007, 1011, 1015, 1019, 1023, 1027, 1031, 1035, 1039, 1043, + 1047, 1051, 1055, 1069, 1070, 1102, 1121, 1142, 1172, 1230, + 1237, 1241, 1245, 1249, 1253, 1257, 1261, 1265, 1274, 1278, + 1283, 1286, 1291, 1296, 1301, 1306, 1309, 1314, 1317, 1322, + 1327, 1330, 1335, 1340, 1345, 1350, 1355, 1360, 1365, 1368, + 1373, 1378, 1383, 1388, 1391, 1396, 1401, 1406, 1419, 1432, + 1445, 1458, 1471, 1497, 1525, 1537, 1557, 1584, 1590, 1595, + 1600, 1609, 1614, 1618, 1622, 1626, 1630, 1634, 1638, 1643, + 1648, 1660, 1666, 1670, 1674, 1685, 1694, 1695, 1702, 1707, + 1712, 1766, 1773, 1781, 1818, 1822, 1829, 1834, 1840, 1846, + 1852, 1859, 1869, 1873, 1877, 1881, 1885, 1889, 1893, 1897, + 1901, 1905, 1909, 1913, 1917, 1921, 1925, 1929, 1933, 1937, + 1941, 1945, 1949, 1953, 1957, 1961, 1965, 1969, 1973, 1977, + 1981, 1985, 1989, 1993, 1997, 2001, 2005, 2009, 2013, 2017, + 2021, 2025, 2029, 2033, 2037, 2041, 2045, 2049, 2053, 2057, + 2061, 2065, 2069, 2073, 2077, 2081, 2085, 2089, 2093, 2097, + 2101, 2105, 2109, 2113, 2117, 2121, 2125, 2129, 2133, 2137, + 2141, 2145, 2149, 2153, 2157, 2161, 2165, 2169, 2173, 2177, + 2181, 2185, 2189, 2193, 2197, 2201, 2205, 2209, 2213, 2217, + 2221, 2225, 2230, 2234, 2238, 2243, 2247, 2251, 2256, 2261, + 2265, 2269, 2273, 2277, 2281, 2285, 2289, 2293, 2297, 2301, + 2305, 2309, 2313, 2317, 2321, 2325, 2329, 2333, 2337, 2341, + 2345, 2349, 2353, 2357, 2361, 2365, 2369, 2373, 2377, 2381, + 2385, 2389, 2393, 2397, 2401, 2405, 2409, 2413, 2417, 2421, + 2425, 2429, 2433, 2437, 2441, 2445, 2449, 2453, 2457, 2461, + 2465, 2469, 2473, 2477, 2481, 2485, 2489, 2493, 2497, 2501, + 2509, 2516, 2523, 2530, 2537, 2544, 2551, 2558, 2565, 2572, + 2579, 2586, 2596, 2600, 2604, 2608, 2612, 2616, 2620, 2624, + 2629, 2634, 2639, 2643, 2647, 2651, 2655, 2660, 2665, 2669, + 2673, 2677, 2681, 2685, 2689, 2693, 2697, 2701, 2705, 2709, + 2713, 2717, 2721, 2725, 2729, 2733, 2737, 2741, 2745, 2749, 2753, 2757, 2761, 2765, 2769, 2773, 2777, 2781, 2785, 2789, 2793, 2797, 2801, 2805, 2809, 2813, 2817, 2821, 2825, 2829, 2833, 2837, 2841, 2845, 2849, 2853, 2857, 2861, 2865, 2869, @@ -7202,7 +7201,7 @@ namespace yy { } // yy -#line 7206 "seclang-parser.cc" +#line 7205 "seclang-parser.cc" #line 3046 "seclang-parser.yy" diff --git a/src/parser/seclang-parser.hh b/src/parser/seclang-parser.hh index 86468e58..2e3664c2 100644 --- a/src/parser/seclang-parser.hh +++ b/src/parser/seclang-parser.hh @@ -84,6 +84,7 @@ class Driver; #include "src/actions/disruptive/redirect.h" #include "src/actions/init_col.h" #include "src/actions/exec.h" +#include "src/actions/expire_var.h" #include "src/actions/log_data.h" #include "src/actions/log.h" #include "src/actions/maturity.h" @@ -351,7 +352,7 @@ using namespace modsecurity::operators; a = std::move(c); -#line 355 "seclang-parser.hh" +#line 356 "seclang-parser.hh" # include # include // std::abort @@ -485,7 +486,7 @@ using namespace modsecurity::operators; #endif namespace yy { -#line 489 "seclang-parser.hh" +#line 490 "seclang-parser.hh" @@ -8586,7 +8587,7 @@ switch (yykind) } } // yy -#line 8590 "seclang-parser.hh" +#line 8591 "seclang-parser.hh" diff --git a/src/parser/seclang-parser.yy b/src/parser/seclang-parser.yy index e60af7af..6feb7e7b 100644 --- a/src/parser/seclang-parser.yy +++ b/src/parser/seclang-parser.yy @@ -45,6 +45,7 @@ class Driver; #include "src/actions/disruptive/redirect.h" #include "src/actions/init_col.h" #include "src/actions/exec.h" +#include "src/actions/expire_var.h" #include "src/actions/log_data.h" #include "src/actions/log.h" #include "src/actions/maturity.h" @@ -2715,8 +2716,7 @@ act: } | ACTION_EXPIRE_VAR { - //ACTION_NOT_SUPPORTED("ExpireVar", @0); - ACTION_CONTAINER($$, new actions::Action($1)); + ACTION_CONTAINER($$, new actions::ExpireVar($1)); } | ACTION_ID { diff --git a/src/rule_with_actions.cc b/src/rule_with_actions.cc index b1ccac8c..d2d58607 100644 --- a/src/rule_with_actions.cc +++ b/src/rule_with_actions.cc @@ -141,12 +141,12 @@ void RuleWithActions::addDefaultAction(std::shared_ptr a) { } else if (dynamic_cast(a.get())) { m_defaultActionActionsTag.push_back(std::dynamic_pointer_cast(a)); } else if (dynamic_cast(a.get())) { - m_defaultActionActionsRuntimePos.push_back(a); + m_defaultActionActionsRuntimePos.push_back(std::dynamic_pointer_cast(a)); m_defaultContainsStaticBlockAction = true; - } else if (std::dynamic_pointer_cast(a) != NULL) { - m_defaultActionDisruptiveAction = a; + } else if (std::dynamic_pointer_cast(a) != NULL) { + m_defaultActionDisruptiveAction = std::dynamic_pointer_cast(a); } else { - m_defaultActionActionsRuntimePos.push_back(a); + m_defaultActionActionsRuntimePos.push_back(std::dynamic_pointer_cast(a)); } } @@ -165,7 +165,6 @@ void RuleWithActions::addAction(actions::Action *a) { return; } - if (dynamic_cast(a)) { m_logData = std::unique_ptr(dynamic_cast(a)); } else if (dynamic_cast(a)) { @@ -176,14 +175,14 @@ void RuleWithActions::addAction(actions::Action *a) { } else if (dynamic_cast(a)) { m_actionsTag.push_back(std::unique_ptr(dynamic_cast(a))); } else if (dynamic_cast(a)) { - m_actionsRuntimePos.push_back(std::unique_ptr(dynamic_cast(a))); + m_actionsRuntimePos.push_back(std::unique_ptr(dynamic_cast(a))); m_containsStaticBlockAction = true; } else if (dynamic_cast(a)) { m_XmlNSs.push_back(std::unique_ptr(dynamic_cast(a))); - } else if (dynamic_cast(a) != NULL) { - m_disruptiveAction = std::unique_ptr(a); + } else if (dynamic_cast(a) != NULL) { + m_disruptiveAction = std::unique_ptr(dynamic_cast(a)); } else { - m_actionsRuntimePos.push_back(std::unique_ptr(a)); + m_actionsRuntimePos.push_back(std::unique_ptr(dynamic_cast(a))); } } @@ -241,23 +240,22 @@ void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans) { if (m_ruleId != b.first) { continue; } - actions::Action *a = dynamic_cast(b.second.get()); - if (dynamic_cast(a) != NULL) { + ActionWithExecution *a = dynamic_cast(b.second.get()); + if (dynamic_cast(a) != NULL) { trans->messageGetLast()->setRule(this); } executeAction(trans, a, false); - if (dynamic_cast(a) != NULL) { + if (dynamic_cast(a) != NULL) { disruptiveAlreadyExecuted = true; } } for (auto &a : getMatchActionsPtr()) { - if (!dynamic_cast(a) != NULL + if (!dynamic_cast(a) != NULL && !(disruptiveAlreadyExecuted && dynamic_cast(a))) { executeAction(trans, a, false); } } - if (!disruptiveAlreadyExecuted && m_disruptiveAction != nullptr) { executeAction(trans, m_disruptiveAction.get(), false); @@ -270,13 +268,14 @@ void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans) { void RuleWithActions::executeAction(Transaction *trans, - Action *a, bool defaultContext) { - if (dynamic_cast(a) == NULL) { - ms_dbg_a(trans, 9, "Running action: " + *a->getName()); - a->execute(trans); - return; - } + ActionWithExecution *a, bool defaultContext) { + ms_dbg_a(trans, 9, "Running action: " + *a->getName()); + a->execute(trans); +} + +void RuleWithActions::executeAction(Transaction *trans, + ActionDisruptive *a, bool defaultContext) { if (defaultContext && !hasBlockAction()) { ms_dbg_a(trans, 4, "Ignoring action: " + *a->getName() + \ " (rule does not cotains block)"); @@ -284,9 +283,10 @@ void RuleWithActions::executeAction(Transaction *trans, } if (trans->getRuleEngineState() == RulesSet::EnabledRuleEngine) { - ms_dbg_a(trans, 4, "Running (disruptive) action: " + + ms_dbg_a(trans, 4, "Running (disruptive) action: " + \ *a->getName() + "."); - a->execute(trans); + ActionWithExecution *ae = dynamic_cast(a); + ae->execute(trans); return; } diff --git a/src/rule_with_actions.h b/src/rule_with_actions.h index 901ef368..339db841 100644 --- a/src/rule_with_actions.h +++ b/src/rule_with_actions.h @@ -31,6 +31,8 @@ #include "modsecurity/rule.h" #include "modsecurity/actions/action.h" #include "src/actions/action_type_rule_metadata.h" +#include "src/actions/action_with_execution.h" +#include "src/actions/disruptive/disruptive_action.h" #ifdef __cplusplus @@ -54,15 +56,20 @@ class Transformation; using Transformation = actions::transformations::Transformation; using Transformations = std::vector >; using TransformationsPtr = std::vector; -using Action = actions::Action; -using ActionTypeRuleMetaData = actions::ActionTypeRuleMetaData; + using Actions = std::vector; +using ActionWithExecution = actions::ActionWithExecution; +using ActionTypeRuleMetaData = actions::ActionTypeRuleMetaData; +using ActionDisruptive = actions::disruptive::ActionDisruptive; + +using MatchActions = std::vector >; +using MatchActionsPtr = std::vector; + using Tags = std::vector >; using TagsPtr = std::vector; + using SetVars = std::vector >; using SetVarsPtr = std::vector; -using MatchActions = std::vector >; -using MatchActionsPtr = std::vector; using XmlNSs = std::vector >; using XmlNSsPtr = std::vector; @@ -110,7 +117,6 @@ class RuleWithActions : public Rule { int ACCURACY_NOT_SET = 10; int MATURITY_NOT_SET = 10; - RuleWithActions( Actions *a, Transformations *t, @@ -226,7 +232,11 @@ class RuleWithActions : public Rule { Transaction *trasn); void executeAction(Transaction *trans, - Action *a, + ActionWithExecution *a, + bool context); + + void executeAction(Transaction *trans, + ActionDisruptive *a, bool context); static void executeTransformation( @@ -357,8 +367,8 @@ class RuleWithActions : public Rule { inline bool hasCaptureAction() const { return m_containsCaptureAction || m_defaultContainsCaptureAction; } inline bool hasDisruptiveAction() const { return m_disruptiveAction != nullptr || m_defaultActionDisruptiveAction != nullptr; } - inline void setDisruptiveAction(const std::shared_ptr &a) { m_disruptiveAction = a; } - inline std::shared_ptr getDisruptiveAction() const { return m_disruptiveAction; } + inline void setDisruptiveAction(const std::shared_ptr &a) { m_disruptiveAction = a; } + inline std::shared_ptr getDisruptiveAction() const { return m_disruptiveAction; } inline bool hasBlockAction() const { return m_containsStaticBlockAction || m_defaultContainsStaticBlockAction; } inline void setHasBlockAction(bool b) { m_containsStaticBlockAction = b; } @@ -518,7 +528,7 @@ class RuleWithActions : public Rule { RuleWithActions *m_chainedRuleParent; /* actions */ - std::shared_ptr m_disruptiveAction; + std::shared_ptr m_disruptiveAction; std::shared_ptr m_logData; std::shared_ptr m_msg; MatchActions m_actionsRuntimePos; @@ -527,9 +537,10 @@ class RuleWithActions : public Rule { XmlNSs m_XmlNSs; /* actions || SecDefaultAction */ - std::shared_ptr m_defaultActionDisruptiveAction; + std::shared_ptr m_defaultActionDisruptiveAction; std::shared_ptr m_defaultActionLogData; std::shared_ptr m_defaultActionMsg; + MatchActions m_defaultActionActionsRuntimePos; SetVars m_defaultActionActionsSetVar; Tags m_defaultActionActionsTag;