-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e43eb04
commit 019ea11
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Split security model in pgagroal | ||
|
||
This tutorial will show you how to split the security model of pgagroal such that | ||
applications will use a different password than the one used against PostgreSQL. | ||
|
||
## Preface | ||
|
||
This tutorial assumes that you have an installation of PostgreSQL 10+ and pgagroal. | ||
|
||
See [Install pgagroal](https://github.com/pgagroal/pgagroal/blob/main/doc/tutorial/01_install.md) | ||
for more detail. | ||
|
||
## Create pgagroal_frontend_users.conf | ||
|
||
Create the configuration file | ||
|
||
``` | ||
pgagroal-admin -f pgagroal_frontend_users.conf -U myuser -P apppass add-user | ||
``` | ||
|
||
You need a password mapping for each user defined in the `pgagroal_users.conf` configuration file. | ||
|
||
(`pgagroal` user) | ||
|
||
## Restart pgagroal | ||
|
||
Stop pgagroal and start it again with | ||
|
||
``` | ||
pgagroal-cli -c pgagroal.conf stop | ||
pgagroal -c pgagroal.conf -a pgagroal_hba.conf -u pgagroal_users.conf -F pgagroal_frontend_users.conf | ||
``` | ||
|
||
(`pgagroal` user) | ||
|
||
## Connect to PostgreSQL | ||
|
||
You can now use the "application password" to access the PostgreSQL instance | ||
|
||
``` | ||
psql -h localhost -p 2345 -U myuser mydb | ||
``` | ||
|
||
using `apppass` as the password. pgagroal will use the `mypass` password against PostgreSQL. | ||
|
||
Using this split security model allow you to use other passwords than used on the PostgreSQL | ||
instance. | ||
|
||
(`pgagroal` user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters