本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立just-in-time節點存取的自動核准政策
自動核准政策使用 Cedar 政策語言來定義哪些使用者可以自動連線到指定的節點,而無需手動核准。自動核准政策包含多個指定 principal
和 的permit
陳述式resource
。每個陳述式都包含定義自動核准條件的when
子句。
以下是自動核准政策的範例。
permit (
principal in AWS::IdentityStore::Group::"e8c17310-e011-7089-d989-10da1EXAMPLE",
action == AWS::SSM::Action::"getTokenForInstanceAccess",
resource
)
when {
principal has costCenter && resource.hasTag("CostCenter") && principal.costCenter == resource.getTag("CostCenter")
};
permit (
principal in AWS::IdentityStore::Group::"d4q81745-r081-7079-d789-14da1EXAMPLE",
action == AWS::SSM::Action::"getTokenForInstanceAccess",
resource
)
when {
principal has organization && resource.hasTag("Engineering") && resource.hasTag("Production") && principal.organization == "Platform"
};
permit (
principal,
action == AWS::SSM::Action::"getTokenForInstanceAccess",
resource
)
when {
principal has employeeNumber && principal.employeeNumber like "E-1*" && resource.hasTag("Purpose") && resource.getTag("Purpose") == "Testing"
};
下列程序說明如何為just-in-time節點存取建立自動核准政策。自動核准的存取請求的存取持續時間為 1 小時。此值無法變更。每個 AWS 帳戶 和 只能有一個自動核准政策 AWS 區域。如需如何建構政策陳述式的詳細資訊,請參閱 自動核准和拒絕存取政策的陳述式結構和內建運算子。
建立自動核准政策
在 https://https://console.aws.amazon.com/systems-manager/
開啟 AWS Systems Manager 主控台。 -
在導覽窗格中選取管理節點存取。
-
在核准政策索引標籤中,選取建立自動核准政策。
-
在政策陳述式區段中輸入自動核准政策的政策陳述式。您可以使用提供的範例陳述式來協助您建立政策。
-
選取建立自動核准政策。