Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
django-simple-secrets
Advanced tools
A Django integration for AWS Secrets Manager with caching and lazy loading support
A Django integration for AWS Secrets Manager with caching and lazy loading support.
django-simple-secrets
provides a clean and efficient way to access AWS Secrets Manager from a Django applications. It features built-in caching to reduce API calls and supports lazy loading of secrets through Django's SimpleLazyObject
.
⚠️ Important Note: This module is not thread-safe. The caching mechanism uses a simple dictionary that is not protected against concurrent access. If you need thread-safety, consider implementing your own synchronization mechanism or disabling caching with use_cache=False
.
pip install django-simple-secrets
Note: This package requires boto3
, which must be installed separately:
pip install boto3
Ensure your AWS credentials are properly configured either through:
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
)from django_secrets import get_secret
# Get an entire secret
database_config = get_secret('prod/database')
# Get a specific key from a secret
database_password = get_secret('prod/database', key='password')
from django_secrets import get_secret_lazy
# Secret won't be fetched until actually accessed
database_config = get_secret_lazy('prod/database')
from django_secrets import clear_cache
# Clear a specific secret from cache
clear_cache('prod/database')
# Clear entire cache
clear_cache()
# Bypass cache for a single request
fresh_secret = get_secret('prod/database', use_cache=False)
The module raises standard boto3 exceptions:
try:
secret = get_secret('prod/database')
except ClientError as e:
# Handle AWS-specific errors
pass
except KeyError as e:
# Handle missing key errors
pass
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A Django integration for AWS Secrets Manager with caching and lazy loading support
We found that django-simple-secrets 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.