Do language-specific steps
Use this workflow for applications that don't run on Kubernetes.
- Java
-
Secure Application integrates runtime security detection into your Java application through a JVM extension (
splunk-otel-javaagent-csa) that works with the Splunk Distribution of OpenTelemetry Java.If your application already uses the standard Splunk OpenTelemetry Java agent, replace that JAR with the Secure Application JVM extension JAR. The Secure Application JVM extension handles both Splunk APM instrumentation and Secure Application library scanning.
-
Download the Secure Application JVM extension version 2.25.1 or higher JAR file:
SHELLcurl -L https://repo1.maven.org/maven2/com/splunk/splunk-otel-javaagent-csa/<version>/splunk-otel-javaagent-csa-<version>.jar -o splunk-otel-javaagent-csa.jarNote: The name you give to the downloaded JAR file must containsplunk-otel-javaagent. -
Restart your application with the Secure Application JVM extension and its required configuration parameters. You can set these values through system properties or environment variables.
BASHjava -javaagent:./splunk-otel-javaagent-csa.jar \ -Dotel.service.name=<service-name> \ -Dotel.resource.attributes=deployment.environment.name=<environment-name>,service.namespace=<namespace-name> \ -Dotel.exporter.otlp.endpoint=http://<collector-endpoint>:4318 \ -Dargento.allow.security.events=true \ -jar <application-name>.jarSyntax:
BASHjava -javaagent:./splunk-otel-javaagent-csa.jar \ -Dotel.service.name=<service-name> \ -Dotel.resource.attributes=deployment.environment.name=<environment-name>,service.namespace=<namespace-name> \ -Dotel.exporter.otlp.endpoint=http://<collector-endpoint>:<collector-port> \ -Dargento.allow.security.events=true \ -jar <application-name>.jarTable 1. Secure Application JVM extension parameters System property Environment variable Description argento.allow.security.eventsNone Add this flag when you want Secure Application to collect attack events. You must include this flag to populate the Attacks page. otel.exporter.otlp.endpointOTEL_EXPORTER_OTLP_ENDPOINTOTLP endpoint for your OpenTelemetry Collector. Use port 4318for OTLP/HTTP or port4317for OTLP/gRPC, depending on your collector configuration.Example:
http://otel-collector:4318otel.resource.attributesOTEL_RESOURCE_ATTRIBUTESResource attributes to associate with your Java application.
Recommended:
deployment.environment.nameservice.namespace. For information about this parameter, see Service Attributes. For help with the JVM agent, see Splunk Observability Cloud 用 Java アプリケーションのインストルメンテーション.
If you set
otel.service.nameorOTEL_SERVICE_NAME, don't also defineservice.nameinotel.resource.attributes.otel.service.nameOTEL_SERVICE_NAMEService name of your Java application. This value sets the service.nameresource attribute. -
Verify Secure Application instrumentation:
-
Confirm that the application starts with
splunk-otel-javaagent-csa.jar. -
Confirm that your OpenTelemetry Collector receives telemetry from the application and doesn't report export errors for Secure Application data.
-
-
Look for security events in after a few minutes.
Runtime library and vulnerability data appear on the corresponding tabs. Attack events appear on the Attacks tab only if you start the application with
-Dargento.allow.security.events=true.
Tip:To roll back JVM extension changes, replace
splunk-otel-javaagent-csa.jarwith your previous Java agent JAR, remove-Dargento.allow.security.events=trueif you added it, and restart the application. - Node.js
-
-
Instrument your application with Splunk OpenTelemetry JS version 4.x.
-
Activate Secure Application instrumentation for the Node.js agent.
Set the
SPLUNK_SECUREAPP_AGENT_ENABLEDenvironment variable totrue.CODEexport SPLUNK_SECUREAPP_AGENT_ENABLED=true -
Configure the OTLP logs endpoint.
By default, the Node.js agent sends Secure Application logs to
http://localhost:4318/v1/logsbut you can change this by setting one of these environment variables:Environment variable Description Example OTEL_EXPORTER_OTLP_ENDPOINTBase OTLP endpoint. The Node.js agent appends
/v1/logswhen it sends Secure Application logs.http://localhost:4318OTEL_EXPORTER_OTLP_LOGS_ENDPOINTFull OTLP logs endpoint. The Node.js agent doesn't append
/v1/logs.https://localhost:4318/v1/logs -
Set service metadata for your Node.js application.
Environment variable Description Example OTEL_SERVICE_NAMEService name for the instrumented Node.js application.
checkout-serviceOTEL_RESOURCE_ATTRIBUTESResource attributes that describe the instrumented service.
deployment.environment=test -
Optional: Configure Secure Application runtime reporting.
Environment variable Description Default SPLUNK_SECUREAPP_DEPENDENCY_SCAN_INTERVALTime, in milliseconds, between dependency scans.
86400000(24 hours)SPLUNK_SECUREAPP_RUNTIME_PACKAGES_ONLYWhen set to
true, reports only packages loaded at runtime.trueSPLUNK_SECUREAPP_NO_SELF_REPORTWhen set to
true, excludes dependencies of the Node.js agent from the report.false -
Run your Node.js application:
SHELLnode -r @splunk/otel/instrument <your-application>.js
Your Node.js application launches with Secure Application instrumentation activated. The Node.js agent does the following:
-
Sends vulnerability and library data to the Splunk Observability Cloud back end.
-
Collects potential attack events at runtime.
-
Reports data once at application startup and then every 24 hours thereafter.
- Python
-
Secure Application integrates runtime security detection into your Python application through a Python extension (
secureapp-python-agent) that works with the Splunk Distribution of OpenTelemetry Python. This extension sends the OpenTelemetry events and logs that Secure Application needs to Splunk Observability Cloud. Follow these steps to add this extension to your Python application.Note: The examples in this topic are for a Linux environment.-
Confirm that you meet the Python instrumentation requirements.
-
Install the Secure Application Python extension (
secureapp-python-agent):-
If you've already installed the Splunk Distribution of OpenTelemetry Python, you already have the Splunk instrumentation agent (
splunk-opentelemetry) installed. Just install the Secure Application Python extension:BASHpip install secureapp-python-agent -
Otherwise, install the Secure Application Python extension together with the Splunk instrumentation agent (
splunk-opentelemetry):BASHpip install "splunk-opentelemetry[secureapp]"
Tip: If you're using a requirements.txt or pyproject.toml file, addsplunk-opentelemetryto it. -
-
(Optional) Set these environment variables to customize the behavior of the Secure Application Python extension. However, using the default values is strongly recommended:
Environment variable Default Description SPLUNK_SECUREAPP_AGENT_ENABLEDtrueActivate or deactivate the agent. SPLUNK_SECUREAPP_DEPENDENCY_INITIAL_DELAY60.0Initial delay (seconds) before dependency tracking starts. SPLUNK_SECUREAPP_DEPENDENCY_SCAN_INTERVAL86400Interval (seconds) between dependency scans (24 hours). Example:
BASHexport SPLUNK_SECUREAPP_AGENT_ENABLED=true export SPLUNK_SECUREAPP_DEPENDENCY_INITIAL_DELAY=60 export SPLUNK_SECUREAPP_DEPENDENCY_SCAN_INTERVAL=86400 -
(Optional) If you haven't already done so, run the
opentelemetry-bootstraptool to scan your current Python environment, detect which libraries you have installed, and automatically install the necessary OpenTelemetry instrumentation packages for them:BASHopentelemetry-bootstrap -a installAlternatively, run the
opentelemetry-bootstraptool to print the supported packages to the console, and add the output to your requirements.txt or pipfile:CODEopentelemetry-bootstrap -
Run your Python application with the
opentelemetry-instrumentwrapper.BASHopentelemetry-instrument python3 <application-name>.py -
(Optional) Send data directly to Splunk Observability Cloud.
By default, the extension sends all telemetry to the local instance of the Splunk Distribution of OpenTelemetry Collector. To send data directly to Splunk Observability Cloud, set the
SPLUNK_ACCESS_TOKENandSPLUNK_REALMenvironment variables:BASHexport SPLUNK_ACCESS_TOKEN=<access-token> export SPLUNK_REALM=<realm>To obtain a Splunk access token, see Retrieve and manage user API access tokens using Splunk Observability Cloud. To find your Splunk realm, see Configure SSO integrations for Splunk Observability Cloud. For more information on the ingest API endpoints, see Send APM traces.
-
Set service metadata for your Python application.
For descriptions of these environment variables, see Splunk Observability Cloud 用の Python エージェントを設定する:
OTEL_SERVICE_NAMEOTEL_RESOURCE_ATTRIBUTES
Sample minimal configuration for a Kubernetes environment:
BASHexport OTEL_SERVICE_NAME=<application-name> export OTEL_RESOURCE_ATTRIBUTES="service.name=<application-name>,service.version=<version>" -
Look for security events in after a few minutes.
Your Python application:
-
Sends vulnerability and library data to the Splunk Observability Cloud backend.
-
Collects potential attack events at runtime.
-
Reports data once at application startup and then every 24 hours thereafter.
-