douduan5073 2019-04-11 02:48
浏览 35


The regular expressions for AWS access key ids and secret keys from the AWS security blog are:
AKID: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9])
SK:    (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=])

When I try to use these with the Go regexp package, it gives the following error for both expressions: error parsing regexp: invalid or unsupported Perl syntax: `(?<`. I know that the Go regexp package does not fully support the Perl syntax, but I'm not sure how to represent the same expression so that it is supported by Go.

Any help would be appreciated.

  • 写回答

1条回答 默认 最新

  • drbouzlxb92333332 2019-04-11 07:29

    Based on the above comments that the system takes users credentials and uses them to create EC2 isntances, this does not sound like the right place to use credentials. IAM best practices advices against sharing AIM credentials.

    Depending on how the user is authenticated you should either use Cognito Identity pools to grant the permission to the user to create the instance when they use your service.

    Or you can use STS to assume a role on behalf of the user.

    Depending on how the service works it could also just have the IAM role needed to create the EC2 instances, and do user validation and logging in the service

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥20 qt中connect两个signal
  • ¥20 pix2pixHD运行测试命令时出现数据类型错误无法反向传播的问题
  • ¥15 python处理Excel符合条件的行自动填写数据分类
  • ¥15 汇编hook举例并讲解(通俗易懂,学习用)
  • ¥20 用c++语言模拟键盘电子琴设计
  • ¥15 STM32cubemx生成keil工程,有问题与正常的情况不同,求解!
  • ¥15 如何自动点击银行app的安全键盘,实现密码自动输入
  • ¥15 关于四边形重叠的问题
  • ¥15 用verilog语言设计一个简易的八音符电子琴,可通过按键输入来控制音响。演奏时可以选择是手演奏(由键盘输入)或自动演奏已存入的乐曲。能够自动演奏多首乐曲,且每首乐曲可重复演奏
  • ¥15 sap gui脚本每次到导出Excel的时候就停住不动。不会另存为。