Skip to main content

KubeSleuth

Python Kubernetes License Status

KubeSleuth

KubeSleuth is a simple tool for auditing your Kubernetes clusters. It scans your cluster configurations for misconfigurations, best practices, security issues, and resource allocations, providing detailed reports to help you maintain a healthy and secure environment.

It's still in early development, so expect some rough edges.

Table of Contents

How to Use

  1. Clone the repository:

    git clone https://github.com/yourusername/kubesleuth.git
    cd kubesleuth
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run KubeSleuth:

    python3 kubesleuth.py --output markdown
    
  4. Optional arguments:

    • --kubeconfig: Path to the kubeconfig file (default: $HOME/.kube/config)
    • --context: Kubernetes context to use

    Example:

    python3 kubesleuth.py --output json --kubeconfig /path/to/kubeconfig --context my-context
    

Overview

KubeSleuth is designed to help you maintain a secure and well-configured Kubernetes cluster. It performs a variety of checks on your cluster, including:

  • RBAC (Role-Based Access Control): Ensures role bindings are secure and correctly configured.
  • Authentication: Checks for basic authentication and password policies.
  • Custom Roles: Identifies and reviews custom roles and cluster roles.
  • Network Policies: Ensures network policies are defined and enforced.
  • Namespace Isolation: Checks if resources are properly isolated by namespaces.
  • Privileged Containers: Detects containers running with privileged access.

By running KubeSleuth, you can quickly identify potential issues and areas for improvement in your cluster's configuration.

Installation

To install KubeSleuth, follow these steps:

  1. Clone the repository:

    git clone https://github.com/thevanguardian/kubesleuth.git
    cd kubesleuth
    
  2. Install dependencies:

    pip install -r requirements.txt
    

Features

  • RBAC Audit: Identifies insecure role bindings and missing subjects.
  • Authentication Checks: Verifies if basic authentication is enabled.
  • Custom Roles Review: Lists and reviews custom roles and cluster roles.
  • Network Policies Audit: Ensures network policies are present and enforced.
  • Namespace Isolation Checks: Detects resources placed in the default namespace.
  • Privileged Containers Detection: Finds containers running with privileged access.
  • Flexible Configuration: Supports custom kubeconfig files and contexts.

Configuration

KubeSleuth can be configured using command-line arguments:

  • --kubeconfig: Path to the kubeconfig file (default: $HOME/.kube/config)
  • --context: Kubernetes context to use
  • --output: Output format (json or markdown)

Example:

python3 kubesleuth.py --output markdown --kubeconfig /path/to/kubeconfig --context my-context

Contributing

Contributions are welcome! If you have suggestions for improvements or new features, please create an issue or submit a pull request.

Fork the repository Create your feature branch (git checkout -b feature/your-feature) Commit your changes (git commit -m 'Add your feature') Push to the branch (git push origin feature/your-feature) Open a pull request

License

This project is licensed under the GNU General Public License v3 (GPLv3).

Metadata

Release files for kubesleuth 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kubesleuth 0.1.1
File Size Uploaded Provenance
kubesleuth-0.1.1.tar.gz 21.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kubesleuth 0.1.1
File Interpreter ABI Platform
kubesleuth-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 46.9 kB

Release files / kubesleuth-0.1.1.tar.gz

Download URL kubesleuth-0.1.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dab7e90c9518142f19e66c5dfc3a24f1cdf4db50904cf5acfdcf096760771a30
BLAKE2b-256 checksum
How to use checksums
3f14bb4079c5e91d861aeaff439818153c56d79ffecfdb580f47b54a1829ed3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / kubesleuth-0.1.1-py3-none-any.whl

Download URL kubesleuth-0.1.1-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a00e76d842adde9d9836fef8119478334eba1c918f1e8bc382636aaf3d7a28fe
BLAKE2b-256 checksum
How to use checksums
e5953430d1b2446dfe63c2a4e2803e60c7855bcfa68221c581a44e5edd718039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Security for kubesleuth 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page