Relintio WAF Protection Agent SDK (Ruby)
Official Ruby WAF integration for Rack-based web frameworks (Sinatra, Rails, Hanami).
Installation
Add the gem to your application's Gemfile:
gem 'relintio-agent', github: 'Relintio/relintio-ruby-agent'
Dashboard Deployment Workflow
- Open Dashboard → Deployment, select Ruby, and choose Rails or Sinatra.
- Download the prepared starter and insert the Relintio Rack middleware before the application.
- Restart the Rack server, then open one public route.
- Enter that exact URL or public IP endpoint in Relintio and select Verify target.
The SDK reports runtime kind ruby and its version during rule synchronization. Policy revisions are received automatically.
And then execute:
bundle install
Features
- Rule Cache Sync: Periodically syncs active rules in a thread-safe background thread.
- WAF Check Engine: Instant threat analysis against local cached rules.
- Rack Middleware: Standard Rack integration supporting all major Ruby web frameworks.
- Telemetry Loop: Non-blocking telemetry reporting back to the Relintio console.
Quickstart
Sinatra Integration
# config.ru
require 'sinatra'
require 'relintio-agent'
class App < Sinatra::Base
get '/' do
"Protected App"
end
end
# Initialize Relintio Agent
agent = Relintio::Agent.new(
license_key: "YOUR_LICENSE_KEY",
domain: "example.com",
api_url: "https://api.relintio.com/v1"
)
agent.start_sync
# Register Relintio Middleware
use Relintio::Middleware, agent
run App
Rails Integration
Add the middleware in your Rails configuration:
# config/application.rb
module YourApp
class Application < Rails::Application
# Initialize Relintio Agent
config.after_initialize do
$relintio_agent = Relintio::Agent.new(
license_key: ENV['RELINTIO_LICENSE_KEY'] || 'YOUR_LICENSE_KEY',
domain: ENV['RELINTIO_DOMAIN'] || 'example.com'
)
$relintio_agent.start_sync
end
# Register Rack Middleware
config.middleware.use Relintio::Middleware, -> { $relintio_agent }
end
end