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.
django-easy-health-check
Advanced tools
A Django package that provides an easy-to-use health check url path
Django-easy-health-check is a Django package that provides an easy-to-use middleware to allow health check.
Django's ALLOWED_HOSTS setting often would prevent health check from being completed successfully in production. A common method of getting around this involves making a request to fetch ip address about the instance itself and adding it to the ALLOWED_HOSTS. This approach often varies depending on deployment platform/environment.
This package provides a simple middleware that allows requests to a specified health check path to be made without checking against ALLOWED_HOSTS setting. This negates the need to modify ALLOWED_HOSTS setting in runtime, and is therefore platform-agnostic.
Install using pip:
pip install django-easy-health-check
Or, install from source:
pip install git+https://github.com/oscarychen/django-easy-health-check.git
Add the health check middleware to Django settings before django.middleware.common.CommonMiddleware
:
MIDDLEWARE = [
...,
'easy_health_check.middleware.HealthCheckMiddleware',
'django.middleware.common.CommonMiddleware',
...
]
By default, the health check url will be available at "example.com/healthcheck/".
You can customize and overwrite the default settings by including the following in your project's settings.py:
DJANGO_EASY_HEALTH_CHECK = {
"PATH": "/healthcheck/",
"RETURN_STATUS_CODE": 200,
"RETURN_BYTE_DATA": "",
"RETURN_HEADERS": None
}
In production, you may also want to set the following Django settings:
ALLOWED_HOSTS = ["example.com"]
SECURE_SSL_REDIRECT = True
SECURE_REDIRECT_EXEMPT = [r'^healthcheck/$']
FAQs
A Django package that provides an easy-to-use health check url path
We found that django-easy-health-check 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.