Multi-layered, proactive security for Rails applications. Named after Mandalorian armor because your app deserves legendary protection.
You already have Devise for authentication and Rack::Attack for rate limiting. But there's a gap between basic security hygiene and actually sleeping at night.
Beskar is the layer between basic authentication and paranoid security.
It learns from behavior, responds automatically, and gives you visibility into what's actually happening.
Multiple layers of protection working together to secure your Rails application
Detects and blocks vulnerability scanning across 7 attack categories: WordPress, PHP panels, config files, path traversal, and more.
Automatically locks accounts when logins occur from physically impossible locations within a short timeframe using Haversine calculations.
Pattern-aware throttling detects brute force, distributed attacks, credential stuffing, and complex attack signatures.
Risk scores based on geographic anomalies, device fingerprints, login patterns, and IP reputation. Auto-locks high-risk logins.
Hybrid cache + database blocking survives restarts. Escalating bans: 1h → 6h → 24h → 7d → permanent for repeat offenders.
Trusted IPs (office networks, VPN gateways) bypass blocking while maintaining audit logs. CIDR notation and IPv6 supported.
Add Beskar to your Rails application with just a few commands
# Gemfile
gem 'beskar'
bundle install
bin/rails beskar:install
bin/rails db:migrate
# app/models/user.rb
class User < ApplicationRecord
include Beskar::SecurityTrackable
devise :database_authenticatable, :registerable, ...
end
Beskar runs in monitor-only mode by default. Review logs for 24-48 hours, then enable blocking:
# config/initializers/beskar.rb
Beskar.configure do |config|
config.waf = {
enabled: true,
monitor_only: false # Enable blocking
}
end
That's it! Beskar is now protecting your application.
View Full DocumentationBeskar is our contribution to the Rails community. Built by Humadroid as part of our commitment to open source security.
Built with ❤️ by the team at Humadroid
Using Beskar in production? We'd love to hear about it. Share your story on GitHub or reach out to us.