Gestor de Contraseñas basado en Laravel 8 + PHP 8 + MySQL 8. Self-hosted Password Manager based on Laravel 8 + PHP 8 + MySQL 8.

Overview

English

Gestor de Contraseñas

Esta aplicación permite una gestión completa de contraseñas para múltiples tipos de servicios (web, ssh, teléfonos, wifi, etc...).

Los datos de cada aplicación se guardan cifrados en base de datos.

El cifrado de estos datos se realiza usando el valor de APP_KEY como salt, con lo cual es importantísimo no regenerar esta key o perderás el acceso a todas las aplicaciones registradas.

Ni se te ocurra instalar este proyecto en un entorno sin protección HTTPS

Las características principales son:

  • Gestión de usuarios.
  • Gestión de equipos.
  • Acceso a aplicaciones limitadas por equipos.
  • Múltiples tipos de datos a registrar.
  • Cifrado en base de datos.
  • Autenticación por certificado y doble factor con Google Authenticator.
  • Usando certificado puedes desactivar el acceso por contraseña.
  • Dispone de un log que registra cada vez que algún usuario accede, consulta o actualiza una aplicación.
  • Permite aplicaciones privadas o compartidas.
  • Dispone de una extensión de chrome que se conecta vía API y accede directamenete a las credenciales de la web que estás visitando.

Este proyecto dispone de una extensión para Google Chrome que puedes descargar en https://github.com/eusonlito/Password-Manager-Chrome

Requisitos

  • Apache2 (nginx no soporta autenticación con certificado limitado a ciertas rutas)
  • PHP 8.0 o superior (php-curl php-imagick php-mbstring php-mysql php-redis php-zip)
  • MySQL 8.0
  • ImageMagick
  • Redis

Recuerda que si PHP 8 no es la versión por defecto del sistema, siempre debes usar el prefijo de versión, tanto para composer como para artisan, por ejemplo:

php8.0 /usr/local/bin/composer install --no-scripts --no-dev
php8.0 /usr/local/bin/composer install --no-dev --optimize-autoloader --classmap-authoritative --ansi
php8.0 artisan key:generate

Instalación

  1. Creamos la base de datos en MySQL.

  2. Clonamos el repositorio.

git clone https://github.com/eusonlito/Password-Manager.git
  1. Realizamos la primera instalación (recuerda que siempre usando el binario de PHP 8.0).
composer install --no-scripts --no-dev && composer install --no-dev --optimize-autoloader --classmap-authoritative --ansi
  1. Configuramos el fichero .env con los datos necesarios.
cp .env.example .env
  1. Generamos la clave de aplicación. Recuerda guardar una copia de seguridad de esta clave (.env > APP_KEY).
php artisan key:generate
  1. Regeneramos las cachés.
composer artisan-cache
  1. Lanzamos la migración inicial.
php artisan migrate
  1. Lanzamos el seeder.
php artisan db:seed --class=Database\\Seeders\\Database
  1. Configuramos la tarea cron para el usuario relacionado con el proyecto:
* * * * * cd /var/www/password.domain.com && php artisan schedule:run >> storage/logs/artisan-schedule-run.log 2>&1
  1. Creamos el usuario principal.
php artisan user:create [email protected] --name=Admin --password=StrongPassword2 --admin
  1. Configuramos el servidor para acceso web con DOCUMENT_ROOT en public.

  2. Profit!

Actualización

La actualización de la plataforma se puede realizar de manera sencilla con el comando composer deploy ejecutado por el usuario que gestiona ese projecto (normalmente www-data).

Este comando realiza las siguientes acciones:

"git checkout .",
"git pull",
"@composer env-version --ansi",
"@composer install --no-dev --optimize-autoloader --classmap-authoritative --ansi",
"@php artisan migrate --force --ansi",
"@php ./vendor/bin/php-cs-fixer fix --ansi --quiet",
"@php artisan maintenance:opcache:preload"

Autenticación con Certificado

Para poder realizar la autenticación con certificado debemos añadir la siguiente configuración en el VirtualHost de Apache:

<Location /user/profile/certificate>
        SSLVerifyClient require
        SSLVerifyDepth 2
        SSLOptions +StdEnvVars +ExportCertData +OptRenegotiate
</Location>

