Skip to main content

No project description provided

Project description

Security Scanner CLI Tool

A Command Line Interface (CLI) tool for scanning and analyzing mobile APK files, Docker images and code repository for security vulnerabilities using various security tools.

Table of Contents

Installation

:exclamation: Note: Make sure you have Docker installed and running.

Install from Source Code

  1. Clone the repository:

    git clone https://github.com/briskdust/ingy-cli.git
    cd ingy-cli
    
  2. Install the required Python packages:

    poetry install
    
  3. Run the CLI tool:

    python -m ingysec.ingy
    

Install using Pip

  1. Install the tool from PyPI:

    pip install ingysec
    
  2. Run the CLI tool:

    ingysec
    

Usage

This CLI tool supports multiple commands grouped under mobile, docker, and code.

Mobile Commands

Scan and analyze APK files for security vulnerabilities using MobSF.

Initialization

This command will initialize the MobSF docker container and run it on port 3000. It will also provide the API key for the MobSF server.

ingysec mobile mobsf_init

Configuration

Set the MOBSF_APIKEY environment variable with your MobSF API key:

export MOBSF_APIKEY=your_mobsf_api_key

Scan APK Files

ingysec mobile mobsf --apikey YOUR_API_KEY --pdf output.pdf path/to/file1.apk path/to/file2.apk
  • --apikey: API key for MobSF authentication. Or set the MOBSF_APIKEY environment variable.
  • --pdf: Optional. If specified, generates a PDF report, otherwise the results will be displayed in terminal as a table.

Docker Commands

Run Trivy scan for a Docker image.

Installation

This command will install Trivy on your system. Only run it once, and it only works on Linux(Debian/Ubuntu) systems.

ingysec docker trivy_install

Scan Docker Images

ingysec docker trivy --name IMAGE_NAME --html template.html
  • --name: Name or ID of the Docker image to scan.
  • --html: Optional. Path to an HTML template file for generating the report. If not present, the results will be displayed in the terminal as a table.

Code Commands

Run code inspection and scanning commands to detect security vulnerabilities in Python code.

Bandit

Run Bandit to check Python code for security vulnerabilities.

ingysec code bandit

Prompts the user to enter the path to the Python code. Recursively scans all Python files in the specified path using the Bandit configuration file bandit.yaml. Sets the severity level to high (-ll) and reports all discovered security issues.

Shell Escape

Scan code for potential shell escape vulnerabilities.

ingysec code shell-escape REPONAME --seckey PATH

The user needs to enter the path to the repository which can also be the URL of a remote repository and utilize the --seckey flag to specify the path to the SSH private key for cloning the repository. Supports shell expansion, such as ~ to the full home directory path and verifies that the provided path is a directory.

Extending the Tool

Adding New Commands

To implement a new command, create a new command group in ingysec/ingy.py:

@main.group()
def example_command():
    """This is an example command group."""
    pass

Then, add a new command to the group:

@example_command.command()
def new_command():
    """This is a new command."""
    pass

Adding New Functions

For the purpose of maintainability and clean code, add new functions to the utils.py file.

Extending shell_escape_finder.py

To extend the script to support more languages, you need to update two main components:

  1. File Extensions: Add the file extensions of the new languages to the FILE_EXTENSIONS list.
  2. Patterns: Add regex patterns to identify potential shell escape vulnerabilities in the PATTERNS dictionary.

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

ingysec-0.3.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

ingysec-0.3.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file ingysec-0.3.0.tar.gz.

File metadata

  • Download URL: ingysec-0.3.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for ingysec-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e44aee57c8ffce282dc27509b037b612768577e5bd07de66cc251e0c0e7a24c4
MD5 6e83347cf5f96818662cb847fa7df3c6
BLAKE2b-256 bf5e3a58997468c4a538e9de769fccdc59d643bfbfae86285c977d3b71a34908

See more details on using hashes here.

File details

Details for the file ingysec-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ingysec-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for ingysec-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36c2c2b6fa457ec601fd33659f79b9d6116b3ecbe649c23e3c897bf20b258ea3
MD5 6855434ead8829f09d953b81038e9d0c
BLAKE2b-256 c427cf8a6c1a78f6961f80e29087e41eda157f22ba0f6a64801051194d4602ad

See more details on using hashes here.

Supported by

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