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.1.3.tar.gz (11.5 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.1.3-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: integrityguard_cli-1.1.3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/6.18.2-arch2-1

File hashes

Hashes for integrityguard_cli-1.1.3.tar.gz
Algorithm Hash digest
SHA256 9ded2c5d73ba7939df46813869ec2621b0364c14c7da989bc3a19a9294cf668e
MD5 9e32f19b8e78c100b76c5639eba7b0b6
BLAKE2b-256 d32113aedee98ada9c900428f558d20951d064a5ea8a3828232d056ad096df11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: integrityguard_cli-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/6.18.2-arch2-1

File hashes

Hashes for integrityguard_cli-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1d0f2ff82aa71ca4b4c756cd29b817087c5c9a5f112c4264ae27ce0f7ad7e8af
MD5 f0816b99d2260f057dd380ff25097e79
BLAKE2b-256 8430d59af2176d7d979ff43f1e0a85afe7d797d7340089eee946ad8a59013d46

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