Last updated October 2026
Runtime Application Self-Protection (RASP) is a security technology that embeds directly inside an application’s runtime environment — within the JVM, Node.js process, .NET CLR, or Python interpreter — to detect and block attacks in real time from within. Unlike perimeter defences like Web Application Firewalls (WAFs) that inspect traffic externally, RASP has full visibility into application logic, data flow, and context, enabling it to identify and stop sophisticated attacks like SQL injection, command injection, and zero-day exploits with near-zero false positives.
How Does RASP Technology Work?
RASP operates by instrumenting the application at runtime. Here’s the technical mechanism:
Instrumentation Layer
RASP agents attach to the application’s runtime through language-specific mechanisms:
- Java: Java agents (
-javaagentflag) that use bytecode instrumentation (ASM/Byte Buddy) to intercept method calls. - Node.js: Module hooks that wrap require/import to intercept I/O operations.
- .NET: CLR profiling APIs that instrument method entry/exit points.
- Python: Monkey-patching or import hooks on database drivers, OS modules, and HTTP libraries.
Context-Aware Detection
When an instrumented function executes (e.g., a database query, file system access, command execution, or network call), RASP analyses the operation in context:
- Data flow tracking: Traces user input from the HTTP request through the application code to the sensitive operation (taint analysis).
- Semantic analysis: Evaluates whether user-supplied data alters the intended semantics of the operation. For SQL injection, it checks if user input changes the SQL parse tree. For command injection, it checks if input introduces new shell commands.
- Policy evaluation: Matches the operation against security rules — known attack patterns, deviation from expected behaviour, access to restricted resources.
Response Actions
When an attack is detected, RASP can:
- Monitor mode: Log the attack and allow the request to proceed (for initial deployment and tuning).
- Block mode: Terminate the request and return an error response.
- Sanitise: Neutralise the malicious payload before it reaches the sensitive function.
- Alert: Send real-time notifications to SIEM systems, Slack, or email.
How Does RASP Compare to WAF?
| Aspect | WAF | RASP |
|---|---|---|
| Deployment | Network perimeter (reverse proxy/CDN) | Inside the application runtime |
| Visibility | HTTP request/response only | Full application context (code, data, libraries) |
| False positives | High (pattern-matching without context) | Very low (understands intended vs actual behaviour) |
| Encrypted traffic | Requires TLS termination to inspect | Sees decrypted data natively within the app |
| Zero-day protection | Limited (relies on updated rules) | Strong (behaviour-based, not signature-based) |
| Performance impact | Minimal (external proxy) | 2-5% latency overhead (instrumentation cost) |
| Protection scope | HTTP layer attacks | HTTP + application logic + internal function calls |
| Maintenance | Frequent rule updates needed | Self-tuning based on application behaviour |
Best practice: Use WAF and RASP together. The WAF filters bulk attack traffic at the perimeter (DDoS, known bots, generic scanners), reducing the load on RASP. RASP catches sophisticated attacks that bypass WAF rules — the layered approach provides defence in depth.
What Attacks Does RASP Protect Against?
RASP is particularly effective against:
- SQL injection (SQLi): Detects when user input modifies the SQL parse tree, blocking injected queries even if the WAF signature is bypassed.
- Cross-site scripting (XSS): Identifies malicious script execution in response rendering.
- Command injection / OS command execution: Blocks user input that reaches
exec(),system(), or similar functions. - Path traversal: Prevents file access outside allowed directories (e.g.,
../../etc/passwd). - SSRF (Server-Side Request Forgery): Blocks outbound requests to internal network addresses triggered by user input.
- Deserialization attacks: Detects unsafe deserialisation of user-supplied objects (critical for Java applications).
- Log4Shell-type vulnerabilities: RASP agents that monitor JNDI lookups could have blocked Log4Shell exploitation even before patches were available.
- Dependency vulnerabilities: Some RASP solutions monitor known-vulnerable library functions and block their exploitation.
Which RASP Solutions Are Available?
- OpenRASP (Baidu, open-source): Java and PHP support. Free. Good for teams wanting to understand RASP internals. Limited commercial support.
- Contrast Security (Contrast Protect): Java, .NET, Node.js, Python, Go. Enterprise-grade. Pricing from $15,000-50,000/year depending on application count.
- Imperva RASP: Part of Imperva’s application security suite. Java and .NET. Enterprise pricing.
- Sqreen (acquired by Datadog): Now part of Datadog Application Security Management (ASM). Node.js, Python, Ruby, Java, Go, .NET. RASP capabilities bundled with Datadog APM — plans from $31/host/month (approximately ₹2,600/host/month).
- Hdiv/RIPS: Java and .NET focus. European vendor with strong OWASP compliance.
For Indian businesses, Datadog ASM offers the best balance of RASP capability, observability integration, and manageable per-host pricing. Open-source OpenRASP works for teams with dedicated security engineers who can manage deployment and tuning.
How Do You Implement RASP in a Production Environment?
- Start in monitor mode: Deploy the RASP agent in observe-only mode for 2-4 weeks. This baseline period identifies legitimate application behaviour and prevents false-positive blocks.
- Review alerts: Analyse flagged events. Tune rules to whitelist legitimate patterns (e.g., admin panel SQL queries, internal API calls).
- Enable block mode incrementally: Start with high-confidence attack categories (SQL injection, command injection) in block mode while keeping lower-confidence categories in monitor mode.
- Integrate with SIEM/monitoring: Forward RASP events to your ELK stack, Datadog, or Splunk for correlation with application logs and network events.
- Performance testing: Run load tests with RASP enabled to measure latency impact. Typical overhead is 2-5% on response times. If overhead exceeds 10%, review instrumentation scope and disable unnecessary monitors.
- Ongoing maintenance: Update RASP agents with application deployments. Review blocked attacks weekly. Adjust rules as application functionality changes.
Frequently Asked Questions
Does RASP slow down my application?
Modern RASP solutions add 2-5% latency overhead on average. For a web application with 200ms average response time, that is 4-10ms additional latency — imperceptible to users. High-throughput applications (10,000+ requests/second) should performance-test carefully before production deployment.
Can RASP replace a WAF entirely?
No. RASP and WAF serve complementary roles. WAFs handle volumetric attacks (DDoS), IP-based blocking, rate limiting, and bot management. RASP handles application-layer logic attacks. Use both for comprehensive protection.
Is RASP relevant for startups or only enterprises?
RASP is relevant for any application handling sensitive data (payments, PII, health records). Indian startups processing UPI payments or storing Aadhaar-linked data should consider RASP as part of their security stack. Datadog ASM at ₹2,600/host/month is accessible for funded startups; OpenRASP is free for bootstrapped teams.
Does RASP work with containerised (Docker/Kubernetes) applications?
Yes. RASP agents are typically bundled into the application container image. For Java, add the agent JAR to the Dockerfile and set the -javaagent flag. For Node.js, add the RASP package as a dependency and require it at application startup. Kubernetes health checks should account for the agent’s initialisation time.
How does RASP handle the DPDP Act compliance for Indian applications?
RASP directly supports DPDP Act compliance by preventing data breaches at the application layer — blocking SQL injection that could exfiltrate personal data, preventing SSRF that could access internal databases, and logging attempted attacks for audit trails. Combined with encryption and access controls, RASP strengthens your technical safeguards under Section 8 of the DPDP Act.






