Skip to main content

AI-Powered Docker Security Analyzer

Project description

GitHub Repo stars License: MIT Docs PRs Downloads


🧊 The next generation AI-Powered Docker Security Analyzer 📦

GitHub 🔹 Docker Hub 🔹 PyPI Hub 🔹 LinkedIn 🔹 Twitter / X


🔐 What is DockSec?

DockSec is an Open Source, AI-powered Docker Security Analyzer that helps developers and DevSecOps teams detect, prioritize, and remediate security issues in Dockerfiles and container images.

It combines trusted static analysis tools like Trivy, Hadolint, and Docker Bench with a powerful AI engine (LangChain + LLM) to provide actionable security insights, remediation suggestions, and human-readable reports.

Unlike traditional scanners that overwhelm users with raw output, DockSec focuses on developer-first security — delivering context-aware recommendations, risk scoring, and clean reports in HTML, PDF, or JSON formats. It seamlessly integrates into CI/CD pipelines or can be run locally via a simple CLI.

❓Why DockSec?

Most Docker security tools do one thing well — scan. But they often fall short where it matters most: prioritizing what’s important, explaining why it matters, and guiding you toward a fix.

Here’s why DockSec is different:

Smart + Actionable: Combines traditional scanners with AI-driven remediation suggestions using LangChain + LLM.

🚀 Developer-First: Clear, prioritized output. Designed to work in CI/CD, pre-commit hooks, and developer environments.

📊 Security Score & Reports: Assigns a score to your Dockerfile/image and generates human-readable reports (HTML, PDF, JSON).

🔧 Flexible CLI: Run full scans, AI-only analysis, or scan-only modes with simple commands.

🧠 Shift Left, Intelligently: Helps developers fix security issues early — without friction or false positives.

🧩 Architecture Diagram

Here’s how DockSec works behind the scenes:

DockSec Architecture

DockSec Architecture

  • Input: Dockerfile + optional Docker image
  • Static Analysis: Trivy, Hadolint, Docker Bench
  • AI Layer: LangChain + OpenAI for intelligent insights
  • Output: Security reports (PDF, HTML, JSON, CSV)
  • Modes: CLI, CI/CD, AI-only, scan-only

🚀 Installation

You can install DockSec via PyPI

pip install docksec

OR You can install DockSec using Python virtual environment

python -m venv env

# On Windows
env\Scripts\activate

# On macOS/Linux
source env/bin/activate

pip install -e .

This will install the DockSec using setup.py from local files.

To completely use the AI scanning of DockSec, you have to setup the OPENAI-API-KEY

  • 🔹 PowerShell (Windows): $env:OPENAI_API_KEY = "your-secret-key"

  • 🔹 Command Prompt (CMD on Windows): set OPENAI_API_KEY=your-secret-key

  • 🔹 Bash/Zsh (Linux/macOS): export OPENAI_API_KEY="your-secret-key"

  • 🔹 Or create a .env file with: OPENAI_API_KEY=your-secret-key

The following dependencies will be automatically installed:

  • langchain
  • langchain-openai
  • python-dotenv
  • pandas
  • tqdm
  • colorama
  • rich
  • fpdf
  • setuptools

Congratulations, you can now explore and install all our available packages! 🎉

📝 How to Use DockSec (CLI)

After installation, you can use DockSec with a simple command:

docksec path\to\Dockerfile

Options:

  • -i, --image: Specify Docker image ID for scanning (optional)
  • -o, --output: Specify output file for the report (default: security_report.txt)
  • --ai-only: Run only AI-based recommendations
  • --scan-only: Run only Dockerfile/image scanning

Examples:

# Basic analysis
docksec path\to\Dockerfile

# Analyze both Dockerfile and a specific image
docksec path\to\Dockerfile -i myimage:latest

# Only run AI recommendations
docksec path\to\Dockerfile --ai-only

# Only scan for vulnerabilities with custom output file
docksec path\to\Dockerfile --scan-only -o custom_report.txt
  • Legacy Usage

You can still use the original commands:

# For AI-based recommendations
python .\main.py "path\to\your\dockerfile"

# For scanning both Dockerfile and images
python docker_scanner.py <dockerfile_path> <image_name> [severity]
# Example: python docker_scanner.py .\Dockerfile myapp:latest CRITICAL,HIGH
  • External Tools Setup

To check the Dockerfile as well as images for vulnerabilities, you need to setup Trivy and hadolint:

python .\setup_external_tools.py

For manual installation, refer to [Trivy] (https://trivy.dev/v0.18.3/installation/) and [hadolint] (https://github.com/hadolint/hadolint?tab=readme-ov-file#install) documentation.

🎬 Demo Video

DockSec Demo Video - Coming Soon

☝️ Need Help or Want to Provide Feedback?

If you encounter any problems, we will be happy to support you wherever we can. For bugs, issues or feature requests feel free to open an issue. We are happy to assist you with anything related to the project.

🤝 How to Contribute to DockSec

Your feedback is invaluable to us as we continue to improve DockSec. If you'd like to contribute, consider trying out the beta version, reporting any issues, and sharing your suggestions. See the contributing guide for detailed instructions on how you can contribute.

👾 Activity

DockSec Activity

📘 License

The DockSec is licensed under the MIT license. For more information check the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docksec-0.0.5.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docksec-0.0.5-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file docksec-0.0.5.tar.gz.

File metadata

  • Download URL: docksec-0.0.5.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for docksec-0.0.5.tar.gz
Algorithm Hash digest
SHA256 828a6590741b2d1ea2c6a353e14222ab08db6d2d975a3d383bcd0e50fb26b145
MD5 5ca4a553d049f7073eb67a3f1e65e583
BLAKE2b-256 6fee78511d557d3ee2cc9c2b353c975721a073c1cbbb13e89e638e185fc79e8c

See more details on using hashes here.

File details

Details for the file docksec-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: docksec-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for docksec-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 88f412afc9af10b280c8bf5c06be430c2c342d2a816c23a68c8ae880a61f81b8
MD5 8cdc57c4ec214c8db7c112b6ac4c66d6
BLAKE2b-256 92bfdfa5165df80aedf27dd94fd412cb30cbf94e00e6c4bd628d594a439bb5b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page