-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth-password.html
More file actions
135 lines (135 loc) · 14.7 KB
/
auth-password.html
File metadata and controls
135 lines (135 loc) · 14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>20.5. パスワード認証</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="auth-trust.html" title="20.4. Trust認証" /><link rel="next" href="gssapi-auth.html" title="20.6. GSSAPI認証" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="client-authentication.html" title="第20章 クライアント認証">第20章 クライアント認証</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : auth-password.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="auth-trust.html" title="20.4. Trust認証">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="client-authentication.html" title="第20章 クライアント認証">上へ</a></td><td width="60%" align="center">20.5. パスワード認証</td><td width="20%" align="right"> <a accesskey="n" href="gssapi-auth.html" title="20.6. GSSAPI認証">次へ</a></td></tr></table><hr /></div><div class="sect1" id="AUTH-PASSWORD"><div class="titlepage"><div><div><h2 class="title" style="clear: both">20.5. パスワード認証 <a href="#AUTH-PASSWORD" class="id_link">#</a></h2></div></div></div><span class="original">
<title>Password Authentication</title>
</span><a id="id-1.6.7.13.2" class="indexterm"></a><a id="id-1.6.7.13.3" class="indexterm"></a><a id="id-1.6.7.13.4" class="indexterm"></a><a id="id-1.6.7.13.5" class="indexterm"></a><p>
<span class="original">
There are several password-based authentication methods. These methods
operate similarly but differ in how the users' passwords are stored on the
server and how the password provided by a client is sent across the
connection.
</span>
複数のパスワードに基づく認証方式があります。
これらは似たような方法で使用されますが、ユーザのパスワードをサーバに格納する方法と、クライアントによって提供されたパスワードが接続を通じて送信される方法が異なります。
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">scram-sha-256</code></span></dt><dd><p>
<span class="original">
The method <literal>scram-sha-256</literal> performs SCRAM-SHA-256
authentication, as described in
<ulink url="https://datatracker.ietf.org/doc/html/rfc7677">RFC 7677</ulink>. It
is a challenge-response scheme that prevents password sniffing on
untrusted connections and supports storing passwords on the server in a
cryptographically hashed form that is thought to be secure.
</span>
<code class="literal">scram-sha-256</code>方式は、<a class="ulink" href="https://datatracker.ietf.org/doc/html/rfc7677" target="_top">RFC 7677</a>に記述された方法でSCRAM-SHA-256認証を実行します。
これはチャレンジ/レスポンス方式のひとつであり、信頼できない接続におけるパスワードの漏洩を防ぎ、安全だと見なされる暗号学的ハッシュ形式でパスワードをサーバに格納するのを支援します。
</p><p>
<span class="original">
This is the most secure of the currently provided methods, but it is
not supported by older client libraries.
</span>
これは、現在実装されている認証方式の中では最も安全ですが、古いクライアントライブラリではサポートされていません。
</p></dd><dt><span class="term"><code class="literal">md5</code></span></dt><dd><p>
<span class="original">
The method <literal>md5</literal> uses a custom less secure challenge-response
mechanism. It prevents password sniffing and avoids storing passwords
on the server in plain text but provides no protection if an attacker
manages to steal the password hash from the server. Also, the MD5 hash
algorithm is nowadays no longer considered secure against determined
attacks.
</span>
<code class="literal">md5</code>方式は、独自のより安全性の低いチャレンジ/レスポンス機構を使います。
パスワードの漏洩を防ぎ、平文でパスワードをサーバに格納するのを避けることができますが、攻撃者がサーバからパスワードハッシュを盗むことを防ぐことはできません。
また、MD5ハッシュアルゴリズムは、昨今では強い意志をもった攻撃に対して安全ではないと考えられています。
</p><p>
<span class="original">
To ease transition from the <literal>md5</literal> method to the newer
SCRAM method, if <literal>md5</literal> is specified as a method
in <filename>pg_hba.conf</filename> but the user's password on the
server is encrypted for SCRAM (see below), then SCRAM-based
authentication will automatically be chosen instead.
</span>
<code class="literal">md5</code>方式からより新しいSCRAM方式への移行を容易にするため、<code class="filename">pg_hba.conf</code>で<code class="literal">md5</code>が指定されているにもかかわらず、パスワードがSCRAM(下記参照)で暗号化されている場合には、自動的にSCRAMに基づく認証が代わりに使用されます。
</p><div class="warning"><h3 class="title">警告</h3><p>
<span class="original">
Support for MD5-encrypted passwords is deprecated and will be removed
in a future release of <productname>PostgreSQL</productname>. Refer to
the text below for details about migrating to another password type.
</span>
MD5で暗号化されたパスワードの使用は非推奨となり、将来の<span class="productname">PostgreSQL</span>のリリースで削除されます。
詳細については、以下のテキストを参照して、別のパスワードタイプへの移行を行ってください。
</p></div></dd><dt><span class="term"><code class="literal">password</code></span></dt><dd><p>
<span class="original">
The method <literal>password</literal> sends the password in clear-text and is
therefore vulnerable to password <quote>sniffing</quote> attacks. It should
always be avoided if possible. If the connection is protected by SSL
encryption then <literal>password</literal> can be used safely, though.
(Though SSL certificate authentication might be a better choice if one
is depending on using SSL).
</span>
<code class="literal">password</code>方式は、パスワードを平文で送信するので、パスワード<span class="quote">「<span class="quote">盗聴</span>」</span>攻撃に対して脆弱です。
可能ならば、常に避けるようにしてください。
しかしながら、接続がSSL暗号で保護されていれば、<code class="literal">password</code>は安全に使用できます。
(もっとも、SSLの利用に依存するのであれば、SSL証明書認証がより良い選択かもしれません。)
</p></dd></dl></div><p>
<span class="original">
<productname>PostgreSQL</productname> database passwords are
separate from operating system user passwords. The password for
each database user is stored in the <literal>pg_authid</literal> system
catalog. Passwords can be managed with the SQL commands
<xref linkend="sql-createrole"/> and
<xref linkend="sql-alterrole"/>,
e.g., <userinput>CREATE ROLE foo WITH LOGIN PASSWORD 'secret'</userinput>,
or the <application>psql</application>
command <literal>\password</literal>.
If no password has been set up for a user, the stored password
is null and password authentication will always fail for that user.
</span>
<span class="productname">PostgreSQL</span>データベースパスワードはオペレーティングシステムのユーザパスワードとも別のものです。
各データベースユーザのパスワードは<code class="literal">pg_authid</code>システムカタログテーブルの中に格納されます。
<strong class="userinput"><code>CREATE ROLE foo WITH LOGIN PASSWORD 'secret'</code></strong>のように、パスワードはSQLコマンド<a class="xref" href="sql-createrole.html" title="CREATE ROLE"><span class="refentrytitle">CREATE ROLE</span></a>と<a class="xref" href="sql-alterrole.html" title="ALTER ROLE"><span class="refentrytitle">ALTER ROLE</span></a>を使って管理できます。
あるいは、<span class="application">psql</span>の<code class="literal">\password</code>コマンドでも管理できます。
もしユーザに対してパスワードが設定されない場合、格納されるパスワードはNULLとなり、そのユーザのパスワード認証は常に失敗します。
</p><p>
<span class="original">
The availability of the different password-based authentication methods
depends on how a user's password on the server is encrypted (or hashed,
more accurately). This is controlled by the configuration
parameter <xref linkend="guc-password-encryption"/> at the time the
password is set. If a password was encrypted using
the <literal>scram-sha-256</literal> setting, then it can be used for the
authentication methods <literal>scram-sha-256</literal>
and <literal>password</literal> (but password transmission will be in
plain text in the latter case). The authentication method
specification <literal>md5</literal> will automatically switch to using
the <literal>scram-sha-256</literal> method in this case, as explained
above, so it will also work. If a password was encrypted using
the <literal>md5</literal> setting, then it can be used only for
the <literal>md5</literal> and <literal>password</literal> authentication
method specifications (again, with the password transmitted in plain text
in the latter case). (Previous PostgreSQL releases supported storing the
password on the server in plain text. This is no longer possible.) To
check the currently stored password hashes, see the system
catalog <literal>pg_authid</literal>.
</span>
パスワードにもとづく異なる認証方式が利用可能かどうかは、サーバ上でユーザのパスワードがどのように暗号化(正確には、ハッシュ化)されるのかに依存します。
これは、パスワードが設定されたときに、設定パラメータの<a class="xref" href="runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION">password_encryption</a>によって制御されます。
パスワードが<code class="literal">scram-sha-256</code>によって暗号化されていれば、認証方式の<code class="literal">scram-sha-256</code>と<code class="literal">password</code>で利用できます。
(ただし、後者の場合にはパスワードの転送が平文になります。)
前述のように、ここで認証方式の<code class="literal">md5</code>を指定すると、<code class="literal">scram-sha-256</code>方式に自動的に切り替わります。
パスワードが<code class="literal">md5</code>で暗号化されていると、<code class="literal">md5</code>と<code class="literal">password</code>でのみ使用されます。
(ここでも、後者の場合にはパスワードが平文で転送されます。)
(以前のPostgreSQLのリリースでは、パスワードを平文で格納することをサポートしていました。
これはもはや不可能です。)
現在格納されているパスワードのハッシュを確認するには、システムカタログ<code class="literal">pg_authid</code>を参照してください。
</p><p>
<span class="original">
To upgrade an existing installation from <literal>md5</literal>
to <literal>scram-sha-256</literal>, after having ensured that all client
libraries in use are new enough to support SCRAM,
set <literal>password_encryption = 'scram-sha-256'</literal>
in <filename>postgresql.conf</filename>, make all users set new passwords,
and change the authentication method specifications
in <filename>pg_hba.conf</filename> to <literal>scram-sha-256</literal>.
</span>
既存のインストールにおいて、<code class="literal">md5</code>から<code class="literal">scram-sha-256</code>にアップグレードするには、すべてのクライアントライブラリが十分新しく、SCRAMをサポートをできることを確認してから、<code class="filename">postgresql.conf</code>で<code class="literal">password_encryption = 'scram-sha-256'</code>を設定し、すべてのユーザに新しいパスワードを設定してもらい、<code class="filename">pg_hba.conf</code>の認証方式を<code class="literal">scram-sha-256</code>に変更してください。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="auth-trust.html" title="20.4. Trust認証">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="client-authentication.html" title="第20章 クライアント認証">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="gssapi-auth.html" title="20.6. GSSAPI認証">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">20.4. Trust認証 </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 20.6. GSSAPI認証</td></tr></table></div></body></html>