アクセス制御ポリシーエンドポイント
アクセス制御ポリシーとは、属性を統合して、許容されるアクションと許容されないアクションを確立するステートメントです。 これらのポリシーは、ローカルまたはグローバルのどちらでもかまいません。また、他のポリシーを上書きすることもできます。 The /policies
属性ベースのアクセス制御 API のエンドポイントを使用すると、ポリシーを制御するルールに関する情報や、それぞれの件名条件を含むポリシーをプログラムで管理できます。
/policies
エンドポイント ポリシーサービス API:データ使用ポリシーの管理に使用されます。はじめに
このガイドで使用される API エンドポイントは、属性ベースのアクセス制御 API の一部です。 先に進む前に、はじめる前にを参照し、関連ドキュメントへのリンク、このドキュメントのサンプル API 呼び出しを読み取るためのガイドおよび任意の Experience Platform API を正常に呼び出すために必要なヘッダーに関する重要な情報を確認してください。
ポリシーのリストの取得 list
に対するGETリクエスト /policies
endpoint :組織内の既存のポリシーをすべてリストします。
API 形式
GET /policies
リクエスト
次のリクエストは、既存のポリシーのリストを取得します。
curl -X GET \
https://platform.adobe.io/data/foundation/access-control/administration/policies \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
応答
正常な応答は、既存のポリシーのリストを返します。
{
{
"id": "7019068e-a3a0-48ce-b56b-008109470592",
"imsOrgId": "{IMS_ORG}",
"createdBy": "{CREATED_BY}",
"createdAt": 1652892767559,
"modifiedBy": "{MODIFIED_BY}",
"modifiedAt": 1652895736367,
"name": "schema-field",
"description": "schema-field",
"status": "inactive",
"subjectCondition": null,
"rules": [
{
"effect": "Deny",
"resource": "/orgs/{IMS_ORG}/sandboxes/xql/schemas/*/schema-fields/*",
"condition": "{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}",
"actions": [
"com.adobe.action.read",
"com.adobe.action.write",
"com.adobe.action.view"
]
},
{
"effect": "Permit",
"resource": "/orgs/{IMS_ORG}/sandboxes/*/schemas/*/schema-fields/*",
"condition": "{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}",
"actions": [
"com.adobe.action.delete"
]
},
{
"effect": "Deny",
"resource": "/orgs/{IMS_ORG}/sandboxes/delete-sandbox-adfengine-test-8/segments/*",
"condition": "{\"!\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"custom/\",{\"var\":\"resource.labels\"}]}]}",
"actions": [
"com.adobe.action.write"
]
}
],
"_etag": "\"0300593f-0000-0200-0000-62852ff80000\""
},
{
"id": "13138ef6-c007-495d-837f-0a248867e219",
"imsOrgId": "{IMS_ORG}",
"createdBy": "{CREATED_BY}",
"createdAt": 1652859368555,
"modifiedBy": "{MODIFIED_BY}",
"modifiedAt": 1652890780206,
"name": "Documentation-Copy",
"description": "xyz",
"status": "active",
"subjectCondition": null,
"rules": [
{
"effect": "Permit",
"resource": "orgs/{IMS_ORG}/sandboxes/ro-sand/schemas/*/schema-fields/*",
"condition": "{\"!\":[{\"or\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"and\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}]}]}",
"actions": [
"com.adobe.action.read"
]
},
{
"effect": "Deny",
"resource": "orgs/{IMS_ORG}/sandboxes/*/segments/*",
"condition": "{\"!\":[{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"custom/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
],
"_etag": "\"0300d43c-0000-0200-0000-62851c9c0000\""
},
}
id
imsOrgId
createdBy
createdAt
createdAt
プロパティは unix エポックタイムスタンプで表示されます。modifiedBy
modifiedAt
modifiedAt
プロパティは unix エポックタイムスタンプで表示されます。name
description
status
active
または inactive
.subjectCondition
subjectCondition
は、件名の属性に適用されるクエリに似た条件です。rules
rules.effect
action
, condition
および resource
. 次の値を指定できます。 permit
, deny
または indeterminate
.rules.resource
rules.condition
rules.action
read
, create
, edit
、および delete
.ポリシーの詳細を ID で検索します lookup
に対するGETリクエスト /policies
エンドポイントを使用して、個々のポリシーに関する情報を取得するためのリクエストパスにポリシー ID を指定する際に使用されます。
API 形式
GET /policies/{POLICY_ID}
リクエスト
次のリクエストは、個々のポリシーに関する情報を取得します。
curl -X GET \
https://platform.adobe.io/data/foundation/access-control/administration/policies/13138ef6-c007-495d-837f-0a248867e219 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
応答
リクエストが成功すると、クエリされたポリシー ID に関する情報が返されます。
{
"policies": [
{
"id": "7019068e-a3a0-48ce-b56b-008109470592",
"imsOrgId": "5555467B5D8013E50A494220@AdobeOrg",
"createdBy": "example@AdobeID",
"createdAt": 1652892767559,
"modifiedBy": "example@AdobeID",
"modifiedAt": 1652895736367,
"name": "schema-field",
"description": "schema-field",
"status": "inactive",
"subjectCondition": null,
"rules": [
{
"effect": "Deny",
"resource": "/orgs/5555467B5D8013E50A494220@AdobeOrg/sandboxes/xql/schemas/*/schema-fields/*",
"condition": "{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}",
"actions": [
"com.adobe.action.read",
"com.adobe.action.write",
"com.adobe.action.view"
]
},
{
"effect": "Permit",
"resource": "/orgs/5555467B5D8013E50A494220@AdobeOrg/sandboxes/*/schemas/*/schema-fields/*",
"condition": "{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}",
"actions": [
"com.adobe.action.delete"
]
},
{
"effect": "Deny",
"resource": "/orgs/5555467B5D8013E50A494220@AdobeOrg/sandboxes/delete-sandbox-adfengine-test-8/segments/*",
"condition": "{\"!\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"custom/\",{\"var\":\"resource.labels\"}]}]}",
"actions": [
"com.adobe.action.write"
]
}
],
"etag": "\"0300593f-0000-0200-0000-62852ff80000\""
}
]
}
id
imsOrgId
createdBy
createdAt
createdAt
プロパティは unix エポックタイムスタンプで表示されます。modifiedBy
modifiedAt
modifiedAt
プロパティは unix エポックタイムスタンプで表示されます。name
description
status
active
または inactive
.subjectCondition
subjectCondition
は、件名の属性に適用されるクエリに似た条件です。rules
rules.effect
action
, condition
および resource
. 次の値を指定できます。 permit
, deny
または indeterminate
.rules.resource
rules.condition
rules.action
read
, create
, edit
、および delete
.ポリシーを作成する create
新しいポリシーを作成するには、 /policies
endpoint.
API 形式
POST /policies
リクエスト
次のリクエストは、という名前の新しいポリシーを作成します。 acme-integration-policy
.
curl -X POST \
https://platform.adobe.io/data/foundation/access-control/administration/policies \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}'
-d'{
"name": "acme-integration-policy",
"description": "Policy for ACME",
"imsOrgId": "{IMS_ORG}",
"rules": [
{
"effect": "Permit",
"resource": "/orgs/{IMS_ORG}/sandboxes/*",
"condition": "{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
]
}'
name
description
imsOrgId
rules
rules.effect
action
, condition
および resource
. 次の値を指定できます。 permit
, deny
または indeterminate
.rules.resource
rules.condition
rules.action
read
, create
, edit
、および delete
.応答
リクエストが成功すると、新しく作成されたポリシーが返されます。この中には、一意のポリシー ID と関連するルールが含まれます。
{
"id": "c3863937-5d40-448d-a7be-416e538f955e",
"imsOrgId": "{IMS_ORG}",
"createdBy": "{CREATED_BY}",
"createdAt": 1652988384458,
"modifiedBy": "{MODIFIED_BY}",
"modifiedAt": 1652988384458,
"name": "acme-integration-policy",
"description": "Policy for ACME",
"status": "active",
"subjectCondition": null,
"rules": [
{
"effect": "Permit",
"resource": "/orgs/{IMS_ORG}/sandboxes/*",
"condition": "{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
],
"_etag": null
}
id
name
rules
rules.effect
action
, condition
および resource
. 次の値を指定できます。 permit
, deny
または indeterminate
.rules.resource
rules.condition
rules.action
read
, create
, edit
、および delete
.ポリシー ID によるポリシーの更新 put
個々のポリシーのルールを更新するには、 /policies
エンドポイントを使用して、リクエストパスで更新するポリシーの ID を指定する際に使用するエンドポイントを返します。
API 形式
PUT /policies/{POLICY_ID}
リクエスト
curl -X PUT \
https://platform.adobe.io/data/foundation/access-control/administration/policies/8cf487d7-3642-4243-a8ea-213d72f694b9 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}'
-d'{
"id": "8cf487d7-3642-4243-a8ea-213d72f694b9",
"imsOrgId": "{IMS_ORG}",
"name": "test-2",
"rules": [
{
"effect": "Deny",
"resource": "/orgs/{IMS_ORG}/sandboxes/*",
"condition": "{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
]
}'
応答
正常な応答は、更新されたポリシーを返します。
{
"id": "8cf487d7-3642-4243-a8ea-213d72f694b9",
"imsOrgId": "{IMS_ORG}",
"createdBy": "{CREATED_BY}",
"createdAt": 1652988866647,
"modifiedBy": "{MODIFIED_BY}",
"modifiedAt": 1652989297287,
"name": "test-2",
"description": null,
"status": "active",
"subjectCondition": null,
"rules": [
{
"effect": "Deny",
"resource": "/orgs/{IMS_ORG}/sandboxes/*",
"condition": "{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
],
"_etag": null
}
ポリシーのプロパティを更新 patch
個々のポリシーのプロパティを更新するには、 /policies
エンドポイントを使用して、リクエストパスで更新するポリシーの ID を指定する際に使用するエンドポイントを返します。
API 形式
PATCH /policies/{POLICY_ID}
リクエスト
次のリクエストでは、 /description
ポリシー ID 内 c3863937-5d40-448d-a7be-416e538f955e
.
curl -X PATCH \
https://platform.adobe.io/data/foundation/access-control/administration/policies/c3863937-5d40-448d-a7be-416e538f955e \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}'
-d'{
"operations": [
{
"op": "replace",
"path": "/description",
"value": "Pre-set policy to be applied for ACME"
}
]
}'
op
add
、replace
、remove
があります。path
value
応答
正常な応答は、クエリされたポリシー ID と、更新された説明を返します。
{
"id": "c3863937-5d40-448d-a7be-416e538f955e",
"imsOrgId": "{IMS_ORG}",
"createdBy": "acp_accessControlService",
"createdAt": 1652988384458,
"modifiedBy": "acp_accessControlService",
"modifiedAt": 1652988384458,
"name": "acme-integration-policy",
"description": "Pre-set policy to be applied for ACME",
"status": "active",
"subjectCondition": null,
"rules": [
{
"effect": "Permit",
"resource": "/orgs/{IMS_ORG}/sandboxes/*",
"condition": "{\"or\":[{\"adobe.match_any_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]},{\"!\":[{\"adobe.match_all_labels_by_prefix\":[{\"var\":\"subject.roles.labels\"},\"core/\",{\"var\":\"resource.labels\"}]}]}]}",
"actions": [
"com.adobe.action.read"
]
}
],
"_etag": null
}
ポリシーの削除 delete
ポリシーを削除するには、 /policies
エンドポイントを使用して、削除するポリシーの ID を指定します。
API 形式
DELETE /policies/{POLICY_ID}
リクエスト
次のリクエストでは、ID がのポリシーを削除します。 c3863937-5d40-448d-a7be-416e538f955e
.
curl -X DELETE \
https://platform.adobe.io/data/foundation/access-control/administration/policies/c3863937-5d40-448d-a7be-416e538f955e \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
応答
リクエストが成功した場合は、HTTP ステータス 204(コンテンツなし)が空白の本文とともに返されます。
ポリシーに対して検索 (GET) リクエストを試行すると、削除を確認できます。 ポリシーが管理から削除されているので、HTTP ステータス 404(Not Found) が表示されます。