

要获得与亚马逊 Timestream 类似的功能 LiveAnalytics，可以考虑适用于 InfluxDB 的亚马逊 Timestream。适用于 InfluxDB 的 Amazon Timestream 提供简化的数据摄取和个位数毫秒级的查询响应时间，以实现实时分析。点击[此处](https://docs.amazonaws.cn//timestream/latest/developerguide/timestream-for-influxdb.html)了解更多信息。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 一般安全性
<a name="timestream-for-influx-getting-started-security"></a>

**Topics**
+ [Permissions](#timestream-for-influx-getting-started-security-permissions)
+ [网络访问](#timestream-for-influx-getting-started-security-network-access)
+ [依赖项](#timestream-for-influx-getting-started-security-dependencies)
+ [S3 桶](#timestream-for-influx-getting-started-security-s3-buckets)

## Permissions
<a name="timestream-for-influx-getting-started-security-permissions"></a>

应向 InfluxDB 用户授予最低权限。在迁移过程中，应仅使用授予特定用户的令牌，而非运算符令牌。

适用于 InfluxDB 的 Timestream 使用 IAM 权限以控制用户权限。我们建议向用户授予其所需的特定操作和资源的访问权限。有关更多信息，请参阅[授予最低权限访问权限](https://docs.amazonaws.cn/wellarchitected/2022-03-31/framework/sec_permissions_least_privileges.html)。

## 网络访问
<a name="timestream-for-influx-getting-started-security-network-access"></a>

Influx 迁移脚本可在本地运行，在同一系统内的两个 InfluxDB 实例之间迁移数据，但假设迁移的主要使用案例是通过网络（本地或公共网络）迁移数据。随之而来的是安全考量。默认情况下，Influx 迁移脚本将验证已启用 TLS 实例的 TLS 证书：我们建议用户在其 InfluxDB 实例中启用 TLS，且不要使用脚本的 `--skip-verify` 选项。

我们建议您使用允许列表以限制网络流量，仅允许来自预期源的流量。为此，您可以将网络流量限制为仅来自已知的 InfluxDB 实例。 IPs

## 依赖项
<a name="timestream-for-influx-getting-started-security-dependencies"></a>

应使用所有依赖项的最新主要版本，包括 Influx CLI、InfluxDB、Python、Requests 模块以及可选的依赖项（例如 `mountpoint-s3` 和 `rclone`）。

## S3 桶
<a name="timestream-for-influx-getting-started-security-s3-buckets"></a>

如果将 S3 存储桶用作迁移的临时存储，我们建议启用 TLS、版本控制并禁用公共访问权限。

**使用 S3 存储桶进行迁移**

1. 打开 Amazon Web Services 管理控制台，导航至 **Amazon 简单存储服务**，然后选择**存储桶**。

1. 选择要使用的存储桶。

1. 选择**权限**选项卡。

1. 在**屏蔽公共访问权限（存储桶设置）**下，请选择**编辑**。

1. 勾选**屏蔽所有公共访问权限**。

1. 选择**保存更改**。

1. 在 **Bucket policy（存储桶策略）**下，请选择 **Edit（编辑）**。

1. 输入以下内容，将 *<example-bucket>* 替换为存储桶名称，以强制使用 TLS 1.2 或更高版本进行连接：

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "EnforceTLSv12orHigher",
               "Principal": {
                   "AWS": "*"
               },
               "Action": [
                   "s3:*"
               ],
               "Effect": "Deny",
               "Resource": [
                   "arn:aws:s3:::<example bucket>/*",
                   "arn:aws:s3:::<example bucket>"
               ],
               "Condition": {
                   "NumericLessThan": {
                       "s3:TlsVersion": 1.2
                   }
               }
           }
       ]
   }
   ```

------

1. 选择**保存更改**。

1. 选择**属性**选项卡。

1. 在**存储桶版本控制**下，请选择**编辑**。

1. 勾选**启用**。

1. 选择**保存更改**。

有关 Amazon S3 存储桶最佳安全性实践的信息，请参阅 [Amazon Simple Storage Service 的安全最佳实践](https://docs.amazonaws.cn/AmazonS3/latest/userguide/security-best-practices.html)。