mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +03:00
Mar 2nd 2023 update
This commit is contained in:
@@ -50,7 +50,7 @@ checkIDP(shared_ptr<istream> file_stream)
|
||||
if (line.find("<identity_portal/>") != string::npos) {
|
||||
return string("false");
|
||||
}
|
||||
if (line.find("identity_provider") != string::npos) {
|
||||
if (line.find("<central_idp ") != string::npos) {
|
||||
return string("true");
|
||||
}
|
||||
}
|
||||
|
@@ -46,12 +46,7 @@ SHELL_CMD_HANDLER(
|
||||
getSmbObjectName
|
||||
)
|
||||
#endif//smb
|
||||
#endif // SHELL_CMD_HANDLER
|
||||
|
||||
|
||||
// use SHELL_CMD_OUTPUT(key as string, shell command as string) to return a shell command output as the value
|
||||
// for a given key
|
||||
#ifdef SHELL_CMD_OUTPUT
|
||||
SHELL_CMD_OUTPUT("kernel_version", "uname -r")
|
||||
SHELL_CMD_OUTPUT("helloWorld", "cat /tmp/agentHelloWorld 2>/dev/null")
|
||||
#endif // SHELL_CMD_OUTPUT
|
||||
|
@@ -397,7 +397,7 @@ ManifestController::Impl::handlePackage(
|
||||
|
||||
if (!package.isInstallable().ok()) {
|
||||
string report_msg =
|
||||
"Skipping installation of " + package.getName() + ". Reason: " + package.isInstallable().getErr();
|
||||
"Skipping installation of package: " + package.getName() + ". Reason: " + package.isInstallable().getErr();
|
||||
dbgWarning(D_ORCHESTRATOR) << report_msg;
|
||||
LogGen(report_msg, Audience::SECURITY, Severity::CRITICAL, Priority::HIGH, Tags::ORCHESTRATOR);
|
||||
current_packages.insert(make_pair(package.getName(), package));
|
||||
|
@@ -1342,6 +1342,18 @@ private:
|
||||
<< LogField("agentType", "Orchestration")
|
||||
<< LogField("agentVersion", Version::get());
|
||||
|
||||
auto email = getSettingWithDefault<string>("", "email-address");
|
||||
if (email != "") {
|
||||
dbgInfo(D_ORCHESTRATOR) << "Sending registration data";
|
||||
LogGen(
|
||||
"Local Agent Data",
|
||||
Audience::INTERNAL,
|
||||
Severity::INFO,
|
||||
Priority::LOW,
|
||||
Tags::ORCHESTRATOR
|
||||
) << LogField("userDefinedId", email);
|
||||
}
|
||||
|
||||
reportAgentDetailsMetaData();
|
||||
|
||||
if (!Singleton::Consume<I_ManifestController>::by<OrchestrationComp>()->loadAfterSelfUpdate()) {
|
||||
@@ -1683,5 +1695,7 @@ OrchestrationComp::preload()
|
||||
registerExpectedSetting<vector<string>>("orchestration", "Orchestration status ignored policies");
|
||||
registerExpectedSetting<string>("agentType");
|
||||
registerExpectedSetting<string>("upgradeMode");
|
||||
registerExpectedSetting<string>("email-address");
|
||||
registerExpectedConfigFile("orchestration", Config::ConfigFileType::Policy);
|
||||
registerExpectedConfigFile("registration-data", Config::ConfigFileType::Policy);
|
||||
}
|
||||
|
@@ -456,6 +456,25 @@ TEST_F(OrchestrationTest, register_config)
|
||||
env.fini();
|
||||
}
|
||||
|
||||
TEST_F(OrchestrationTest, registertion_data_config)
|
||||
{
|
||||
EXPECT_CALL(rest, mockRestCall(RestAction::ADD, "declare-boolean-variable", _))
|
||||
.WillOnce(WithArg<2>(Invoke(this, &OrchestrationTest::declareVariable)));
|
||||
|
||||
preload();
|
||||
env.init();
|
||||
|
||||
string config_json =
|
||||
"{\n"
|
||||
" \"email-address\": \"fake@example.com\"\n"
|
||||
"}";
|
||||
|
||||
istringstream ss(config_json);
|
||||
Singleton::Consume<Config::I_Config>::from(config_comp)->loadConfiguration(ss);
|
||||
EXPECT_THAT(getSetting<string>("email-address"), IsValue("fake@example.com"));
|
||||
env.fini();
|
||||
}
|
||||
|
||||
TEST_F(OrchestrationTest, orchestrationPolicyUpdate)
|
||||
{
|
||||
waitForRestCall();
|
||||
|
Reference in New Issue
Block a user