<Location /user/auth/certificate>
        SSLVerifyClient require
        SSLVerifyDepth 2
        SSLOptions +StdEnvVars +ExportCertData +OptRenegotiate
</Location>

SSLCACertificateFile /var/www/password.domain.com/resources/certificates/certificates.pem

La localización /user/profile/certificate permite obtener el identificador del certificado automáticamente desde el propio perfil de usuario, y /user/auth/certificate es la ruta de autenticación por certificado.

La opción de OptRenegotiate le permite a Apache renegociar la conexión de manera independiente por ruta, algo que nginx no soporta.

Comandos

Alta de usuario:

php artisan user:create {--email=} {--name=} {--password=} {--admin} {--readonly} {--teams=}

Actualización de usuario:

php artisan user:update {--id=} {--email=} {--name=} {--password=} {--certificate=} {--tfa_enabled=} {--admin=} {--readonly=} {--enabled=} {--teams=}

Ayuda!

Pues estaría guay un poco de ayuda para mejorar la traducción a inglés en resources/lang/en, así como el readme.en.md.

Capturas

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Password-Manager

Comments
  • HTTPS

    HTTPS

    Hi Eusonlito,

    Thank you first of all for all your assistance so far. I'm trying to run this on https using nginx proxy manager. As soon I enable the proxy route from http to https I'm getting CSS/JS issues. Can someone assist in this regard.

    Screenshot below:

    image

    opened by tunavis 33
  • Attaching files to any App type.

    Attaching files to any App type.

    Suggesting another greeatly missing feature : Attaching files to any App type.

    Originally posted by @wangee in https://github.com/eusonlito/Password-Manager/discussions/39#discussioncomment-4244161

    opened by eusonlito 10
  • 'http://vault.domain.com/user/auth' not found

    'http://vault.domain.com/user/auth' not found

    Hello,

    I strictly followed the install guide, and after browsing to 'http://vault.domain.com/user/auth', I got an error 404 "Not Found"

    I tried installing Password-Manager on Debian 11 and Alma 9 and same behaviour happens.

    .env file ` APP_NAME="Password Manager" APP_ENV=production APP_KEY=base64:SOME_KEY APP_DEBUG=false APP_URL=http://localhost

    APP_LOCALE=en

    ASSET_URL=http://localhost

    DEBUGBAR_ENABLED=false

    AUTH_CHECK_ALLOWED=4 AUTH_CHECK_TIME=60 AUTH_LOCK_TIME=60 AUTH_TFA_ENABLED=true AUTH_CERTIFICATE_ENABLED=true AUTH_API_SECRET_ENABLED=true

    AUTH_COUNTRY_ENABLED=false AUTH_COUNTRY_ALLOWED= AUTH_COUNTRY_IP_WHITELIST=127.0.0.1

    LOG_CHANNEL=stack LOG_REQUEST=false LOG_DATABASE=false LOG_MAIL=true LOG_CURL=false LOG_DAYS=30

    DB_CONNECTION=mysql DB_SOCKET=/var/lib/mysql/mysql.sock DB_DATABASE=passwordmanager DB_USERNAME=passwordmanager DB_PASSWORD=some_password DB_LOG=false

    MAIL_MAILER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME="${APP_NAME}" MAIL_CONTACT_ADDRESS=

    CACHE_ENABLED=true CACHE_DRIVER=file CACHE_PREFIX=password-manager-cache- CACHE_VERSION=1 CACHE_TTL=3600

    SESSION_DRIVER=cookie SESSION_LIFETIME=45000 SESSION_COOKIE=password-manager SESSION_ENCRYPT=false

    SENTRY_DSN= SENTRY_TRACES_SAMPLE_RATE=0.0 `

    apache.conf file ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost DocumentRoot "/home/Password-Manager/public" <Directory "/home/Password-Manager/public"> AllowOverride None Require all granted </Directory> <Directory "/home/Password-Manager/public"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf

    Any help would be appreciated.

    opened by wangee 9
  • Your Shifty Build

    Your Shifty Build

    This pull request includes changes from your build using the "Shift Workbench".

    Before merging, you need to:

    • Checkout the shift-build-1775 branch
    • Review all comments for additional changes
    • Thoroughly test your application

    Don't hesitate to send your feedback to [email protected] or share your :heart: for Shift on Twitter.

    opened by eusonlito 9
  • imposible usar 2FA

    imposible usar 2FA

    buenas

    desde hace unos días no puedo conectar usando 2FA, me dice siempre que el código es incorrecto

    he tenido que acceder a la base de datos y desactivarlo por query:

    update user set tfa_enabled = '0' where id = 1;

    ha estado funcionado bien durante meses, y desde hace unos días no funciona

    alguna explicación?

    opened by elnarvi 7
  • No login after enabeling 2fa

    No login after enabeling 2fa

    Hello,

    sorry to bother you :-( This seems not to be a hard issue (for me) but i don't understand it yet.

    I've done the following:

    1. create a new user as admin
    2. login as the new user
    3. scan the barcode in google autheticator as the new user
    4. enter the current password, check "enable 2fa" and click save
    5. the app asks for the google authenticator code
    6. the new user enters the code and the app says: Successfully updated settings".
    7. open the login page and try to login as the new user by providing username & password. That produces the following error:

    chrome_wMBqTGdGZz

    It seems that the reason for that behavior is, that after a user enables 2fa the field "password_enabled" in table "users" is set to "0". After i set that manually in the table to 1, a normal login with 2fa is possible again.

    Best wishes Sascha

    opened by madcoda9000 5
  • Error 404 route /user/auth

    Error 404 route /user/auth

    I noticed that in /var/www/html/ there is no routes folder

    I configured apache to access access /var/www/html/public

    i am acessing this route: http://passman.dchost.com.br/user/auth and show not found

    /var/log/apache/error.log

    [Mon Apr 04 16:47:28.762233 2022] [core:notice] [pid 13000] AH00094: Command line: '/usr/sbin/apache2'
    [Mon Apr 04 16:47:31.620450 2022] [proxy_fcgi:error] [pid 13003] [client 10.158.0.3:52647] AH01071: Got error 'PHP message: PHP Warning:  require(/var/www/html/public/../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/public/index.php on line 24PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/var/www/html/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/public/index.php:24\nStack trace:\n#0 {main}\n  thrown in /var/www/html/public/index.php on line 24'
    [Mon Apr 04 16:47:32.956765 2022] [proxy_fcgi:error] [pid 13006] [client 10.158.0.3:52648] AH01071: Got error 'PHP message: PHP Warning:  require(/var/www/html/public/../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/public/index.php on line 24PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/var/www/html/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/public/index.php:24\nStack trace:\n#0 {main}\n  thrown in /var/www/html/public/index.php on line 24'
    
    opened by HelloWar75 4
  • php artisan migrate problem

    php artisan migrate problem

    Hello,

    Currently trying to install password manager on a fresh ubuntu installation. I am now having a problem with the 'php artisan migrate' command:

    In Connection.php line 703:

    SQLSTATE[HY000] [1045] Access denied for user 'dbuser'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = and table_name = migrations and table_type = 'BASE TABLE')

    The SQL command is using the database name in the table_schema section. Also, it looks like the database is still empty (i do not know if that should have happened already)

    Many thanks for your help!

    opened by banaantje 3
  • 405 : Method not allowed

    405 : Method not allowed

    Hello,

    i've followed your installation guide. But when i open the startpage i get the following error:

    405 : Method Not Allowed

    chrome_zG3PX7sUP5

    In the log folder ist no file created, so i don't know how to see any logfile?

    I hope you can help here.

    Additional Info: when i enter the url including index.php, it's working. But my url is looking like that: https://mydomain.com/passmgr/index.php/user/profile (for ex.).

    I am sure that is not the way it shoul be...

    Additional Infos: I've enable debug mode and regenrated the cache. Now i can provide the following infomations:

    chrome_UVHqk0UKUp

    Best whishes Sascha

    opened by madcoda9000 2
  • App list page crashing Folder not writable

    App list page crashing Folder not writable

    When I open the applications list page, this error pops up. I reset permissions for the directory but still, it isn't working. any help?

    image

    Laravel-Packer issue maybe?

    opened by atiqsamtia 2
  • Error on composer install

    Error on composer install

    composer install --no-dev --optimize-autoloader --classmap-authoritative --ansi
    Generating optimized autoload files
    composer/package-versions-deprecated: Generating version class...
    composer/package-versions-deprecated: ...done generating version class
    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover --ansi
    
    In App.php line 27:
    
      Undefined constant "App\Providers\LC_MESSAGES"
    
    
    Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
    Script @composer dump-autoload handling the pre-install-cmd event returned with error code 1
    
    opened by eletrobox 2
  • REQ: Tag improvements

    REQ: Tag improvements

    • [x] Tags can be created but not deleted. It should be possible to delete tags, eventually with a check that allows the deletion only when they're not associated to any app.
    • [x] Tags list could be improved with a link to the Applications list filtered by the given tag.
    opened by andreacomplus 2
  • REQ: Hide application via flag / soft delete / trash / archive

    REQ: Hide application via flag / soft delete / trash / archive

    An option to hide an Application from users is useful in enterprise context.
    This could be accomplished via a flag (Hide/Unhide), via a soft-delete/trashbin feature, or via an Archive flag.

    opened by andreacomplus 6
  • Keepass Importer

    Keepass Importer

    Hello @eusonlito , i'm writing a Keepass XML importer as a command. I'm not a Laravel expert , so i have some trouble persisting the entities. For each item, i create an instance of the appropriate type. But then, I don't know how to persist these in the DB, maybe you can give me a clue ?

    foreach ($validEntries as $entry) {
        $className = '\\' . $entry->type;
        /** @var TypeAbstract $entity */
        $entity       = new $className($entry->getPayload());
        
        // .. and now ?
    }
    
    // $className can be, for example, \App\Domains\App\Service\Type\Format\SSH
    // $entry->getPayload() returns an array with the appropriate payload for each Type.
    
    opened by andreacomplus 1
  • Hi Eusonlito

    Hi Eusonlito

    I was wondering if it is possible to make some sort of upload function in for examble csv format to import passwords. It is quite intense to add current passwords manually in.

    opened by tunavis 1
  • Enterprise usecase

    Enterprise usecase

    Hi,

    Just gave your project a testdrive through #23 which is obviously quite easy to setup.

    While your password manager looks nice and seems well built in terms of security, it lacks some features that would made it outstanding:

    • Possibility to create new application types
    • Folders (or customers) that can be shared with teams as RO / RW, so every new entry in a folder is shared by default
    • password history
    • Session timeouts depending on accessing IP address (so one gets 30 days session at work and 30 min sessions at a customers place)
    • File storage in applications (sometimes you need to share a big CSV with hundreds of passwords for migrations... You won't create an application per entry for those use cases)
    • Import / Export (no password manager can be seen as a valuable option if it doesn't allow to export it's data)
    • Android / IOS app (actually an app that just wraps your frontend for easy access)

    I've tested multiple other solutions and none provided a certificate for authentication. Nice one, really appreciable.

    Thanks for developping your solution. Might become a great contender to Bitwarden, Psono, sysPass and others. Wish you well.

    opened by deajan 9
Owner
Lito
Lito
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
Laravel Vue SPA, Bulma themed. For demo login use `[email protected]` & `password` -

Laravel Enso Hit the ground running when building your new Laravel SPA project with boilerplate and extra functionality out of the box! click on the p

Laravel Enso 1k Jan 3, 2023
Ikoncoder is a self starter milestone web designing and deveflopment software developer.

Ikoncoder auth create auth to manage users, roles and permissions in laravel framework project Installation Require the package using composer: compos

ikoncoder 1 Oct 26, 2021
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

Dwij IT Solutions 1.5k Dec 29, 2022
Laravel SES complaints and bounces manager

Laravel SES complaints and bounces manager This package listens to AWS SNS notifications and stops sending mail to email addresses that have received

Aboubacar Ouattara 16 Dec 16, 2022
Registry manager for Laravel 5. An alternative for managing application configurations and settings.

Registry manager for Laravel 5. An alternative for managing application configurations and settings. Now with the magic of caching, so no more database calls to simply get site setting.

Daniel Stainback 22 Sep 28, 2020
A seamless django like admin panel setup for Laravel. Simple, non-cms table manager for admins.

Seamless Admin Panel A seamless Django-like admin panel setup for Laravel. Simple, non-cms table manager for admins. Installation steps Require the Pa

Advaith A J 15 Jan 2, 2023
PHP Laravel, MySQL and AIML chatbot engine and admin portal

Lemur Engine The Lemur Engine is a PHP/MySQL/AIML Chatbot. Written using the Laravel Framework. Demo You can demo the bot at the website: https://lemu

The Ramen Robot Disco Code 18 Nov 8, 2022
Automatically Create professional ready to use Laravel REST API for MySQL Database With Postman Docs and JWT Authentication

Laravel Simple Rest API Generator An API Boilerplate to create a ready-to-use REST API in seconds with Laravel 8.x Install with Composer $ curl -s

null 5 Mar 12, 2022
Sistema de Contas a Pagar e a Receber com PHP, MySQL e Bootstrap4

contas sistema-contas Demo: Aqui Sistema de Contas a Pagar e a Receber Feito com PHP, MySQL e Bootstrap 4 Usuário padrão: gustavo Senha padrão: 1234 É

Gustavo Alves da Silva 1 Jul 19, 2022
A simple CRUD built in PHP, Bootstrap and MySQL

✨ Notes-CRUD ✨ A simple CRUD built in PHP, Bootstrap and MySQL ?? Table of Contents Usage Contribute Screenshots ?? Usage Add the project to your envi

Bonnie Fave 7 Dec 7, 2022
Simple CRUD Product dengan PHP, MySQL & Bootstrap 5

Simple CRUD Product dengan PHP, MySQL & Bootstrap 5 Instalasi Pastikan sudah menginstall XAMPP atau sejenisnya Nyalakan service apache dan mysql buka

Gian Nurwana 1 Jan 3, 2022
Projeto de uma página de login desenvolvido totalmente em PHP (puro) - com conexão a banco de dados MySQL.

Projeto Página de Login com conexão à Banco de dados: Tecnologias Utilizadas: HTML(Em documento PHP); PHP (Sem a utilização de Frameworks - puro); MyS

null 1 Jun 15, 2022
A CRUD operation using php and Mysql database

This is a CRUD operation using php and Mysql database. In this when we add(CREATE) new user we need to submit add data in one form only in frontenf but in backend the data is storing in two different tables this is done using foreign key in Mysql.

Mohit Kumar 1 May 10, 2022
Html-Css-Php-Javascript-MySql dilleri ve bootstrap , sweetalert teknolojilerini kullanarak bir kütüphane sistemi yaptım.

Html-Css-Php-Javascript-MySql dilleri ve bootstrap , sweetalert teknolojilerini kullanarak bir kütüphane sistemi yaptım. Mysql de kütüphane adında bir

Merve 2 Sep 3, 2022
Criação de um mini sistema de registro, onde será aplicado o processo de adição, atualização e remoção de dados do banco de dados MySQL.

CRUD PHP MVC Criação de um mini sistema de registro, onde será aplicado o processo de adição, atualização e remoção de dados do banco de dados MySQL.

Ricardo Santos 1 Nov 15, 2021
A @laravel based RAD platform for back-office applications, admin/user panels, and dashboards.

For the full documentation, visit orchid.software. Introduction Orchid is a free Laravel package that abstracts standard business logic and allows cod

Laravel Orchid 3.4k Jan 1, 2023
Cipi is a Laravel based cloud server control panel that supports Digital Ocean, AWS, Vultr, Google Cloud, Linode, Azure and other VPS.

Cipi is a Laravel based cloud server control panel that supports Digital Ocean, AWS, Vultr, Google Cloud, Linode, Azure and other VPS. It comes with nginx, Mysql, multi PHP-FPM versions, multi users, Supervisor, Composer, npm, free Let's Encrypt certificates, Git deployment, backups, ffmpeg, fail2ban, Redis, API and with a simple graphical interface useful to manage Laravel, Codeigniter, Symfony, WordPress or other PHP applications. With Cipi you don’t need to be a Sys Admin to deploy and manage websites and PHP applications powered by cloud VPS.

Andrea Pollastri 907 Jan 8, 2023
EasyPanel is a beautiful, customizable and flexible admin panel based on Livewire for Laravel.

EasyPanel EasyPanel is a beautiful, customizable and flexible admin panel based on Livewire for Laravel. Features : Easy to install Multi Language RTL

Reza Amini 529 Dec 29, 2022