Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddtrace/tracer: include appsec status into startup logging #1032

Merged
merged 5 commits into from
Oct 27, 2021

Conversation

Julio-Guerra
Copy link
Contributor

@Julio-Guerra Julio-Guerra commented Oct 22, 2021

As a result of the first installation of AppSec at Datadog, it would be better adding extra logs to cover some blind spots we have with:

-tags appsec DD_APPSEC_ENABLED Log message
false false Nothing
false true INFO: appsec: enabled by the configuration but has not been activated during the compilation: please add the go build tag appsec to your build options to enable it
false parsing error ERROR: appsec: error while checking if appsec is enabled: could not parse DD_APPSEC_ENABLED value truc as a boolean value
true false DEBUG: appsec: disabled by the configuration: set the environment variable DD_APPSEC_ENABLED to true to enable it
true true INFO: appsec: starting with default recommended security rules
true parsing error ERROR: appsec: could not start because of an unexpected error: could not parse DD_APPSEC_ENABLED value truce as a boolean value No security activities will be collected. Please contact support at https://docs.datadoghq.com/help/ for help.

@Julio-Guerra Julio-Guerra added this to the 1.34.0 milestone Oct 22, 2021
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit for testing.

In addition, I'm hoping we can include appsec in the startup log line:

func logStartup(t *tracer) {

Since appsec is integrated into the tracer, and this specific log line is used by support to gather basic configuration and status information about the tracer, it would be a good place for it.

If Appsec can export a simple Status() string function or something like that to report its status ("running", "disabled", etc.), we can use that to report appsec status along with the rest of the startup log stuff.

ddtrace/tracer/spancontext_test.go Outdated Show resolved Hide resolved
@gbbr gbbr changed the title appsec: improve startup logging ddtrace/tracer: include appsec status into startup logging Oct 27, 2021
@gbbr gbbr merged commit bc980e2 into v1 Oct 27, 2021
@gbbr gbbr deleted the julio-guerra/better-appsec-enabled-log branch October 27, 2021 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants