https://github.com/petermcd/ssh-login-attempts-logger
Simple script to log login attempts to AWS
https://github.com/petermcd/ssh-login-attempts-logger
Last synced: 1 day ago
JSON representation
Simple script to log login attempts to AWS
- Host: GitHub
- URL: https://github.com/petermcd/ssh-login-attempts-logger
- Owner: petermcd
- License: agpl-3.0
- Created: 2019-01-29T00:42:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T20:52:35.000Z (over 5 years ago)
- Last Synced: 2026-01-22T05:57:39.898Z (5 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSH Login Attempts Logger
A simple script used to log login attempts generated from the
[SSH PAM Login Logger](https://github.com/PeterMcD/ssh-pam-login-logger) script.
The script writes to an AWS API, reading credential and URL details from config.py (currently not checked in).
```
# Unique URL for the AWS API.
URL = ""
# AWS API key.
API_Key = ""
# Path and filename for the database.
DatabasePath = "/var/log/login-attempts.db"
```
For python to have the ability to read the database /var/log requires write access for guest.
If you are uncomfortable giving such access on this folder the database will need to be moved.
Remember to update the pam module.
## Installation
```python
cd ~
git clone https://github.com/PeterMcD/SSH-Login-Attempts-Logger.git
cd SSH-Login-Attempts-Logger
nano config.py
```
Add the following contents for AWS. You will need to create a dynamoDB instance. lambda instance and lastly an API. A tutorial for this will come later.
```python
# Unique URL for the AWS API.
URL = ""
# AWS API key.
API_Key = ""
# Path and filename for the database.
DatabasePath = "/var/log/login-attempts.db"
```
run
```python
sudo crontab -e
```
and add the following to the (remembering to change the path to match the user)
```python
*/5 * * * * python3 /home/pi/ssh-login-attempts-logger/src/LoginExtractor.py
```