+
This commit is contained in:
35
Ubuntu.md
35
Ubuntu.md
@ -1014,41 +1014,6 @@ WantedBy=multi-user.target
|
||||
****************************************************************************************************
|
||||
Для добавления TOTP авторизации в Postgresql выполнить:
|
||||
CREATE EXTENSION otp;
|
||||
****************************************************************************************************
|
||||
Проверка паролей Gcredcheck и многое другое для PostgreSQL https://www.postgresql.org/about/news/credcheck-v200-released-2654/
|
||||
Ищем есть ли:
|
||||
apt search credcheck
|
||||
Устанавливаем:
|
||||
sudo apt update
|
||||
sudo apt install postgresql-16-credcheck
|
||||
|
||||
Либо из репозиториев:
|
||||
sudo apt-get install postgresql-server-dev-16 # Для PostgreSQL 16
|
||||
sudo apt-get install build-essential
|
||||
git clone https://github.com/2ndQuadrant/credcheck.git
|
||||
cd credcheck
|
||||
make
|
||||
sudo make install
|
||||
|
||||
Теперь можно исползовать расширение на базе postgres:
|
||||
CREATE EXTENSION credcheck;
|
||||
|
||||
Теперь можно настроить расширение по https://tembo.io/docs/getting-started/postgres_guides/extensions/credcheck:
|
||||
-- Configure credential policies to enforce username and password standards and reload configuration files
|
||||
ALTER SYSTEM SET credcheck.username_min_length = 4;
|
||||
ALTER SYSTEM SET credcheck.password_min_length = 8;
|
||||
ALTER SYSTEM SET credcheck.password_min_special = 1;
|
||||
SELECT pg_reload_conf();
|
||||
|
||||
-- Attempt to create a user for a new park ranger, which does not meet the credential policies
|
||||
CREATE USER ranger_ WITH PASSWORD 'forest';
|
||||
ERROR: password length should match the configured credcheck.password_min_length
|
||||
|
||||
Для пароля установить:
|
||||
ALTER SYSTEM SET credcheck.password_expiration_days = 90;
|
||||
SELECT pg_reload_conf();
|
||||
|
||||
Для приложений нужно изменить политику паролей (менять не автоматически а по расписанию у администратора):
|
||||
|
||||
|
||||
****************************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user