Skip to main content

Python fileagent to accompany Snort in a container

Project description

FileAgent

About

This repository is part of the SAND5G project, which aims to enhance security in 5G networks. FileAgent is a tool designed to facilitate the management of Snort rules in a containerized environment.

5G -and beyond- networks provide a strong foundation for EU’s digital transformation and are becoming one of the Union’s key assets to compete in the global market.

Securing 5G networks and the services running on top of them requires high quality technical security solutions and also strong collaboration at the operational level.

https://sand5g-project.eu

SAND5G

Overview

FileAgent is a Python-based application designed to accompany Snort in a containerized environment. It provides a FastAPI-based interface for uploading and managing custom rules for Snort. The application supports JSON and plain text file uploads, translates the content into Snort-compatible rules, and appends them to a rules file while ensuring backups and avoiding duplicates.

Features

  • Upload JSON or plain text files containing IP addresses or URLs.
  • Automatically translate uploaded content into Snort-compatible rules.
  • Append rules to a custom rules file (mock.local.rules by default).
  • Backup the rules file before appending new rules.
  • Avoid duplicate rule entries.

Requirements

  • Python 3.11 or higher
  • Dependencies listed in pyproject.toml:
    • fastapi
    • uvicorn
    • requests
    • python-multipart

Installation

Clone from github

  1. Clone the repository:

    git clone https://github.com/ISSG-Projects/FileAgentSAND5G.git
    cd FileAgentSAND5G
    
  2. Create a virtual environment

    python -m venv venv
    
  3. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
      
    • On macOS/Linux:

      source venv/bin/activate
      
  4. Install the required dependencies:

    pip install .
    

pip install from github

pip install git+ssh://git@github.com/ISSG-Projects/FileAgentSAND5G.git

API Endpoints

  • POST /upload: Upload a JSON or plain text file containing IP addresses or URLs. The content is translated into Snort rules and appended to the rules file.

Documentation

The project documentation is generated using pdoc3. To generate and view the documentation:

Open the generated HTML files in the docs directory.

More information at docs/pdoc/README.md.

Additionally the FastAPI framework provides an interactive API documentation at http://localhost:8000/docs when the application is running. This allows you to test the API endpoints directly from your browser.

Future Implementations

Add support for additional file formats (e.g., XML, CSV). Implement rule validation against a predefined schema. Add logging for better traceability. Create a web-based dashboard for managing rules. Integrate with external threat intelligence feeds.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes

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

fileagent-0.2.7.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

fileagent-0.2.7-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file fileagent-0.2.7.tar.gz.

File metadata

  • Download URL: fileagent-0.2.7.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fileagent-0.2.7.tar.gz
Algorithm Hash digest
SHA256 9fbe56d0c5a5f3aecfd36a78fe51798b4cf1153be8ddccb21d14cccd8d9df970
MD5 2a10788dad73adbcdf659401eb4b8e78
BLAKE2b-256 18ed846d49cf832dcffb9aa55da6b9299e76774e42e6369c63dd4f4bee4a4422

See more details on using hashes here.

File details

Details for the file fileagent-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: fileagent-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fileagent-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 754ac91ab2b6cd6056518ffaa4598f7a9befdd88d767e2367db94d6db8d60532
MD5 dbe2bdf12c82b3e66a406568cbca0c59
BLAKE2b-256 bc0a17072f0e3a90e856e089dc0ecae26be82233eacb5faa44d760f45e3e6e5c

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