Skip to content

Comprehensive Automated Server Log Analysis and Reporting Script with OpenAI

Notifications You must be signed in to change notification settings

LynxGeekNYC/ChatGPT-Security-Analysis-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ChatGPT-Security-Analysis-Tool

Comprehensive Automated Server Log Analysis and Reporting Script with OpenAI

This Python script offers a fully automated solution for server log collection, cybersecurity analysis, and PDF reporting. It securely connects to your Linux-based server via SSH using the paramiko library to collect critical logs, including MariaDB logs, authentication logs, system logs, firewall logs, and web server logs (Apache and Nginx). The collected logs are then sent to OpenAI’s GPT-4 model for deep analysis, uncovering potential threats like brute-force attacks, SQL injections, and unauthorized access attempts.

The script uses FPDF to generate a professional PDF report summarizing the findings and delivers it via SMTP email to designated recipients. With cron job integration, this script ensures daily log analysis and reporting, helping administrators stay proactive about their server security posture.

Key Features

SSH-based Log Collection:

  • Collects logs from multiple services like authentication, MariaDB, system events, firewall, and web server logs (Apache and Nginx).

OpenAI GPT-4 Analysis:

  • Leverages AI-powered analysis to detect anomalies, malicious activities, and security incidents.

PDF Report Generation:

  • Summarizes analysis results into a professional PDF report using the FPDF library.

Automated Email Delivery:

  • Sends the PDF report via SMTP email to administrators, ensuring seamless report delivery.

MariaDB Integration:

  • Monitors MariaDB logs for suspicious queries, authentication failures, and SQL injections.

Daily Automation with Cron Jobs:

  • Integrates with cron jobs to automate the entire process for daily log analysis.

Security Best Practices:

  • Supports SSH key authentication and environment variable storage for sensitive credentials.

I put a lot of work into these scripts so please donate if you can. Even $1 helps!

PayPal: [email protected]

CashApp / Venmo: LynxGeekNYC

BitCoin: bc1q8sthd96c7chhq5kr3u80xrxs26jna9d8c0mjh7

About

Comprehensive Automated Server Log Analysis and Reporting Script with OpenAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages