Download the PHP package neo3k/laravel-kms-encryption without Composer
On this page you can find all versions of the php package neo3k/laravel-kms-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neo3k/laravel-kms-encryption
More information about neo3k/laravel-kms-encryption
Files in neo3k/laravel-kms-encryption
Package laravel-kms-encryption
Short Description Replace Laravel's built-in encryption with an encryption based on AWS KMS
License MIT
Homepage https://github.com/neo3k/laravel-aws-kms
Informations about the package laravel-kms-encryption
Laravel Kms Encryption (Laravel 9.x Ready)
Forked from https://github.com/smknstd/laravel-kms-encryption
Introduction
This package replaces Laravel's built-in encryption with an encryption based on AWS KMS.
Two major features provided by kms are:
- ability to automatically rotate key (annually) without deleting the previous ones
- you don’t have access to the actual key, which means you can’t leak it
This package has been based on this blogpost
Installation
This package requires Laravel 9.x or higher.
You can install the package via composer:
Next you should publish the config file, and setup your values :
If you want to use IAM Roles that are already setup, aws sdk will automatically use them by default. Otherwise, you should setup credentials to the proper aws user allowed to "use" the given kms key, by adding a kms section in your config/services.php
file :
Now everytime you'll encrypt something it will use the provided kms key. It includes all fields using eloquent's encrypted casting. If you have previously encrypted data, be aware that you won't be able to decrypt it.
Cookies encryption
If you use laravel's middleware EncryptCookies
, it can't work with kms. To let the middleware continue working with laravel's encrypter you need to edit App\Http\kernel.php
. Just replace the existing middleware with :
Testing
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-kms-encryption with dependencies
aws/aws-sdk-php Version ^3.191
illuminate/contracts Version ^9.12
spatie/laravel-package-tools Version ^1.4.3