Giter VIP home page Giter VIP logo

log-anonymizer's Introduction

Log Anonymizer

Log Anonymizer is a Python-based tool for anonymizing sensitive information in log files. It helps maintaining privacy by masking sensitive data such as IP addresses, user IDs, endpoints, timestamps and so on. At the moment, the tool only supports HTTP, SSH and HA Proxy log formats. The Log Anonymizer can be used for other log formats, but complete anonymization might not occur, since the script might not be able to correctly identify sensitive information.

Features

  • Anonymize IP Addresses: Replaces original IP addresses with randomized ones, maintaining the same format.
  • Anonymize User IDs: Replaces user IDs with randomly generated names.
  • Anonymize Endpoints: Replaces original endpoints with their anonymized version, maintaining the same length.
  • Anonymize Timestamps (optional): Replaces timestamps with their anonymized version while keeping the same structure.
  • Selective Anonymization: Provides options to selectively anonymize only IPs, endpoints, user IDs, or timestamps (or any combination of them).
  • Lookup Table Creation: Generates lookup tables mapping anonymized data back to the original data for reference.

Requirements

  • Python 3.x
  • namesgenerator external library

Installation

1 - Clone the repository or download the log_anonymizer.py file.

2 - Ensure Python 3.x is installed on your system.

3- Install the namesgenerator library by running pip install namesgenerator in your terminal.

Usage

python log_anonymizer.py <input_directory> <output_directory> [options]

Arguments

  • input_directory: Directory containing the log files to be anonymized.
  • output_directory: Directory where the anonymized files and lookup tables will be stored.

Options

  • --ip: Anonymize only IP addresses.
  • --endpoint: Anonymize only endpoints.
  • --user: Anonymize only user IDs.
  • --timestamps: Anonymize only timestamps.

Output

  • Anonymized log files will be saved in the specified output directory.
  • A lookup table for each file will be generated in the same output directory, mapping anonymized data to original data.

Example

python log_anonymizer.py /path/to/logs /path/to/output --ip --user

This command will anonymize IP addresses and user IDs in log files located in /path/to/logs and save the anonymized logs to /path/to/output.

log-anonymizer's People

Contributors

vladarama avatar

Stargazers

Oswaldo Baptista Vicente Junior avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.