mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 11:16:30 +03:00
Mar 26th 2023 Dev
This commit is contained in:
@@ -26,6 +26,7 @@ target_link_libraries(
|
||||
orchestration_downloader
|
||||
update_communication
|
||||
orchestration_tools
|
||||
env_details
|
||||
messaging_downloader_client
|
||||
local_policy_mgmt_gen
|
||||
curl
|
||||
|
@@ -75,7 +75,7 @@ enum class Service {
|
||||
REVERSE_PROXY_MANAGER,
|
||||
CAPSULE8,
|
||||
SDWAN,
|
||||
SDWAN_LOGGER,
|
||||
LOGGER_SDWAN,
|
||||
IOT_ENFORCE,
|
||||
IOT_DOCTOR,
|
||||
IOT_RISK,
|
||||
@@ -166,7 +166,7 @@ getServiceString(const Service service)
|
||||
case (Service::DEDICATED_NETWORK_HANDLER): return "dedicated-network-handler";
|
||||
case (Service::MESSAGING_PROXY): return "messaging-proxy";
|
||||
case (Service::SDWAN): return "sdwan";
|
||||
case (Service::SDWAN_LOGGER): return "sdwan-logger";
|
||||
case (Service::LOGGER_SDWAN): return "logger-sdwan";
|
||||
case (Service::IOT_WLP): return "workload-protection";
|
||||
case (Service::HELLO_WORLD): return "hello-world";
|
||||
case (Service::IDA): return "identity-awareness";
|
||||
@@ -329,7 +329,7 @@ getServiceConfig (const Service service)
|
||||
filesystem_path + "/conf/cp-nano-sdwan-debug-conf.json",
|
||||
log_files_path + "/nano_agent/cp-nano-sdwan.dbg"
|
||||
);
|
||||
case (Service::SDWAN_LOGGER):
|
||||
case (Service::LOGGER_SDWAN):
|
||||
return ServiceConfig(
|
||||
filesystem_path + "/conf/cp-nano-logger-sdwan-debug-conf.json",
|
||||
log_files_path + "/nano_agent/cp-nano-logger-sdwan.dbg"
|
||||
@@ -1279,8 +1279,8 @@ extractServices(const vector<string> &args)
|
||||
services.push_back(Service::MESSAGING_PROXY);
|
||||
} else if (getServiceString(Service::SDWAN).find(maybe_service) == 0) {
|
||||
services.push_back(Service::SDWAN);
|
||||
} else if (getServiceString(Service::SDWAN_LOGGER).find(maybe_service) == 0) {
|
||||
services.push_back(Service::SDWAN_LOGGER);
|
||||
} else if (getServiceString(Service::LOGGER_SDWAN).find(maybe_service) == 0) {
|
||||
services.push_back(Service::LOGGER_SDWAN);
|
||||
} else if (getServiceString(Service::IOT_WLP).find(maybe_service) == 0) {
|
||||
services.push_back(Service::IOT_WLP);
|
||||
} else if (getServiceString(Service::IDA).find(maybe_service) == 0) {
|
||||
|
@@ -953,13 +953,34 @@ run_status() # Initials - rs
|
||||
fi
|
||||
|
||||
if [ -n "$(cat /etc/cp/conf/agent_details.json | grep "hybrid_mode")" ]; then
|
||||
add_policy_file=true
|
||||
rs_mgmt_mode_text="Local management"
|
||||
else
|
||||
rs_mgmt_mode_text="Cloud management"
|
||||
if [ -n "$(cat /etc/cp/conf/settings.json | grep "\"profileManagedMode\":\"management\"")" ]; then
|
||||
add_policy_file=false
|
||||
rs_mgmt_mode_text="Cloud management (Fully managed)"
|
||||
else
|
||||
add_policy_file=true
|
||||
rs_mgmt_mode_text="Cloud management (Visibility mode)"
|
||||
fi
|
||||
fi
|
||||
echo "Management mode: ${rs_mgmt_mode_text}"
|
||||
echo "Policy files: "
|
||||
echo " /etc/cp/conf/local_policy.yaml"
|
||||
|
||||
if [ "${add_policy_file}" = "true" ]; then
|
||||
echo "Policy files: "
|
||||
echo " /etc/cp/conf/local_policy.yaml"
|
||||
else
|
||||
policy=`cat /etc/cp/conf/policy.json`
|
||||
version="version"
|
||||
policy_version=${policy#*version}
|
||||
policy_version=`echo $policy_version | cut -d"\"" -f3`
|
||||
|
||||
if [ -n "$policy_version" ] && [ "$policy_version" -eq "$policy_version" ] 2>/dev/null; then
|
||||
echo "Policy version: ${policy_version}"
|
||||
else
|
||||
echo "Policy version: Updating policy. Please try again in a few seconds"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$(echo ${rs_temp_old_status} | grep "Last update status" | grep "Fail")" ]; then
|
||||
rs_policy_load_status="Error"
|
||||
|
@@ -51,6 +51,7 @@ var_error_sleep_interval=30
|
||||
var_upgrade_mode=
|
||||
var_token=
|
||||
var_email=
|
||||
var_server=
|
||||
var_installation_debug_mode=false
|
||||
var_startup_service=
|
||||
var_arch_flag=
|
||||
@@ -227,6 +228,9 @@ while true; do
|
||||
elif [ "$1" = "--email" ]; then
|
||||
shift
|
||||
var_email=$1
|
||||
elif [ "$1" = "--server" ]; then
|
||||
shift
|
||||
var_server=$1
|
||||
elif [ "$1" = "--offline_mode" ]; then
|
||||
var_offline_mode=true
|
||||
var_orchestration_mode="offline_mode"
|
||||
@@ -896,7 +900,7 @@ install_orchestration()
|
||||
echo '{"'$ORCHESTRATION_NAME'": { "fog-address":"'$var_fog_address'", ' > ${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
|
||||
echo '"pulling-interval":'$var_sleep_interval', ' >> ${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
|
||||
echo '"error-pulling-interval":'$var_error_sleep_interval'},' >> ${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
|
||||
echo '"registration-data": { "email-address": "'$var_email'"}}' >> ${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
|
||||
echo '"registration-data": { "email-address": "'$var_email'", "registered-server": "'$var_server'"}}' >> ${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
|
||||
|
||||
copy_orchestration_executable
|
||||
copy_k8s_executable
|
||||
|
Reference in New Issue
Block a user