Lock-And-Key
Lock & Key is a comprehensive cloud security scanner that analyzes access policies and resource-based policies across multiple cloud providers to identify security vulnerabilities, excessive permissions, and compliance issues.
📖 Full Documentation | 🚀 Quick Start | 💻 Installation
Repository Information
- Name: lock-and-key
- Description: Comprehensive cloud security scanner for IAM and resource-based policies
- Homepage: https://thewintershadow.github.io/Lock-And-Key/
- Topics: security, cloud, aws, azure, gcp, iam, scanner, cybersecurity, policies
- License: MIT
Documentation
The complete documentation is available at: https://thewintershadow.github.io/Lock-And-Key/
Quick Links
- 📖 Documentation
- 🚀 Installation Guide
- 💻 API Reference
- 🛠️ Development Guide
- 🐛 Report Issues
- 📦 PyPI Package
Repository Features
- ✅ Issues enabled
- ✅ GitHub Pages enabled
- ✅ Security scanning enabled
- ✅ Automated documentation deployment
- ✅ Comprehensive test suite
- ✅ CI/CD pipeline
Features
- Multi-Cloud Support: AWS (fully implemented), Azure (in progress), GCP (in progress)
- Comprehensive Policy Analysis: Scans IAM policies and resource-based policies across all supported services
- Security Vulnerability Detection: Identifies privilege escalation risks, wildcard permissions, and administrative access
- Interactive CLI: User-friendly command-line interface with rich formatting and progress indicators
- Detailed Reporting: Generates JSON reports with actionable findings and recommendations
- Least Privilege Analysis: Highlights violations of the principle of least privilege
Supported AWS Services
- IAM: Customer managed policies, roles, users
- S3: Bucket policies
- DynamoDB: Table resource policies
- Lambda: Function resource policies
- SNS: Topic policies
- SQS: Queue policies
- Glue: Data catalog and database policies
Quick Start
Installation
# Basic installation
pip install lock-and-key
# With enhanced AWS support (better IDE experience)
pip install lock-and-key[aws]
# For developers (includes testing and linting tools)
pip install lock-and-key[dev]
# Everything included
pip install lock-and-key[all]
Run Your First Scan
# Interactive mode (recommended for first-time users)
lock-and-key interactive
# Direct AWS scan with profile
lock-and-key scan --provider AWS --profile my-profile
Need help with setup? Check out the Installation Guide for detailed instructions.
Usage
Interactive Mode
Run the interactive scanner to select providers and enter credentials:
lock-and-key interactive
Direct Scan Mode
Scan a specific provider with credentials:
# AWS with profile
lock-and-key scan --provider AWS --profile my-profile
# AWS with access keys
lock-and-key scan --provider AWS --access-key YOUR_KEY --secret-key YOUR_SECRET --region us-east-1
# Azure (in progress)
lock-and-key scan --provider Azure --client-id YOUR_ID --secret YOUR_SECRET --tenant-id YOUR_TENANT
# GCP (in progress)
lock-and-key scan --provider GCP --creds-path /path/to/service-account.json
Options
--output-dir: Specify output directory for reports (default:./reports)--provider: Choose cloud provider (AWS, Azure, GCP)- Various credential options for each provider
Security Checks
Lock & Key identifies the following security issues:
- Administrative Permissions: Policies with
*:*actions - Wildcard Resources: Policies allowing access to all resources (
*) - Privilege Escalation: IAM permissions that could lead to privilege escalation
- Overly Broad Access: Resource policies with excessive permissions
- Cross-Account Access: Policies allowing external account access
Report Format
Reports are generated in JSON format with the following structure:
{
"provider": "AWS",
"account_id": "123456789012",
"issues_found": 15,
"least_privilege_violations": 8,
"high_risk_permissions": 3,
"summary": "Scanned IAM and all resource policies. Found 15 security issues.",
"findings": [
{
"resource_name": "MyPolicy",
"resource_id": "arn:aws:iam::123456789012:policy/MyPolicy",
"issue_type": "Excessive Permissions",
"severity": "High",
"description": "Administrative permissions (*:*) detected",
"recommendation": "Replace wildcard permissions with specific actions"
}
]
}
Documentation
- Installation Guide - Detailed installation instructions and AWS setup
- Usage Guide - Command-line examples and output interpretation
- API Reference - Complete API documentation
- Development Guide - Contributing and development setup
Cloud Provider Status
- ✅ AWS: Fully implemented with comprehensive policy analysis
- 🚧 Azure: In progress
- 🚧 GCP: In progress
Development
For development setup, testing, and contributing guidelines, see the Development Guide.
Quick Development Setup
git clone https://github.com/TheWinterShadow/lock-and-key.git
cd lock-and-key
hatch env create
hatch test
License
lock-and-key is distributed under the terms of the MIT license.
Metadata
Release files for lock-and-key 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lock_and_key-1.0.4.tar.gz | 15.8 kB | Without provenance | Details for lock_and_key-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lock_and_key-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for lock_and_key-1.0.4-py3-none-any.whl |
Total release size: 37.8 kB
Release files / lock_and_key-1.0.4.tar.gz
| Download URL | lock_and_key-1.0.4.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c805a97fa4c32343ad2d710afccd75d7135286fe1c041cfc16f6b2f9ac316e76
|
|
BLAKE2b-256 checksum How to use checksums |
ae1ec3966ae7af92d18f4a40119bd610527b5933af859e7b9b4ab0040f929954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / lock_and_key-1.0.4-py3-none-any.whl
| Download URL | lock_and_key-1.0.4-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06cf3fa160888a9439a40f3c6f311b238541215d73858d4723e86c7535c75b17
|
|
BLAKE2b-256 checksum How to use checksums |
09724fb13f652054b8e71cf4a6a6b799a9539d8f0449752025dd2eb206c2904e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for lock-and-key 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.