Skip to content

Commit

Permalink
possibility to disable appsec if force disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-0 committed Oct 24, 2024
1 parent da6bbe1 commit 9a5c69e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contrib/envoyproxy/envoy/cmd/serviceextensions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ func loadConfig() serviceExtensionConfig {
func main() {
var extensionService AppsecCalloutExtensionService

// Force set ASM as enabled and set it as running in standalone mode
err := os.Setenv("DD_APPSEC_ENABLED", "1")
if err != nil {
log.Error("service_extension: failed to set environment variable: %v\n", err)
return
// Force set ASM as enabled only if the environment variable is not set
// Note: If the environment variable is set to false, it should be disabled
if os.Getenv("DD_APPSEC_ENABLED") == "" {
if err := os.Setenv("DD_APPSEC_ENABLED", "1"); err != nil {
log.Error("service_extension: failed to set DD_APPSEC_ENABLED environment variable: %v\n", err)
}
}

// TODO: Enable ASM standalone mode when it is developed (should be done for Q4 2024)
Expand Down

0 comments on commit 9a5c69e

Please sign in to comment.