Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple ruby gem for adding read only maintenance mode to your Rails / Rack applications.
When read only mode is enabled, all non GET / HEAD requests will be rejected with a 503 Service Unavailable response. Additionally the 503 response will be given in case a GET request would raise a PG::ReadOnlySqlTransaction
error.
Add the line to your application's Gemfile:
gem "read_only_mode"
Read only mode is enabled via environment variables. There are two options, either:
Set READ_ONLY_MODE=true
Or...
Set PGOPTIONS="-c default_transaction_read_only=on"
(or any other string containing default_transaction_read_only=on
).
The PGOPTIONS
approach is recommended for applications using Postgres as this will prevent any write queries from being executed.
Rails applications will automatically use the middleware via a Railtie. For other Rack applications, you can add the middleware manually:
use ReadOnlyMode::Middleware if ReadOnlyMode.enabled?
You can customize the HTML / JSON responses returned when read only mode is enabled via some simple setters:
ReadOnlyMode.html_response = File.read("path/to/your/read_only.html")
ReadOnlyMode.json_response = { error: "Maintenance in progress" }.to_json
FAQs
Unknown package
We found that read-only-mode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.