Skip to content

About

Beginner-friendly Python project for analyzing sample authentication logs and detecting repeated failed login attempts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Python Security Log Analyzer

About the Project

This is a beginner-friendly cybersecurity project built using Python. It analyzes sample security logs to identify failed login attempts, successful logins, and potentially suspicious login activity.

Features

  • Reads log entries from a text file.
  • Counts successful logins by IP address.
  • Counts failed login attempts by IP address.
  • Calculates total failed attempts and unique IP addresses.
  • Sorts failed login attempts from highest to lowest.
  • Generates security alerts based on configurable thresholds.
  • Identifies IP addresses with both failed and successful logins.
  • Warns when failed login attempts are followed by a successful login from the same IP.
  • Writes security report information to security_report.txt.
  • Uses append mode to preserve existing report content when adding new information.
  • Accurate IP address extraction from failed and successful logs.
  • Improved log parsing to prevent incorrect IP identificatio.

Technologies Used

  • Python
  • File Handling
  • Dictionaries and Loops
  • Conditional Statements
  • Sorting
  • Basic Log Analysis

Project Files

  • first_program.py — Main Python program.
  • security_logs.txt — Sample security log data.
  • security_report.txt — File used to store security report information.
  • README.md — Project documentation.

How to Run

  1. Install Python.

  2. Download or clone this repository.

  3. Open the project folder in VS Code.

  4. Run the following command in the terminal:

    python first_program.py

Disclaimer

This project uses sample log data for educational purposes. Security alerts indicate activity that may require investigation; they do not prove that an account has been compromised.

Learning Goals

This project helped me practise Python programming, file handling, dictionaries, loops, sorting, and basic cybersecurity log analysis.

About

Beginner-friendly Python project for analyzing sample authentication logs and detecting repeated failed login attempts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages