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.3.tar.gz (9.0 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.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: integrityguard_cli-1.0.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.7 Linux/6.17.9-arch1-1

File hashes

Hashes for integrityguard_cli-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b585841201cc11597de2742c9803116f7c0a0c8a9eb3bbb0af7effb312579a4f
MD5 ad676732e3827db4b9eb98236ee4cfc1
BLAKE2b-256 cc430ba14d50985a6fe921097c3447a8c5663267c245d71670b31e93330dc4a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: integrityguard_cli-1.0.3-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.7 Linux/6.17.9-arch1-1

File hashes

Hashes for integrityguard_cli-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a018d4b7db1efa1af46953ffb16f59649ebc15a93a310da5106ed122b7f652
MD5 423f2af4e6b60e5bd1cb4605d40ce477
BLAKE2b-256 a33c51f4a7b7b9f4115e463e12dd8b8f07f7520017dc397e95cd4b6af48d91aa

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