Laravel plugin to track your users logins and alert when a suspicious login occurs

Overview

Laravel Suspicious Logins

Laravel Suspicious Logins

Latest Version on Packagist Total Downloads License


Detect suspicious logins for standard Laravel authentication (base Laravel, Jetstream, etc) and notify a list of administrators and/or the user of the login automaticall via email.

Also provides (optional) integration with Advent Reputation for checking the reputation of IP addresses.

Install

via composer

$ composer require adventdevinc/laravel-suspicious-logins

Now you need to publish the database migration, and run migrate to apply it.

php artisan vendor:publish --provider="AdventDev\SuspiciousLogins\SuspiciousLoginsServiceProvider" --tag="migrations"
php artisan migrate

Publish the suspicious-logins.php config file and then edit it (config/suspicious-logins.php) to set your preferences.

php artisan vendor:publish --provider="AdventDev\SuspiciousLogins\SuspiciousLoginsServiceProvider" --tag="config"
php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider" --tag="config"

Use

Add \AdventDev\SuspiciousLogins\Listeners\AuthEventSubscriber::class, to the $subscribe variable in the app/Providers/EventServiceProvider.php file. If it does not exist just add the code below.

protected $subscribe = [
    \AdventDev\SuspiciousLogins\Listeners\AuthEventSubscriber::class,
];

Make sure to update config/suspicious-logins.php with your preferences.

Depending on your config file it will now email you, and/or your users when a suspicious login occurs on their account. By default that is a login from another city than they have recently logged in from.

Example Email

Example Email

Commands

Clear all login attempts in the database

php artisan suspicious-logins:clear

Test a GeoIP lookup and Advent Reputation response for {ip}

php artisan suspicious-logins:lookup {ip}

Prune any logins older than 30 days. We automatically add this to your daily schedule.

php artisan suspicious-logins:prune

Reputation Service

This package includes support for a central IP reputation service that uses OSINT and machine learning to predict suspicious logins.

By default, it is disabled but can be enabled by changing reputation.enabled to be true. Opting in to this service will check logins against the database by querying only the IP address logging in, and will submit actual logins and their status (failed or success) with the IP to the service to help train it.

Learn more at https://reputation.advent.dev.

NOTE: This is completely optional to use, if you disable it country, distance and city checking will still work!

Changelog

Please see CHANGELOG for more information on what has changed recently.

GeoIP Inclusion & Licensing

This package includes torann/laravel-geoip for GeoIP lookups which supports several options for GeoIP lookups.

The default allows free use for non-commercial purposes. You can publish the laravel-geoip config to change your default and use a different database. There are some that are free for commercial uses, or you can buy a key for ip-api from ~$13/mo.

The fees or licenses required are not related to this project, and it will work with virtually any IP lookup database you have.

License

Licensed under the MIT license. Please see License File for more information.

You might also like...
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

If you are beginner in WordPress plugin development or if you want to develop your own store product plugin you use this plugin
If you are beginner in WordPress plugin development or if you want to develop your own store product plugin you use this plugin

hirwa-products-plugin If you are beginner in WordPress plugin development or if you want to develop your own store product plugin you use this plugin

How to get cookies from users' browser and send the information to your email address and telegram bot

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework.
Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework.

Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework. This rep

Project with laravel 9 and livewire login and register + edit user profile
Project with laravel 9 and livewire login and register + edit user profile

Laravel 9 has just been released, and I decided to make a prototype project with Laravel 9 + livewire. In this project, full user registration with mobile number along with profile editing has been implemented. Project features are as follows

Laravel breeze is a PHP Laravel library that provides Authentication features such as Login page , Register, Reset Password and creating all Sessions Required.

About Laravel breeze To give you a head start building your new Laravel application, we are happy to offer authentication and application starter kits

A simple blog app where a user can signup , login, like a post , delete a post , edit a post. The app is built using laravel , tailwind css and postgres

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Laravel-api - crud and login/signup apis

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Customize Login and Register Page for User/Admin in Laravel v8

Customize Login and Register Page for User/Admin in Laravel v8

Owner
Advent Development
Advent Development
Advent Development
Allow your users to login with FaceID/TouchID

Allow your users to login with FaceID/TouchID Allow your users to register physical authentication devices (FaceID or TouchID on iPhones & macs, finge

Miguel Piedrafita 888 Dec 31, 2022
Laravel Users | A Laravel Users CRUD Management Package

A Users Management Package that includes all necessary routes, views, models, and controllers for a user management dashboard and associated pages for managing Laravels built in user scaffolding. Built for Laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.0, 7.0 and 8.0.

Jeremy Kenedy 393 Nov 28, 2022
A package to keep track of your pages & understand your audience

A clean way to track your pages & understand your user's behavior Installation You can install the package via composer: composer require coderflexx/l

Coderflex 178 Jan 4, 2023
This package allows you to easily track your laravel jobs!

Trackable Jobs For Laravel This package allows you to track your laravel jobs! Using this package, you can easily persist the output and the status of

Mateus Junges 220 Dec 25, 2022
A package to keep track of outgoing emails in your Laravel application.

Keep track of outgoing emails and associate sent emails with Eloquent models This package helps you to keep track of outgoing emails in your Laravel a

Stefan Zweifel 108 Nov 1, 2022
Laravel Seeable - Keep track of the date and time a user was last seen.

Laravel Seeable This package makes it easy to keep track of the date and time a user was last seen. Installation Install this package. composer requir

Zep Fietje 29 Dec 26, 2022
Laravel Impersonate is a plugin that allows you to authenticate as your users.

Laravel Impersonate Laravel Impersonate makes it easy to authenticate as your users. Add a simple trait to your user model and impersonate as one of y

404lab 1.6k Dec 30, 2022
Thunder is an advanced Laravel tool to track user consumption using Cashier's Metered Billing for Stripe. ⚡

⚡ Thunder Thunder is an advanced Laravel tool to track user consumption using Cashier's Metered Billing for Stripe. ⚡ ?? Supporting If you are using o

Renoki Co. 10 Nov 21, 2022
🕵🏻‍♂️  The easiest way to respect the "do not track" header in Laravel

trackable The easiest way to respect the "do not track" header in Laravel Installation composer require s360digital/trackable API Trackable will expos

s360 2 Oct 7, 2022
A Laravel package to help track user onboarding steps.

Onboard A Laravel package to help track user onboarding steps. Installation: Install the package via composer composer require calebporzio/onboard Reg

Caleb Porzio 440 Dec 17, 2022