本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
本主題涵蓋使用 Amazon EMR 主控台和 建立安全組態的一般程序 AWS CLI,後面接著包含 EMRFS 加密、身分驗證和 IAM 角色的參數參考。如需這些功能的詳細資訊,請參閱下列主題:
使用主控台建立安全組態
在 https://https://console.aws.amazon.com/emr
開啟 Amazon EMR 主控台。 -
在導覽窗格中,選擇 Security Configurations (安全組態)、Create security configuration (建立安全組態)。
-
輸入安全組態的 Name (名稱)。
-
選擇以下區段中所述的加密和身分驗證,然後選擇建立。
使用 建立安全組態 AWS CLI
-
請使用
create-security-configuration
指令,如下列範例所示。-
針對
SecConfigName
,指定安全組態的名稱。這是您在建立使用此安全組態的叢集時所指定的名稱。 -
針對
,指定內嵌的 JSON 結構或是本機 JSON 檔案的路徑,例如SecConfigDef
。JSON 參數定義如以下區段所述的加密、EMRFS 存取 Amazon S3 的 IAM 角色和身分驗證選項。file://MySecConfig.json
aws emr create-security-configuration --name "
SecConfigName
" --security-configurationSecConfigDef
-
設定資料加密
在安全組態中設定加密前,請建立用於加密的金鑰和憑證。如需詳細資訊,請參閱 提供用於加密靜態資料的金鑰 和 使用 Amazon EMR 加密提供傳輸中資料的加密憑證。
您在建立安全組態時指定兩組加密選項:靜態資料加密和傳輸中資料加密。靜態資料加密選項包含「Amazon S3 與 EMRFS」和本機磁碟加密。傳輸中加密選項啟用支援 Transport Layer Security (TLS) 特定應用程式的開放原始碼功能。靜態和傳輸中的選項可同時啟用或分別啟用。如需詳細資訊,請參閱使用 Amazon EMR 加密靜態和傳輸中的資料。
注意
當您使用 時 AWS KMS,儲存和使用加密金鑰會收取費用。如需詳細資訊,請參閱 AWS KMS 定價
使用主控台指定加密選項
在 Encryption (加密) 中,根據下列的準則來選擇選項。
-
選擇 At rest encryption (靜態加密) 下的選項來加密存放於檔案系統中的資料。
您可以選擇加密 Amazon S3、本機磁碟或兩者的資料。
-
在 S3 資料加密下,針對加密模式,選擇決定 Amazon EMR 如何使用 EMRFS 加密 Amazon S3 資料的值。
您接下來要執行的動作取決於您選擇的加密模式:
-
SSE-S3 (SSE-S3)
指定 Amazon S3 受管加密金鑰的伺服器端加密。您不必再進行任何操作,因為 Amazon S3 會為您處理金鑰。
-
SSE-KMS (SSE-KMS) 或 CSE-KMS (CSE-KMS)
指定伺服器端加密與受管金鑰 AWS KMS(SSE-KMS) 或用戶端加密與受管金鑰 AWS KMS(CSE-KMS)。針對 AWS KMS key,選取一個金鑰。金鑰必須與您的 EMR 叢集位於相同的區域中。如需金鑰需求,請參閱「使用 AWS KMS keys 進行加密」。
-
CSE-Custom (自訂 CSE)
指定使用自訂用戶端根金鑰 (CSE 自訂) 的用戶端加密。針對 S3 物件,輸入 Amazon S3 中的位置,或是您自訂金鑰提供者 JAR 檔案的 Amazon S3 ARN。接著,針對 Key provider class (金鑰提供者類別),輸入在實作 EncryptionMaterialsProvider 界面的應用程式中,所宣告類別的完整類別名稱。
-
-
在 Local disk encryption (本機磁碟加密) 下,選擇 Key provider type (金鑰提供者類型) 的值。
-
AWS KMS key
選取此選項以指定 AWS KMS key。針對 AWS KMS key,選取一個金鑰。金鑰必須與您的 EMR 叢集位於相同的區域中。如需金鑰需求的詳細資訊,請參閱「使用 AWS KMS keys 進行加密」。
EBS 加密
當您指定 AWS KMS 做為金鑰提供者時,您可以啟用 EBS 加密來加密 EBS 根裝置和儲存磁碟區。若要啟用此類選項,您必須授予 Amazon EMR 服務角色
EMR_DefaultRole
使用您指定之 AWS KMS key 的許可。如需金鑰需求的詳細資訊,請參閱「為 KMS 金鑰提供額外的許可來啟用 EBS 加密」。 -
Custom (自訂)
選擇此選項來指定自訂金鑰提供者。針對 S3 物件,輸入 Amazon S3 中的位置,或是您自訂金鑰提供者 JAR 檔案的 Amazon S3 ARN。針對 Key provider class (金鑰提供者類別),輸入在實作 EncryptionMaterialsProvider 界面的應用程式中,所宣告類別的完整類別名稱。您在這裡提供的類別名稱必須不同於為自訂 CSE 提供的類別名稱。
-
-
選擇 In-transit encryption (傳輸中加密),來啟用傳輸中資料的開放原始碼 TLS 加密功能。根據下列的準則來選擇 Certificate provider type (憑證提供者類型):
-
PEM (PEM)
選擇此選項來使用您在 zip 檔案中提供的 PEM 檔案。在 zip 檔案中需要兩個成品:privateKey.pem 和 certificateChain.pem。第三個檔案的 trustedCertificates.pem 為選用。如需詳細資訊,請參閱 使用 Amazon EMR 加密提供傳輸中資料的加密憑證。針對 S3 物件,指定 Amazon S3 中的位置,或指定 zip 檔案欄位的 Amazon S3 ARN。
-
Custom (自訂)
選取此選項來指定自訂憑證提供者,然後針對 S3 物件,輸入 Amazon S3 中的位置,或是您自訂憑證提供者 JAR 檔案的 Amazon S3 ARN。針對 Key provider class (金鑰提供者類別),輸入在實作 TLSArtifactsProvider 界面的應用程式中,所宣告類別的完整類別名稱。
-
使用 指定加密選項 AWS CLI
下列的段落使用了案例範例,來說明不同組態和金鑰提供者的正確格式 --security-configuration JSON,以及 JSON 參數和適當值的參考。
傳輸中資料加密選項範例
以下範例說明以下案例:
-
傳輸中資料加密啟用而靜態資料加密停用。
-
Amazon S3 中包含憑證的 zip 檔案用作金鑰提供者 (如需憑證需求,請參閱 使用 Amazon EMR 加密提供傳輸中資料的加密憑證)。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": true,
"EnableAtRestEncryption": false,
"InTransitEncryptionConfiguration": {
"TLSCertificateConfiguration": {
"CertificateProviderType": "PEM",
"S3Object": "s3://MyConfigStore/artifacts/MyCerts.zip"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密啟用而靜態資料加密停用。
-
使用自訂金鑰提供者 (如需憑證需求,請參閱「使用 Amazon EMR 加密提供傳輸中資料的加密憑證」)。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": true,
"EnableAtRestEncryption": false,
"InTransitEncryptionConfiguration": {
"TLSCertificateConfiguration": {
"CertificateProviderType": "Custom",
"S3Object": "s3://MyConfig/artifacts/MyCerts.jar",
"CertificateProviderClass": "com.mycompany.MyCertProvider"
}
}
}
}'
靜態資料加密選項範例
以下範例說明以下案例:
-
傳輸中資料加密停用而靜態資料加密啟用。
-
SSE-S3 用於 Amazon S3 加密。
-
本機磁碟加密使用 AWS KMS 做為金鑰提供者。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true,
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "SSE-S3"
},
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "AwsKms",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密已啟用,並使用 ARN 參考 Amazon S3 中包含 PEM 憑證的 zip 檔案。
-
SSE-KMS 用於 Amazon S3 加密。
-
本機磁碟加密使用 AWS KMS 做為金鑰提供者。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": true,
"EnableAtRestEncryption": true,
"InTransitEncryptionConfiguration": {
"TLSCertificateConfiguration": {
"CertificateProviderType": "PEM",
"S3Object": "arn:aws:s3:::MyConfigStore/artifacts/MyCerts.zip"
}
},
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "SSE-KMS",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
},
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "AwsKms",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密啟用,並參考 Amazon S3 中包含 PEM 憑證的 zip 檔案。
-
CSE-KMS 用於 Amazon S3 加密。
-
本機磁碟加密使用其 ARN 參考的自訂金鑰提供者。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": true,
"EnableAtRestEncryption": true,
"InTransitEncryptionConfiguration": {
"TLSCertificateConfiguration": {
"CertificateProviderType": "PEM",
"S3Object": "s3://MyConfigStore/artifacts/MyCerts.zip"
}
},
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "CSE-KMS",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
},
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "Custom",
"S3Object": "arn:aws:s3:::artifacts/MyKeyProvider.jar",
"EncryptionKeyProviderClass": "com.mycompany.MyKeyProvider"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密以自訂金鑰提供者啟用。
-
自訂 CSE 用於 Amazon S3 資料。
-
本機磁碟加密使用自訂金鑰提供者。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": "true",
"EnableAtRestEncryption": "true",
"InTransitEncryptionConfiguration": {
"TLSCertificateConfiguration": {
"CertificateProviderType": "Custom",
"S3Object": "s3://MyConfig/artifacts/MyCerts.jar",
"CertificateProviderClass": "com.mycompany.MyCertProvider"
}
},
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "CSE-Custom",
"S3Object": "s3://MyConfig/artifacts/MyCerts.jar",
"EncryptionKeyProviderClass": "com.mycompany.MyKeyProvider"
},
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "Custom",
"S3Object": "s3://MyConfig/artifacts/MyCerts.jar",
"EncryptionKeyProviderClass": "com.mycompany.MyKeyProvider"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密停用而靜態資料加密啟用。
-
已使用 SSE-KMS 啟用 Amazon S3 加密。
-
使用多個 AWS KMS 金鑰,每個 S3 儲存貯體一個,加密例外狀況會套用至這些個別 S3 儲存貯體。
-
停用本機磁碟加密。
aws emr create-security-configuration --name "MySecConfig" --security-configuration '{
"EncryptionConfiguration": {
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "SSE-KMS",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012",
"Overrides": [
{
"BucketName": "amzn-s3-demo-bucket1",
"EncryptionMode": "SSE-S3"
},
{
"BucketName": "amzn-s3-demo-bucket2",
"EncryptionMode": "CSE-KMS",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
},
{
"BucketName": "amzn-s3-demo-bucket3",
"EncryptionMode": "SSE-KMS",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
]
}
},
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true
}
}'
以下範例說明以下案例:
-
傳輸中資料加密停用而靜態資料加密啟用。
-
已使用 SSE-S3 啟用 Amazon S3 加密,且已停用本機磁碟加密。
aws emr create-security-configuration --name "MyS3EncryptionConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true,
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "SSE-S3"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密停用而靜態資料加密啟用。
-
本機磁碟加密會使用 AWS KMS 做為金鑰提供者,並停用 Amazon S3 加密。
aws emr create-security-configuration --name "MyLocalDiskEncryptionConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true,
"AtRestEncryptionConfiguration": {
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "AwsKms",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
}
}
}'
以下範例說明以下案例:
-
傳輸中資料加密停用而靜態資料加密啟用。
-
本機磁碟加密會使用 AWS KMS 做為金鑰提供者,並停用 Amazon S3 加密。
-
EBS 加密已啟用。
aws emr create-security-configuration --name "MyLocalDiskEncryptionConfig" --security-configuration '{
"EncryptionConfiguration": {
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true,
"AtRestEncryptionConfiguration": {
"LocalDiskEncryptionConfiguration": {
"EnableEbsEncryption": true,
"EncryptionKeyProviderType": "AwsKms",
"AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
}
}
}
}'
以下範例說明以下案例:
SSE-EMR-WAL 用於 EMR WAL 加密
aws emr create-security-configuration --name "MySecConfig" \
--security-configuration '{
"EncryptionConfiguration": {
"EMRWALEncryptionConfiguration":{ },
"EnableInTransitEncryption":false, "EnableAtRestEncryption":false
}
}'
EnableInTransitEncryption
如果想要啟用相關加密, 和 EnableAtRestEncryption
仍然可能是 true。
以下範例說明以下案例:
SSE-KMS-WAL 用於 EMR WAL 加密
伺服器端加密使用 AWS Key Management Service 做為金鑰提供者
aws emr create-security-configuration --name "MySecConfig" \
--security-configuration '{
"EncryptionConfiguration": {
"EMRWALEncryptionConfiguration":{
"AwsKmsKey":"arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
},
"EnableInTransitEncryption":false, "EnableAtRestEncryption":false
}
}'
EnableInTransitEncryption
如果想要啟用相關加密, 和 EnableAtRestEncryption
仍然可能是 true。
適用於加密設定的 JSON 參考
下表列出加密設定的 JSON 參數,並提供每個參數可接受值的說明。
參數 | 描述 |
---|---|
"EnableInTransitEncryption" : true | false |
Specify true to enable in-transit encryption
and false to disable it. If omitted,
false is assumed, and in-transit encryption
is disabled. |
"EnableAtRestEncryption": true |
false |
Specify true to enable at-rest encryption
and false to disable it. If omitted,
false is assumed and at-rest encryption is
disabled. |
傳輸中加密參數 | |
"InTransitEncryptionConfiguration" : |
Specifies a collection of values used to configure
in-transit encryption when
EnableInTransitEncryption is
true . |
"CertificateProviderType": "PEM" |
"Custom" |
Specifies whether to use PEM (PEM) certificates
referenced with a zipped file, or a 自訂
certificate provider. If PEM (PEM) is specified,
S3Object must be a reference to the
location in Amazon S3 of a zip file containing the certificates.
If Custom is specified, S3Object must be a
reference to the location in Amazon S3 of a JAR file, followed by
a CertificateProviderClass entry. |
"S3Object" : " |
" |
Provides the location in Amazon S3 to a zip file when
PEM (PEM) is specified, or to a JAR file when
自訂 is specified. The format can be a
path (for example,
s3://MyConfig/artifacts/CertFiles.zip ) or
an ARN (for example,
arn:aws:s3:::Code/MyCertProvider.jar) . If a
zip file is specified, it must contain files named exactly
privateKey.pem and
certificateChain.pem . A file named
trustedCertificates.pem is
optional. |
"CertificateProviderClass" : " |
Required only if 自訂 is specified for
CertificateProviderType .
specifies a full class name declared in the JAR file, which
implements the TLSArtifactsProvider interface. For example,
com.mycompany.MyCertProvider . |
靜態加密參數 | |
"AtRestEncryptionConfiguration" : |
Specifies a collection of values for at-rest encryption
when EnableAtRestEncryption is
true , including Amazon S3 encryption and local
disk encryption. |
Amazon S3 加密參數 | |
"S3EncryptionConfiguration" : |
Specifies a collection of values used for Amazon S3 encryption with the Amazon EMR File System (EMRFS). |
"EncryptionMode" : "SSE-S3" |
"SSE-KMS" | "CSE-KMS" |
"CSE-Custom" |
Specifies the type of Amazon S3 encryption to use. If
SSE-S3 is specified, no further Amazon S3
encryption values are required. If either
SSE-KMS or CSE-KMS is
specified, an AWS KMS key ARN must be specified as the
AwsKmsKey value. If CSE-Custom (自訂 CSE)
is specified, S3Object and
EncryptionKeyProviderClass values must be
specified. |
"AwsKmsKey" : " |
Required only when either SSE-KMS or
CSE-KMS is specified for
EncryptionMode .
must be a fully specified ARN to a key (for example,
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 ). |
"S3Object" : " |
Required only when CSE-Custom (自訂 CSE) is specified
for CertificateProviderType .
provides the location in Amazon S3 to a JAR file. The format can
be a path (for example,
s3://MyConfig/artifacts/MyKeyProvider.jar )
or an ARN (for example,
arn:aws:s3:::Code/MyKeyProvider.jar) . |
"EncryptionKeyProviderClass" : " |
Required only when CSE-Custom (自訂 CSE) is specified
for EncryptionMode .
specifies a full class name of a class declared in the
application that implements the EncryptionMaterialsProvider
interface; for example,
. |
本機磁碟加密參數 | |
"LocalDiskEncryptionConfiguration" |
Specifies the key provider and corresponding values to be used for local disk encryption. |
"EnableEbsEncryption": |
Specify true to enable EBS encryption. EBS
encryption encrypts the EBS root device volume and attached
storage volumes. To use EBS encryption, you must specify
AwsKms as your
EncryptionKeyProviderType . |
"EncryptionKeyProviderType": "AwsKms" |
"Custom" |
Specifies the key provider. If AwsKms is
specified, an KMS key ARN must be specified as the
AwsKmsKey value. If
自訂 is specified,
S3Object and
EncryptionKeyProviderClass values must be
specified. |
"AwsKmsKey : " |
Required only when AwsKms is specified for
Type .
must be a fully specified ARN to a key (for example,
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-456789012123 ). |
"S3Object" : " |
Required only when CSE-Custom (自訂 CSE) is specified
for CertificateProviderType .
provides the location in Amazon S3 to a JAR file. The format can
be a path (for example,
s3://MyConfig/artifacts/MyKeyProvider.jar )
or an ARN (for example,
arn:aws:s3:::Code/MyKeyProvider.jar) . |
|
Required only when 自訂 is specified for
Type .
specifies a full class name of a class declared in the
application that implements the EncryptionMaterialsProvider
interface; for example,
. |
EMR WAL 加密參數 | |
"EMRWALEncryptionConfiguration" |
Specifies the value for EMR WAL encryption. |
"AwsKmsKey" |
Specifies the CMK Key Id Arn. |
設定 Kerberos 身分驗證
Kerberos 設定的安全組態只能由以 Kerberos 屬性建立的叢集使用,否則會發生錯誤。如需詳細資訊,請參閱使用 Kerberos 透過 Amazon EMR 進行身分驗證。Kerberos 只能在 Amazon EMR 5.10.0 發行版本及更新版本中使用。
使用主控台指定 Kerberos 設定
根據下列的準則,在 Kerberos authentication (Kerberos 身分驗證) 中選擇選項。
參數 | 描述 | ||
---|---|---|---|
Kerberos |
指定已為使用此安全組態的叢集啟用 Kerberos。如果叢集使用此安全組態,叢集也必須指定 Kerberos 設定,否則會發生錯誤。 |
||
供應商 |
叢集專用 KDC |
指定 Amazon EMR 在使用此安全組態之任何叢集的主節點上建立 KDC。您可以在建立叢集時指定領域名稱和 KDC 管理員密碼。 必要時,您可以從其他叢集參考此 KDC。使用不同的安全組態建立這些叢集,指定外部 KDC,並使用您為叢集專用 KDC 指定的領域名稱和 KDC 管理員密碼。 |
|
外部 KDC |
僅適用於 Amazon EMR 5.20.0 及更新版本。指定使用此安全組態的叢集透過叢集外部的 KDC 伺服器來驗證 Kerberos 主體。系統不會在叢集上建立 KDC。在建立叢集時,為外部 KDC 指定領域名稱和 KDC 管理員密碼。 |
||
票證生命週期 |
選用。指定 KDC 發行的 Kerberos 票證在使用此安全組態的叢集上有效的期間。 出於安全原因,票證生命週期是有限的。叢集應用程式和服務會在到期後自動續約票證。使用 Kerberos 憑證透過 SSH 連接至叢集的使用者需要從主節點命令列執行 |
||
跨領域信任 |
指定叢集上使用此安全組態的叢集專用 KDC 與不同 Kerberos 領域中的 KDC 之間的跨領域信任。 來自其他領域的主體 (通常是使用者) 會對使用此組態的叢集進行身分驗證。需要其他 Kerberos 領域中的其他組態。如需詳細資訊,請參閱教學課程:使用 Active Directory 域設定跨領域信任。 |
||
跨領域信任屬性 |
領域 |
指定信任關係中另一個領域的 Kerberos 領域名稱。根據慣例,Kerberos 領域名稱與域名稱相同,但都是大寫字母。 |
|
網域 |
指定信任關係中另一個領域的域名稱。 |
||
管理伺服器 |
指定信任關係另一個領域中管理伺服器的完整域名稱 (FQDN) 或 IP 地址。管理伺服器和 KDC 伺服器通常在具有相同 FQDN 的相同機器上執行,但在不同的連接埠上進行通訊。 如果未指定連接埠,則會使用連接埠 749 (Kerberos 預設值)。或者,您可以指定連接埠 (例如 |
||
KDC 伺服器 |
指定信任關係另一個領域中 KDC 伺服器的完整域名稱 (FQDN) 或 IP 地址。KDC 伺服器和管理伺服器通常在具有相同 FQDN 的相同機器上執行,但使用不同的連接埠。 如果未指定連接埠,則會使用連接埠 88,這是 Kerberos 預設值。或者,您可以指定連接埠 (例如 |
||
外部 KDC |
指定叢集使用叢集外部 KDC。 |
||
外部 KDC 屬性 |
管理伺服器 |
指定外部管理伺服器的完整域名稱 (FQDN) 或 IP 地址。管理伺服器和 KDC 伺服器通常在具有相同 FQDN 的相同機器上執行,但在不同的連接埠上進行通訊。 如果未指定連接埠,則會使用連接埠 749 (Kerberos 預設值)。或者,您可以指定連接埠 (例如 |
|
KDC 伺服器 |
指定外部 KDC 伺服器的完整域名稱 (FQDN)。KDC 伺服器和管理伺服器通常在具有相同 FQDN 的相同機器上執行,但使用不同的連接埠。 如果未指定連接埠,則會使用連接埠 88,這是 Kerberos 預設值。或者,您可以指定連接埠 (例如 |
||
Active Directory 整合 |
指定 Kerberos 主體驗證與 Microsoft Active Directory 域整合。 |
||
Active Directory 整合屬性 |
Active Directory 領域 |
指定 Active Directory 網域的 Kerberos 領域名稱。根據慣例,Kerberos 領域名稱通常與網域名稱相同,但都是大寫字母。 |
|
Active Directory 網域 |
指定 Active Directory 域名稱。 |
||
Active Directory 伺服器 |
指定 Microsoft Active Directory 網域控制器的完整網域名稱 (FQDN)。 |
使用 指定 Kerberos 設定 AWS CLI
以下參考資料表顯示安全組態中,Kerberos 設定的 JSON 參數。如需組態範例,請參閱組態範例。
參數 | 描述 | |||||
---|---|---|---|---|---|---|
|
針對 Kerberos 為必要。指定驗證組態是此安全組態的一部分。 |
|||||
|
|
針對 Kerberos 為必要。指定 Kerberos 組態屬性。 |
||||
|
|
|
||||
"ClusterDedicatedKdcConfiguration": { |
指定 |
|||||
|
選用。指定 KDC 發行的 Kerberos 票證在使用此安全組態的叢集上有效的期間。 出於安全原因,票證生命週期是有限的。叢集應用程式和服務會在到期後自動續約票證。使用 Kerberos 憑證透過 SSH 連接至叢集的使用者需要從主節點命令列執行 |
|||||
|
指定叢集上使用此安全組態的叢集專用 KDC 與不同 Kerberos 領域中的 KDC 之間的跨領域信任。 來自其他領域的主體 (通常是使用者) 會對使用此組態的叢集進行身分驗證。需要其他 Kerberos 領域中的其他組態。如需詳細資訊,請參閱教學課程:使用 Active Directory 域設定跨領域信任。 |
|||||
|
指定信任關係中另一個領域的 Kerberos 領域名稱。根據慣例,Kerberos 領域名稱與域名稱相同,但都是大寫字母。 |
|||||
|
指定信任關係中另一個領域的域名稱。 |
|||||
|
指定信任關係另一個領域中管理伺服器的完整域名稱 (FQDN) 或 IP 地址。管理伺服器和 KDC 伺服器通常在具有相同 FQDN 的相同機器上執行,但在不同的連接埠上進行通訊。 如果未指定連接埠,則會使用連接埠 749 (Kerberos 預設值)。或者,您可以指定連接埠 (例如 |
|||||
|
指定信任關係另一個領域中 KDC 伺服器的完整域名稱 (FQDN) 或 IP 地址。KDC 伺服器和管理伺服器通常在具有相同 FQDN 的相同機器上執行,但使用不同的連接埠。 如果未指定連接埠,則會使用連接埠 88,這是 Kerberos 預設值。或者,您可以指定連接埠 (例如 |
|||||
|
||||||
|
||||||
"ExternalKdcConfiguration": { |
指定 |
|||||
|
選用。指定 KDC 發行的 Kerberos 票證在使用此安全組態的叢集上有效的期間。 出於安全原因,票證生命週期是有限的。叢集應用程式和服務會在到期後自動續約票證。使用 Kerberos 憑證透過 SSH 連接至叢集的使用者需要從主節點命令列執行 |
|||||
|
指定參考單一 KDC 伺服器。 |
|||||
"AdminServer": " |
指定外部管理伺服器的完整域名稱 (FQDN) 或 IP 地址。管理伺服器和 KDC 伺服器通常在具有相同 FQDN 的相同機器上執行,但在不同的連接埠上進行通訊。 如果未指定連接埠,則會使用連接埠 749 (Kerberos 預設值)。或者,您可以指定連接埠 (例如 |
|||||
"KdcServer": " |
指定外部 KDC 伺服器的完整域名稱 (FQDN)。KDC 伺服器和管理伺服器通常在具有相同 FQDN 的相同機器上執行,但使用不同的連接埠。 如果未指定連接埠,則會使用連接埠 88,這是 Kerberos 預設值。或者,您可以指定連接埠 (例如 |
|||||
|
指定 Kerberos 主體驗證與 Microsoft Active Directory 域整合。 |
|||||
|
|
指定 Active Directory 網域的 Kerberos 領域名稱。根據慣例,Kerberos 領域名稱通常與網域名稱相同,但都是大寫字母。 |
||||
|
指定 Active Directory 域名稱。 |
|||||
|
指定 Microsoft Active Directory 網域控制器的完整網域名稱 (FQDN)。 |
|||||
|
||||||
|
||||||
|
||||||
|
設定向 Amazon S3 請求使用 EMRFS 的 IAM 角色
EMRFS 的 IAM 角色可讓您提供 Amazon S3 中 EMRFS 資料的不同許可。存取請求包含您指定的識別符時,建立指定用於提供許可 IAM 角色的映射。識別符可以是 Hadoop 使用者或角色,或 Amazon S3 字首。
如需詳細資訊,請參閱設定向 Amazon S3 請求使用 EMRFS 的 IAM 角色。
使用 指定 EMRFS 的 IAM 角色 AWS CLI
以下是 JSON 程式碼片段範例,用於在安全組態內為 EMRFS 指定自訂 IAM 角色。它示範了三種不同標識符類型的角色映射,後接參數參考。
{ "AuthorizationConfiguration": { "EmrFsConfiguration": { "RoleMappings": [{ "Role": "
arn:aws:iam::123456789101:role/allow_EMRFS_access_for_user1
", "IdentifierType": "User", "Identifiers": [ "user1
" ] },{ "Role": "arn:aws:iam::123456789101:role/allow_EMRFS_access_to_demo_s3_buckets
", "IdentifierType": "Prefix", "Identifiers": [ "s3://amzn-s3-demo-bucket1/","s3://amzn-s3-demo-bucket2/
" ] },{ "Role": "arn:aws:iam::123456789101:role/allow_EMRFS_access_for_AdminGroup
", "IdentifierType": "Group", "Identifiers": [ "AdminGroup
" ] }] } } }
參數 | 描述 |
---|---|
|
必要。 |
|
必要。包含角色映射。 |
|
必要。包含一或多個角色映射定義。角色映射以顯示的由上而下順序進行評估。如果對於 Amazon S3 中的資料的 EMRFS 呼叫,角色映射評估為 true,則不會評估進一步的角色映射,且 EMRFS 會為請求使用指定的 IAM 角色。角色映射包含下列必要參數: |
|
以格式 |
|
可為下列其中之一:
|
|
指定適當識別符類型的一或多個識別符。以逗號分隔多個識別符,不含空格。 |
設定對 Amazon EC2 執行個體的中繼資料服務請求
執行個體中繼資料 是關於您執行個體的資料,您可以用來設定或管理執行中的執行個體。您可以使用以下其中一個方法,從執行中的執行個體存取執行個體中繼資料:
-
執行個體中繼資料服務第 1 版 (IMDSv1) – 請求/回應方法
-
執行個體中繼資料服務第 2 版 (IMDSv2) – 工作階段導向方法
雖然 Amazon EC2 同時支援 IMDSv1 和 IMDSv2,但 Amazon EMR 在 Amazon EMR 5.23.1、5.27.1、5.32 或更新版本以及 6.2 或更新版本中支援 IMDSv2。在這些版本中,Amazon EMR 元件使用 IMDSv2 進行所有 IMDS 呼叫。對於應用程式程式碼中的 IMDS 呼叫,您可以同時使用 IMDSv1 與 IMDSv2,或將 IMDS 設定為僅使用 IMDSv2 來增強安全性。當您指定必須使用該 IMDSv2 時,IMDSv1 則無法繼續運作。
如需詳細資訊,請參閱《Amazon EC2 使用者指南》中的設定執行個體中繼資料服務。
注意
在較早 Amazon EMR 5.x 或 6.x 版本中,關閉 IMDSv1 會導致叢集啟動失敗,因為 Amazon EMR 元件使用 IMDSv1 進行所有 IMDS 呼叫。關閉 IMDSv1 時,請確保所有使用 IMDSv1 的自訂軟體都更新為 IMDSv2。
使用 AWS CLI指定執行個體中繼資料服務組態
以下是用於在安全組態內指定 Amazon EC2 執行個體中繼資料服務 (IMDS) 的範例 JSON 程式碼片段。使用自訂安全組態是選用的。
{
"InstanceMetadataServiceConfiguration" : {
"MinimumInstanceMetadataServiceVersion": integer,
"HttpPutResponseHopLimit": integer
}
}
參數 | 描述 |
---|---|
|
如果您未在安全組態中指定 IMDS,並使用需要 IMDSv1 的 Amazon EMR 版本,Amazon EMR 會預設為使用 IMDSv1 做為最低執行個體中繼資料服務版本。如果您想要使用自己的組態,則需要下列兩個參數。 |
|
必要。可指定為 |
|
必要。在執行個體中繼資料請求上所需的 HTTP PUT 回應躍點限制。數字越大,可傳輸的執行個體中繼資料請求越多。預設: |
使用主控台指定執行個體中繼資料服務組態
當您從 Amazon EMR 主控台啟動叢集時,您可以針對叢集設定 IMDS 的使用。
若要使用主控台設定 IMDS 的使用,請執行以下操作:
-
在安全組態頁面上建立新的安全組態時,選取 EC2 執行個體中繼資料服務設定下的設定 EC2 執行個體中繼資料服務。此組態僅在 Amazon EMR 5.23.1、5.27.1、5.32 或更新版本以及 6.2 或更新版本中受支援。
-
對於最低執行個體中繼資料服務版本選項,選取:
-
關閉 IMDSv1 並僅允許 IMDSv2 – 如果您只想在此叢集上允許 IMDSv2。請參閱《Amazon EC22 使用者指南》中的使用執行個體中繼資料服務第 2 版轉換為 。
-
在叢集上同時允許 IMDSv1 和 IMDSv2 – 如果您想要在此叢集上允許 IMDSv1 和工作階段導向的 IMDSv2。
-
-
對於 IMDSv2,您也可以透過將 HTTP put 回應跳轉限制設定為介於
1
與64
之間的整數,以為中繼資料字符設定允許的網路跳轉數量。
如需詳細資訊,請參閱《Amazon EC2 使用者指南》中的設定執行個體中繼資料服務。
請參閱《Amazon EC2 使用者指南》中的設定執行個體詳細資訊和設定執行個體中繼資料服務。