0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Kinesisストリームのサーバーサイド暗号を試してみる

Posted at

サーバーサイドでは、Kinesisストリームのストレージ I/O のタイミングで暗号・復号処理を行います。

とりあえずやってみたのでメモ。

#1.Kinesis ストリームを作成し、暗号化する#

image.png

#2.CLI で暗号化されたストリームを確認#

$ aws kinesis describe-stream --stream-name test
{
    "StreamDescription": {
        "KeyId": "arn:aws:kms:ap-northeast-1:123456789012:key/c22d289b-669b-4e64-830b-30713982cccc",  ※
        "EncryptionType": "KMS",                                       ※

#3.Kinesis ストリームにデータを投入#

$ aws kinesis put-record --stream-name test --data aaa --partition-key 111
{
    "ShardId": "shardId-000000000000",
    "EncryptionType": "KMS",                                         ※
    "SequenceNumber": "49602066998617934605647566514234616470937753180109275138"
}

#4.Kinesis ストリームからデータを取得し、暗号化されていることを確認#

$ aws kinesis get-shard-iterator --stream-name test --shard-id shardId-000000000000 --shard-iterator-type TRIM_HORIZON
{
    "ShardIterator": "AAAAAAAAAA"
}

※シャードイテレーターの有効期間は 300 秒です。

$ aws kinesis get-records --shard-iterator "AAAAAAAAAA"
{
    "Records": [
        {
            "Data": "Yg==",
            "PartitionKey": "b",
            "ApproximateArrivalTimestamp": 1499878938.69,
            "EncryptionType": "KMS",                                     ※
            "SequenceNumber": "49575030693030991390093810531763277195232933088973553666"
        }
    ],
    "NextShardIterator": "DUMMY-NEXT",
    "MillisBehindLatest": 0
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?