加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 将敏感凭据放入AWS实例的userdata属性中

发布时间:2020-12-13 23:36:02 所属栏目:Windows 来源:网络整理
导读:我将敏感凭据注入userdata并且不确定这是否安全. 我正在使用userdata属性来运行一个脚本,该脚本在联机时将实例连接到域 像这样传递信用: $ADUser = 'me'$ADPassword = 'Pass'$ADPassword = $ADPassword | ConvertTo-SecureString -AsPlainText -Force$ADCre
我将敏感凭据注入userdata并且不确定这是否安全.

我正在使用userdata属性来运行一个脚本,该脚本在联机时将实例连接到域

像这样传递信用:

$ADUser = 'me'
$ADPassword = 'Pass'
$ADPassword  = $ADPassword | ConvertTo-SecureString -AsPlainText -Force
$ADCred = New-Object System.Management.Automation.PSCredential -ArgumentList $ADUser,$ADPassword

Add-Computer -Credential $ADCred -DomainName mydom.local -NewName testing
Restart-Computer -force

我正在使用New-EC2Instance cmdlet启动它并将此脚本作为userdata传递

我的凭据是否可以在aws日志中显示错误输出?或者别的地方?在将证书注入PS命令之前,凭证是安全的,我担心它在AWS中的位置.

不要将凭据和其他敏感数据放在用户数据脚本中.

AWS文档强调:

Important

Although you can only access instance metadata and user data from within the instance itself,the data is not protected by cryptographic methods. Anyone who can access the instance can view its metadata. Therefore,you should take suitable precautions to protect sensitive data (such as long-lived encryption keys). You should not store sensitive data,such as passwords,as user data.

资料来源:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html

相反,为EC2实例创建IAM角色,并赋予其执行需要执行的操作的权限.然后,启动EC2实例时,将IAM角色分配给EC2实例(以后不能分配).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读