mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +03:00
update embedded nginx support for openappsec and bug fixes and schema changes
This commit is contained in:
@@ -80,7 +80,11 @@ public:
|
||||
_severity,
|
||||
_priority,
|
||||
std::chrono::seconds(0),
|
||||
LogField("agentId", Singleton::Consume<I_AgentDetails>::by<LogGen>()->getAgentId()),
|
||||
LogField(
|
||||
"agentId",
|
||||
(Report::isPlaygroundEnv() ? "playground-" : "") +
|
||||
Singleton::Consume<I_AgentDetails>::by<LogGen>()->getAgentId()
|
||||
),
|
||||
std::forward<Args>(args)...
|
||||
)
|
||||
{
|
||||
|
@@ -16,6 +16,10 @@
|
||||
|
||||
#include <set>
|
||||
#include <chrono>
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <iostream>
|
||||
|
||||
#include "report/base_field.h"
|
||||
#include "report/report_enums.h"
|
||||
@@ -71,6 +75,26 @@ public:
|
||||
setInstanceAwareness();
|
||||
}
|
||||
|
||||
static bool
|
||||
isPlaygroundEnv()
|
||||
{
|
||||
std::string playground_variable = "PLAYGROUND";
|
||||
const char *env_string = getenv(playground_variable.c_str());
|
||||
|
||||
if (env_string) {
|
||||
std::string env_value = env_string;
|
||||
std::transform(
|
||||
env_value.begin(),
|
||||
env_value.end(),
|
||||
env_value.begin(),
|
||||
[](unsigned char c){ return std::tolower(c); }
|
||||
);
|
||||
return env_value == "true";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void serialize(cereal::JSONOutputArchive &ar) const;
|
||||
std::string getSyslog() const;
|
||||
std::string getCef() const;
|
||||
|
Reference in New Issue
Block a user