Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion install_script.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,7 @@ function manage_client_libraries_security_config(){
local asm_enable="$3"
local iast_enable="$4"
local sca_enable="$5"
local standalone_enable="$6"
$sudo_cmd touch "$etc_environment"
if [ -n "$asm_enable" ]; then
set_in_env_file "$sudo_cmd" "$etc_environment" DD_APPSEC_ENABLED "$asm_enable"
Expand All @@ -1825,6 +1826,9 @@ function manage_client_libraries_security_config(){
if [ -n "$sca_enable" ]; then
set_in_env_file "$sudo_cmd" "$etc_environment" DD_APPSEC_SCA_ENABLED "$sca_enable"
fi
if [ -n "$standalone_enable" ]; then
$sudo_cmd sed -i -n -e '/^DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=/!p' -e "\$aDD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=$standalone_enable" "$etc_environment"
fi
}
function manage_client_libraries_profiling_config(){
local sudo_cmd="$1"
Expand Down Expand Up @@ -1857,7 +1861,7 @@ elif [ ! "$no_agent" ]; then
manage_security_and_system_probe_config "$sudo_cmd" "$security_agent_config_file" "$system_probe_config_file" "$DD_RUNTIME_SECURITY_CONFIG_ENABLED" "$DD_COMPLIANCE_CONFIG_ENABLED"
fi

manage_client_libraries_security_config "$sudo_cmd" "$environment_file" "$DD_APPSEC_ENABLED" "$DD_IAST_ENABLED" "$DD_APPSEC_SCA_ENABLED"
manage_client_libraries_security_config "$sudo_cmd" "$environment_file" "$DD_APPSEC_ENABLED" "$DD_IAST_ENABLED" "$DD_APPSEC_SCA_ENABLED" "$DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED"
manage_client_libraries_profiling_config "$sudo_cmd" "$environment_file" "$DD_PROFILING_ENABLED"
if [ -e "$(dirname $dd_environment_file)" ]; then
manage_infrastructure_vulnerabilities_config "$sudo_cmd" "$dd_environment_file" "$DD_SBOM_CONTAINER_IMAGE_ENABLED" "$DD_SBOM_HOST_ENABLED"
Expand Down
11 changes: 7 additions & 4 deletions unit_tests/test_install_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,25 @@ testFullConfig(){
testManageClientLibrariesSecurityConfig() {
rm $environment_file
echo 'PATH="/usr/local/sbin"' > $environment_file
manage_client_libraries_security_config "sudo" $environment_file "" "" ""
manage_client_libraries_security_config "sudo" $environment_file "" "" "" ""
grep -q "DD_APPSEC_ENABLED" $environment_file
assertEquals 1 $?
grep -q "DD_IAST_ENABLED" $environment_file
assertEquals 1 $?
grep -q "DD_APPSEC_SCA_ENABLED" $environment_file
assertEquals 1 $?
manage_client_libraries_security_config "sudo" $environment_file true "" ""
manage_client_libraries_security_config "sudo" $environment_file true "" "" ""
grep -q "DD_APPSEC_ENABLED=true" $environment_file
assertEquals 0 $?
manage_client_libraries_security_config "sudo" $environment_file "" true ""
manage_client_libraries_security_config "sudo" $environment_file "" true "" ""
grep -q "DD_IAST_ENABLED=true" $environment_file
assertEquals 0 $?
manage_client_libraries_security_config "sudo" $environment_file "" "" false
manage_client_libraries_security_config "sudo" $environment_file "" "" false ""
grep -q "DD_APPSEC_SCA_ENABLED=false" $environment_file
assertEquals 0 $?
manage_client_libraries_security_config "sudo" $environment_file "" "" "" true
grep -q "DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=true" $environment_file
assertEquals 0 $?
}

### Manage client libraries profiling config
Expand Down