Skip to main content

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

Metadata

Release files for fileagent 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fileagent 0.2.8
File Size Uploaded
fileagent-0.2.8.tar.gz 21.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fileagent 0.2.8
File Interpreter ABI Platform
fileagent-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 43.6 kB

Release files / fileagent-0.2.8.tar.gz

Download URL fileagent-0.2.8.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
54dc5abb8380890a868f3312f96d9971b9e48ca632439665fb61f6ea82247326
BLAKE2b-256 checksum
How to use checksums
a2b583d699b54281feb0230c4530249e6b8228fe46a4fc6a39084352d7d3bc56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / fileagent-0.2.8-py3-none-any.whl

Download URL fileagent-0.2.8-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
384326f94b48cdcae47a1c47ec266577ff585b890ee760911d4b3ff66312768a
BLAKE2b-256 checksum
How to use checksums
5e5693a10d3e4702d925446e90e30b0c521ef0d638c75adf670ea8283d1be883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page