Snowflake Postgres 역할¶
Postgres에는 데이터베이스에 대한 연결을 관리하고 Postgres 서버에서 데이터베이스를 사용하기 위한 자체 역할 기반 인증이 있습니다. 이러한 역할은 Snowflake 역할과 별개입니다. Postgres 역할은 Snowflake Postgres 인스턴스 내의 데이터베이스, 테이블 및 기타 오브젝트에 액세스하고 관리하는 데 사용됩니다.
인스턴스를 생성하는 경우 Snowflake는 사용자가 사용할 수 있는 두 개의 특수 관리 역할을 자동으로 생성하며, 이에 대한 설명은 아래에 설명되어 있습니다.
Postgres 역할 관리에 대한 자세한 내용은 `Postgres 설명서<https://www.postgresql.org/docs/current/user-manag.html>`_를 참조하세요.
참고
Here and in many other places you will see the terms “role” and “user” used interchangeably in the context of Postgres user management. This is because a Postgres user is simply a role that has the Postgres role LOGIN attribute.
Snowflake Postgres 관리 역할¶
Snowflake Postgres automatically creates two managed roles at the same time that it creates your instance.
snowflake_admin 역할¶
snowflake_admin 역할은 Snowflake Postgres 인스턴스를 관리하는 데 사용되는 상위 권한의 Postgres 역할입니다. 이는 전체 Postgres 수퍼 사용자가 아니며, 일부 작업은 계속 제한되고 Snowflake에서 관리합니다. 그러나 다음을 포함하는 상승된 권한이 있습니다.
Postgres 역할 생성 및 관리.
데이터베이스 생성 및 관리.
Snowflake Postgres 인스턴스의 복제 관리.
행 수준 보안(RLS) 우회 정책(해당되는 경우).
또한, ``snowflake_admin``은 다음을 포함하여 모니터링 및 운영 기능을 부여하는 여러 Postgres 기본 제공 역할의 구성원입니다.
pg_signal_backendpg_use_reserved_connectionspg_create_subscriptionpg_read_all_settingspg_read_all_statspg_stat_scan_tablespg_monitorsnowflake_admin_group
application 역할¶
application 역할은 기본적으로 postgres 데이터베이스에서 오브젝트를 생성할 수 있는 권한을 가진, 수퍼 사용자가 아닌 역할입니다. 이 역할에 대한 새 권한 또는 소유권은 snowflake_admin 역할에서 부여해야 합니다.
Postgres 비밀번호 보안¶
Snowflake Postgres 관리 역할에 대한 자격 증명 다시 생성하기¶
Credentials for the snowflake_admin and application roles are generated when you create the instance and are displayed only once.
You can regenerate these credentials at any time, invalidating the existing credentials.
대시보드에서 인스턴스 snowflake_admin 역할의 자격 증명을 다시 생성할 수 있습니다.
탐색 메뉴에서 Postgres 를 선택합니다.
인스턴스를 선택합니다.
오른쪽 상단의 Manage 메뉴에서 :ui:`Regenerate credentials`를 선택합니다.
Acknowledge & continue 버튼을 클릭하여 작업을 확인합니다.
snowflake_admin또는application역할에 대한 자격 증명을 다시 생성하려면 RESET ACCESS 매개 변수와 함께 ALTER POSTGRES SERVICE 명령을 사용하면 됩니다.ALTER POSTGRES SERVICE [IF EXISTS] <name> RESET ACCESS FOR { 'snowflake_admin' | 'application' }
OWNERSHIP 또는 OPERATE 권한 필요
That command returns one row with the following column:
password
자격 증명 순환 예제
이름이
my_instance``인 Snowflake Postgres 인스턴스의 ``snowflake_admin역할에 대한 액세스 재설정ALTER POSTGRES SERVICE my_instance RESET ACCESS FOR 'snowflake_admin';
다른 Postgres 역할의 비밀번호 설정하기¶
Snowflake Postgres instances are configured for scram-sha-256 password authentication. When new
passwords are set, a scram-sha-256 hash is generated and stored by the server, but when the Postgres
log_statement parameter
is set to any value other than none, then CREATE ROLE and ALTER ROLE DDL commands are fully
logged to the Postgres server log. Therefore, you should make sure that clear-text passwords are not
logged as part of those statements.
CREATE ROLE 및 ALTER ROLE Postgres DDL 명령에 대한 문 로깅 비활성화하기¶
The simplest way to prevent clear-text passwords used in CREATE ROLE and ALTER ROLE DDL statements from appearing in the Postgres server
log is to disable the log_statement parameter for the transaction that you run them in. Do so by using SET LOCAL:
BEGIN;
SET LOCAL log_statement = 'none';
CREATE USER mynewrole PASSWORD 'mynewpassword';
COMMIT;
psql Postgres 클라이언트의 \password 명령 사용하기¶
The Postgres psql client program has a
password <https://www.postgresql.org/docs/current/app-psql.html>_ meta-command that can be used
to change the password for existing users. The \password meta-command precomputes the entered
password’s scram-sha-256 hash and uses that in the ALTER ROLE command that is sent to the server. To
use this method, first create new users without a password, and then set each user’s password with
the psql \password meta-command.
postgres=# CREATE ROLE mynewrole LOGIN;
CREATE ROLE
postgres=# \password mynewrole
Enter new password for user "mynewrole":
Enter it again:
If log_statement is set to a value other than 'none', then the log entry for ALTER ROLE
command sent by psql for the above \password command has the calculated scram-sha-256
hash instead of the actual clear-text password. You can combine this method with disabling
log_statement completely, as described above, to prevent even that hash from appearing in the
Postgres log:
postgres=# CREATE ROLE mynewrole LOGIN;
CREATE ROLE
postgres=# BEGIN;
BEGIN
postgres=# SET LOCAL log_statement = 'none';
SET
postgres=# \password mynewrole
Enter new password for user "mynewrole":
Enter it again:
postgres=# COMMIT;
COMMIT
역할 제한 사항¶
Snowflake Postgres에서 특정 작업은 서비스 자체를 위해 예약되며 ``snowflake_admin``을 포함하여 고객 관리 역할이 수행할 수 없습니다. 몇 가지 예는 다음과 같습니다.
Changing protected server-level configuration parameters that are managed by Snowflake.
Modifying or disabling core Snowflake-managed components or extensions.
Accessing or altering Snowflake-managed system databases or schemas used by the service.
Accessing or altering the Snowflake Postgres instance filesystem.
Direct modification of system catalog tables.
Creation of other superusers.
Creation of more than 64 roles in the instance.
Creation of more than 32 databases in the instance.
Execution of the ALTER SYSTEM command.
파일 시스템 액세스를 허용하는 Postgres의 `일반 파일 액세스 함수<https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-GENFILE>`_에 대한 액세스 권한.
The Snowflake Postgres extension may introduce further restrictions on what both snowflake_admin
and application can do within an instance. These extension-specific limitations may evolve over
time and will be documented with the corresponding extension behavior. If an operation is blocked,
you receive an error indicating that it isn’t permitted in Snowflake Postgres.