Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Mountable status page for your Rails application, to check (DB, Cache, Sidekiq, Redis, etc.).
Mounting this gem will add a '/status' route to your application, which can be used for health monitoring the application and its various services. The method will return an appropriate HTTP status as well as a JSON array representing the state of each service.
# Gemfile
gem 'status-page'
Then run:
$ bundle install
# config/routes.rb
mount StatusPage::Engine, at: '/'
The following services are currently supported:
By default, only the database check is enabled. You can add more service services by explicitly enabling them via an initializer:
StatusPage.configure do
# Cache check status result 10 seconds
self.interval = 10
# Use service
self.use :database
self.use :cache
self.use :redis
# Custom redis url
self.use :redis, url: 'redis://you-redis-host:3306/1'
self.use :sidekiq
end
It's also possible to add custom health check services suited for your needs (of course, it's highly appreciated and encouraged if you'd contribute useful services to the project).
In order to add a custom service, you'd need to:
StatusPage::Services::Base
class and its check!
method (a check is considered as failed if it raises an exception):class CustomService < StatusPage::Services::Base
def check!
raise 'Oh oh!'
end
end
StatusPage.configure do
self.add_custom_service(CustomProvider)
end
If you need to perform any additional error handling (for example, for additional error reporting), you can configure a custom error callback:
StatusPage.configure do
self.error_callback = proc do |e|
logger.error "Health check failed with: #{e.message}"
Raven.capture_exception(e)
end
end
By default, the /status
endpoint is not authenticated and is available to any user. You can authenticate using HTTP Basic Auth by providing authentication credentials:
StatusPage.configure do
self.basic_auth_credentials = {
username: 'SECRET_NAME',
password: 'Shhhhh!!!'
}
end
The MIT License (MIT)
FAQs
Unknown package
We found that status-page demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.