5.3. プロパティーレルム
プロパティーレルムはプロパティーファイルを使用して、ユーザーおよびグループを定義します。
-
users.propertiesには Data Grid ユーザーの認証情報が含まれます。パスワードは、DIGEST-MD5およびDIGEST認証メカニズムを使用して事前署名できます。 -
groups.propertiesは、ユーザーをロールおよびパーミッションに関連付けます。
users.properties
myuser=a_password
user2=another_password
groups.properties
myuser=supervisor,reader,writer
user2=supervisor
プロパティーレルム設定
XML
<server xmlns="urn:infinispan:server:15.0">
<security>
<security-realms>
<security-realm name="default">
<!-- groups-attribute configures the "groups.properties" file to contain security authorization roles. -->
<properties-realm groups-attribute="Roles">
<user-properties path="users.properties"
relative-to="infinispan.server.config.path"
plain-text="true"/>
<group-properties path="groups.properties"
relative-to="infinispan.server.config.path"/>
</properties-realm>
</security-realm>
</security-realms>
</security>
</server>
JSON
{
"server": {
"security": {
"security-realms": [{
"name": "default",
"properties-realm": {
"groups-attribute": "Roles",
"user-properties": {
"digest-realm-name": "default",
"path": "users.properties",
"relative-to": "infinispan.server.config.path",
"plain-text": true
},
"group-properties": {
"path": "groups.properties",
"relative-to": "infinispan.server.config.path"
}
}
}]
}
}
}
YAML
server:
security:
securityRealms:
- name: "default"
propertiesRealm:
# groupsAttribute configures the "groups.properties" file
# to contain security authorization roles.
groupsAttribute: "Roles"
userProperties:
digestRealmName: "default"
path: "users.properties"
relative-to: 'infinispan.server.config.path'
plainText: "true"
groupProperties:
path: "groups.properties"
relative-to: 'infinispan.server.config.path'
5.3.1. プロパティーレルムファイル構造 リンクのコピーリンクがクリップボードにコピーされました!
ユーザープロパティーファイルは次のように構造化されています。
users.properties 構造
#$REALM_NAME=default$
#$ALGORITHM=encrypted$
#Wed Jul 31 08:32:08 CEST 2024
admin=algorithm-1\:hash-1;algorithm-2\:hash-2;...
最初の 3 行は、レルムの名前 ($REALM_NAME)、パスワードが clear 形式または encrypted 形式で保存されるかどうか ($ALGORITHM)、および最終更新のタイムスタンプを定義する特別なコメントです。
ユーザー認証情報は従来のキー/値形式で保存されます。キーはユーザー名に対応し、値はパスワードに対応します。暗号化されたパスワードは、セミコロンで区切られたアルゴリズム/ハッシュのペアとして表され、ハッシュは Base64 でエンコードされます。
認証情報はレルム名を使用して暗号化されます。レルムの名前を変更するには、すべてのパスワードを再暗号化する必要があります。Data Grid CLI を使用して、ファイルに正しいセキュリティーレルム名を入力します。