티스토리 뷰

___퍼블릭 클라우드

[KMS] AWS KMS KEY 생성

변군 변군이글루 2020. 9. 18. 17:09

AWS KMS KEY 생성

 

KMS 키 생성

###KMS 키 생성
$ aws --profile byun_profile --region ap-northeast-2 kms create-key

 

KMS AliasName 생성

###KMS AliasName 생성
###aws kms create-alias --alias-name "AliasName" --target-key-id "KeyId"
$ aws --profile byun_profile --region ap-northeast-2 kms create-alias --alias-name "alias/kms-slack-key" --target-key-id "83advf5d-31d6-404a-b99c-d24a83a33265"

 

KMS 키 리스트

###KMS 키 리스트
$ aws --profile byun_profile --region ap-northeast-2 kms list-keys
{
    "Keys": [
        {
            "KeyId": "83advf5d-31d6-404a-b99c-d24a83a33265",
            "KeyArn": "arn:aws:kms:ap-northeast-2:592439987428:key/83advf5d-31d6-404a-b99c-d24a83a33265"
        }
    ]
}

 

KMS 키 AliasName 리스트

###KMS 키 AliasName 리스트
$ aws --profile byun_profile --region ap-northeast-2 kms list-aliases
{
    "Aliases": [
        {
            "AliasName": "alias/kms-slack-key",
            "AliasArn": "arn:aws:kms:ap-northeast-2:592439987428:alias/kms-slack-key",
            "TargetKeyId": "83advf5d-31d6-404a-b99c-d24a83a33265"
        }
    ]
}

 

KMS 키 encrypt 생성

###KMS 키 encrypt 생성
$ aws --profile byun_profile --region ap-northeast-2 kms encrypt --key-id alias/kms-slack-key --plaintext "hooks.slack.com/services/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"
{
    "CiphertextBlob": "AQICAHiH8+tXPnjvkRYA3k9qK5paqaUs5M+PUNlYfLAj3dN2XgEEGxJyCLo4TT3Aesf2T5x6AAAAqzCBqAYJKoZIhvcNAQcGoIGaMIGXAgEAMIGRBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDMGNGejiVCbSOgNrxgIBEIBkiq1pbfTAjbdpT0bNnkKGYXe5CW4negBRUEKR5pc1rJ7xuZjg/8yFNhi4sSzEg3JMqvs7XtjzzjZZp4WjKkuN34ZM7sFCHqVhTIwtBwNGA9v7Lm+EKeDAFEhAhYF+d97R4hDD3w==",
    "KeyId": "arn:aws:kms:ap-northeast-2:592439987428:key/83advf5d-31d6-404a-b99c-d24a83a33265",
    "EncryptionAlgorithm": "SYMMETRIC_DEFAULT"
}

 

 

댓글
댓글쓰기 폼