ポリシーの XML ファイルを amadmin.dtd に基づいて作成します。このファイルは次のディレクトリにあります。
AccessManager-base /SUNWam/dtd.
ポリシーの XML ファイルの例を次に示します。この例には、デフォルトの対象および条件の値がすべて含まれます。これらの値の定義については、「ポリシータイプ」を参照してください。
<Policy name="bigpolicy" referralPolicy="false" active="true" > <Rule name="rule1"> <ServiceName name="iPlanetAMWebAgentService" /> <ResourceName name="http://thehost.thedomain.com:80/*.html" /> <AttributeValuePair> <Attribute name="POST" /> <Value>allow</Value> </AttributeValuePair> <AttributeValuePair> <Attribute name="GET" /> <Value>allow</Value> </AttributeValuePair> </Rule> <Subjects name="subjects" description="desccription"> <Subject name="webservicescleint" type="WebServicesClients" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/><Value>CN=sun-unix, OU=SUN Java System Access Manager, O=Sun, C=US</Value> </AttributeValuePair> </Subject> <Subject name="amrole" type="IdentityServerRoles" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/><Value> cn=organization admin role,o=realm1,dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> <Subject name="au" type="AuthenticatedUsers" includeType="inclusive"> </Subject> <Subject name="ldaporganization" type="Organization" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/> <Value>dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> <Subject name="ldapuser" type="LDAPUsers" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/> <Value>uid=amAdmin,ou=People,dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> <Subject name="ldaprole" type="LDAPRoles" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/> <Value>cn=Organization Admin Role,o=realm1,dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> <Subject name="ldapgroup" type="LDAPGroups" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/> <Value>cn=g1,ou=Groups,dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> <Subject name="amidentitysubject" type="AMIdentitySubject" includeType="inclusive"> <AttributeValuePair><Attribute name="Values"/> <Value>id=amAdmin,ou=user,dc=red,dc=iplanet,dc=com</Value> </AttributeValuePair> </Subject> </Subjects> <Conditions name="conditions" description="description"> <Condition name="ldapfilter" type="LDAPFilterCondition"> <AttributeValuePair><Attribute name="ldapFilter"/> <Value>dept=finance</Value> </AttributeValuePair> </Condition> <Condition name="authlevelge-nonrealmqualified" type="AuthLevelCondition"> <AttributeValuePair><Attribute name="AuthLevel"/> <Value>1</Value> </AttributeValuePair> </Condition> <Condition name="authlevelle-realmqaulfied" type="LEAuthLevelCondition"> <AttributeValuePair><Attribute name="AuthLevel"/> <Value>/:2</Value> </AttributeValuePair> </Condition> <Condition name="sessionproperties" type="SessionPropertyCondition"> <AttributeValuePair><Attribute name="valueCaseInsensitive"/> <Value>true</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="a"/><Value>10</Value> <Value>20</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="b"/><Value>15</Value> <Value>25</Value> </AttributeValuePair> </Condition> <Condition name="activesessiontime" type="SessionCondition"> <AttributeValuePair><Attribute name="TerminateSession"/> <Value>session_condition_false_value</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="MaxSessionTime"/> <Value>30</Value> </AttributeValuePair> </Condition> <Condition name="authelevelle-nonrealmqualfied" type="LEAuthLevelCondition"> <AttributeValuePair><Attribute name="AuthLevel"/> <Value>2</Value> </AttributeValuePair> </Condition> <Condition name="ipcondition" type="IPCondition"> <AttributeValuePair><Attribute name="DnsName"/> <Value>*.iplanet.com</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="EndIp"/> <Value>145.15.15.15</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="StartIp"/> <Value>120.10.10.10</Value> </AttributeValuePair> </Condition> <Condition name="authchain-realmqualfied" type="AuthenticateToServiceCondition"> <AttributeValuePair><Attribute name="AuthenticateToService"/> <Value>/:ldapService</Value> </AttributeValuePair> </Condition> <Condition name="auth to realm" type="AuthenticateToRealmCondition"> <AttributeValuePair><Attribute name="AuthenticateToRealm"/> <Value>/</Value> </AttributeValuePair> </Condition> <Condition name="authlevelge-realmqualified" type="AuthLevelCondition"> <AttributeValuePair><Attribute name="AuthLevel"/> <Value>/:2</Value> </AttributeValuePair> </Condition> <Condition name="authchain-nonrealmqualfied" type="AuthenticateToServiceCondition"> <AttributeValuePair><Attribute name="AuthenticateToService"/> <Value>ldapService</Value> </AttributeValuePair> </Condition> <Condition name="timecondition" type="SimpleTimeCondition"> <AttributeValuePair><Attribute name="EndTime"/> <Value>17:00</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="StartTime"/> <Value>08:00</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="EndDate"/> <Value>2006:07:28</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="EnforcementTimeZone"/> <Value>America/Los_Angeles</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="StartDay"/> <Value>mon</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="StartDate"/> <Value>2006:01:02</Value> </AttributeValuePair> <AttributeValuePair><Attribute name="EndDay"/> <Value>fri</Value> </AttributeValuePair> </Condition> </Conditions> <ResponseProviders name="responseproviders" description="description"> <ResponseProvider name="idresponseprovidere" type="IDRepoResponseProvider"> <AttributeValuePair> <Attribute name="DynamicAttribute"/> </AttributeValuePair> <AttributeValuePair> <Attribute name="StaticAttribute"/> <Value>m=10</Value> <Value>n=30</Value> </AttributeValuePair> </ResponseProvider> </ResponseProviders> </Policy>
ポリシーの XML ファイルを作成したら、次のコマンドを使用してロードできます。
AccessManager-base/SUNWam/bin/amadmin --runasdn "uid=amAdmin,ou=People,default_org, root_suffix" --password password --data policy.xml |
複数のポリシーを同時に追加するには、各 XML ファイルにポリシーを 1 つずつ置くのではなく、1 つの XML ファイルにすべてのポリシーを置きます。複数の XML ファイルでポリシーを次々とロードすると、内部ポリシーインデックスが破損したり、ポリシーの評価に参加できないポリシーが生じたりするおそれがあります。
ポリシーを amadmin で作成するときは、認証スキーム条件を作成中にレルムに認証モジュールを登録することの確認、レルム、LDAP グループ、LDAP ロール、および LDAP ユーザーの対象を作成中に、対応する LDAP オブジェクト (レルム、グループ、ロール、およびユーザー) が存在することの確認、IdentityServerRoles 対象を作成中に、Access Manager ロールが存在することの確認、そしてサブレルムまたはピアレルムの参照を作成中に、関連があるレルムが存在することの確認を行ってください。
SubrealmReferral、PeerRealmReferral、Realm 対象、IdentityServerRoles 対象、LDAPGroups 対象、LDAPRoles 対象、および LDAPUsers 対象の Value 要素のテキストには、完全な DN を指定する必要があります。