Skip to main content

Tool to detect Privilege Escalation and Data Tampering risks in Docker environments

Project description

IntegrityGuard: Docker Security Assessment Tool

PyPI version License: MIT

IntegrityGuard is a security tool designed to detect Privilege Escalation and Data Tampering risks in multi-user Docker environments.

It implements the methodology described in the research "Segurança em Docker Multiusuário: Avaliação de Riscos", focusing on the dangers of exposing the Docker socket (/var/run/docker.sock) to non-privileged users.

🚀 Key Features

  • Vulnerability Diagnosis: Checks if the current user is improperly added to the docker group or has write access to the socket.
  • Safe Proof-of-Concept (PoC): Simulates a "Host Breakout" attack by attempting to mount the host filesystem and write a harmless test file, proving the viability of Data Tampering without damaging the system.
  • IEVI Score Calculation: Quantifies the risk using the Integrity Violation Exposure Index (IEVI), a metric derived from the DREAD threat modeling framework.
  • SonarQube-like Reporting: Generates visual HTML dashboards or JSON output for CI/CD integration.

📦 Installation

Install the tool directly from PyPI:

pip install integrityguard-cli

🛠️ Usage

Once installed, the integrity-guard command is available globally.

1. Standard Analysis (Console Output)

Runs the diagnosis and prints the findings and IEVI score to the terminal.

integrity-guard

2. Generate HTML Dashboard

Creates a visual report (integrity_scan_report.html) containing the risk score, DREAD breakdown, and detailed findings.

integrity-guard --html

3. JSON Output (DevOps/CI)

Outputs the raw data in JSON format for parsing by other tools.

integrity-guard --json

📊 How It Works (Methodology)

The tool operates in three phases:

  1. Diagnosis: It inspects user permissions and group memberships. Adding a user to the docker group is equivalent to granting them root access.
  2. Simulation: It attempts to spin up a container with -v /:/mnt/host to verify if the host filesystem is writable.
  3. Scoring: It calculates the IEVI (Integrity Violation Exposure Index).
    • Score > 40: Indicates a Critical risk where an attacker can modify /etc/passwd or other sensitive files.
    • Score < 40: Indicates a Tolerable risk (e.g., Rootless Docker).

🛡️ Mitigation

If IntegrityGuard reports a critical vulnerability, the recommended mitigation is to migrate to Docker Rootless mode or remove the user from the docker group.

📝 License

This project is licensed under the MIT License.

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

integrityguard_cli-1.0.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

integrityguard_cli-1.0.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file integrityguard_cli-1.0.2.tar.gz.

File metadata

  • Download URL: integrityguard_cli-1.0.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for integrityguard_cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 13d90e29ee89adaa2c99c6d30e7f7490d04d8cf5c5008091973df1145c9d28cd
MD5 20e70a85238e02b84882ed67bedf4f84
BLAKE2b-256 e69a9583a4bf22a60e08ec13f427c012178c6c1def9cd82a64a494b70ec2e8f2

See more details on using hashes here.

File details

Details for the file integrityguard_cli-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: integrityguard_cli-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for integrityguard_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04d63833e20f6788d38b4e769117cb7faadd51498840b0d7f792bdfe5480eb28
MD5 72a9016f9391f584513bc697a7ff2e48
BLAKE2b-256 1ea461ceaf637b1cf9ada3d440230bae63565e188d5467ec2ca4182094a58f72

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