Skip to main content

Une bibliothèque pour générer des logs

Project description

LogCrafter

pip version Build Status

LogCrafter is a Python library designed to generate both normal and suspicious log files. It is built to simulate real-world environments by creating diverse log files, which can be particularly useful for training AI in intrusion detection systems.

Features

  • Generation of authentication logs (auth.log)
  • Generation of syslog logs (syslog.log)
  • Generation of failed authentication logs (failed_auth.log)
  • Generation of logs for privilege escalation, SQL injection, phishing, and DDoS attacks
  • Configuration via a YAML file to specify the type of log, output file, and number of logs to generate

Installation

You can install LogCrafter directly from PyPI (coming soon) or by cloning this repository.

pip install logcrafter

Usage

Configuration

Create a YAML configuration file, such as logs_config.yml, to specify the types of logs you want to generate:

logs:
  - type: "auth"
    output_file: "./logs/auth.log"
    log_count: 1000

  - type: "failed_auth"
    output_file: "./logs/failed_auth.log"
    log_count: 100

Generating Logs

Use the LogCrafter CLI to generate logs based on your configuration file:

python -m app.main config/logs_config.yml

Example Log Configuration

Below is an example of a more comprehensive YAML configuration file to showcase the different types of logs that LogCrafter can generate:

logs:
  - type: "auth"
    output_file: "./logs/auth.log"
    log_count: 1000

  - type: "syslog"
    output_file: "./logs/syslog.log"
    log_count: 1000

  - type: "failed_auth"
    output_file: "./logs/failed_auth.log"
    log_count: 500

  - type: "privilege_escalation"
    output_file: "./logs/privilege_escalation.log"
    log_count: 200

  - type: "sql_injection"
    output_file: "./logs/sql_injection.log"
    log_count: 300

  - type: "phishing"
    output_file: "./logs/phishing.log"
    log_count: 150

  - type: "ddos"
    output_file: "./logs/ddos.log"
    log_count: 400

Running Tests

To ensure that everything is working correctly, run the included unit tests:

python3 -m unittest discover -s tests -p 'test_*.py'

Contributing

Contributions are welcome! If you'd like to contribute to LogCrafter, please follow these steps:

  • Fork the repository.
  • Create a new branch (git checkout -b feature-branch-name).
  • Make your changes and commit them (git commit -m 'Add new feature'). Push to the branch (git push origin feature-branch-name).
  • Open a pull request.

Troubleshooting

  • No logs generated: Ensure your YAML configuration file is correctly formatted and that paths are correct.
  • Missing dependencies: Install required dependencies using pip install -r requirements.txt.
  • Permission issues: Run the script with appropriate permissions if writing to system directories.

License

LogCrafter is open-source software 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

log_crafter-1.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

log_crafter-1.0.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file log_crafter-1.0.1.tar.gz.

File metadata

  • Download URL: log_crafter-1.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for log_crafter-1.0.1.tar.gz
Algorithm Hash digest
SHA256 908c679e8eabab41fbb553f07d839f045ab187496ec16b4a3eed0394f72c583c
MD5 96946d15c77e2e6071eb9e01ef6f3faa
BLAKE2b-256 bd71435fbb1884d50fb441b604d5b181fc268ace1e73bbbee1fdafe5286638b6

See more details on using hashes here.

File details

Details for the file log_crafter-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: log_crafter-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for log_crafter-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7315976de1c7a60efcdb0f0bd16e30420c38bbcb66a13bc335d25e6c0f9f6bcb
MD5 a0ce110e4ca26cbc4b10714a58ef18b2
BLAKE2b-256 e8ffeb9899b498732b9b810caa6e67a8c38e1322c07af9179e876bcbbfd9c8b7

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