Feature Request: Add support for AWS IAM roles (ECS Task Role / EC2 Instance Profile) for SQS authentication
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 internal/config/mqconfig_aws.go 和 issue 中引用的 IsConfigured() 方法开始,然后追踪配置验证在哪里抛出 'message queue configuration is required',以及 SQS 客户端在哪里构建(以确认它依赖 AWS SDK 的默认凭证链)。找到覆盖 AWSSQSConfig 的配置验证测试,并为 IAM 角色环境添加用例。完成的定义是:当存在 AWS_CONTAINER_CREDENTIALS_* 或 AWS_EXECUTION_ENV 时,仅设置 Region 也能使 IsConfigured() 返回 true,显式密钥仍然有效,且现有配置测试全部通过。
由索引模型根据 Issue 内容生成。
描述
Feature Request: Add support for AWS IAM roles (ECS Task Role / EC2 Instance Profile) for SQS authentication
Description
Currently, Outpost requires explicit AWS credentials (AWS_SQS_ACCESS_KEY_ID and AWS_SQS_SECRET_ACCESS_KEY) for SQS authentication. This prevents the use of AWS IAM roles, which is the recommended security practice for applications running on AWS infrastructure like ECS, EC2, or Lambda.
Current Behavior
When running Outpost on ECS Fargate without explicit credentials, the service fails with:
config validation error: message queue configuration is required
Looking at the source code in internal/config/mqconfig_aws.go, the IsConfigured() method requires non-empty credentials:
func (c *AWSSQSConfig) IsConfigured() bool {
return c.AccessKeyID != "" && c.SecretAccessKey != "" && c.Region != ""
}
Expected Behavior
Outpost should support AWS IAM roles by:
- Detecting when running in an AWS environment with IAM roles available
- Using the AWS SDK's default credential provider chain
- Only requiring the region when IAM roles are available
Use Case
Many organizations follow AWS security best practices by:
- Using IAM roles instead of long-lived access keys
- Running containerized workloads on ECS with task roles
- Deploying on EC2 instances with instance profiles
- Following the principle of least privilege
Currently, we have to create IAM users with access keys specifically for Outpost, which:
- Goes against security best practices
- Requires additional secret management
- Increases the attack surface
- Makes credential rotation more complex
Proposed Solution
Modify the IsConfigured() method to support IAM roles:
func (c *AWSSQSConfig) IsConfigured() bool {
// Check if running with IAM role credentials
if hasIAMRoleCredentials() {
return c.Region != ""
}
// Fall back to explicit credentials
return c.AccessKeyID != "" && c.SecretAccessKey != "" && c.Region != ""
}
func hasIAMRoleCredentials() bool {
// ECS Task Role
if os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") != "" {
return true
}
// EC2 Instance Profile
if os.Getenv("AWS_CONTAINER_CREDENTIALS_FULL_URI") != "" {
return true
}
// Lambda or other AWS services
if os.Getenv("AWS_EXECUTION_ENV") != "" {
return true
}
return false
}
The AWS SDK for Go already handles credential resolution automatically through its default credential provider chain, so the SQS client initialization should work without explicit credentials when IAM roles are available.
Environment
- Outpost version: v0.4.1
- Deployment platform: AWS ECS Fargate
- AWS SDK: Already included in Outpost
Additional Context
This feature would align Outpost with AWS best practices and make it easier to deploy in production environments. Many similar tools (e.g., Fluent Bit, Prometheus, etc.) support IAM roles out of the box.
Workarounds
Current workarounds include:
- Creating IAM users with access keys (security anti-pattern)
- Using a sidecar container to provide credentials
- Forking Outpost to add IAM role support
None of these are ideal for production use.
References
- 主要语言
- Go
- 星标
- 1.1k
- 派生
- 70
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 54
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hookdeck/outpost 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 67/100
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
hookdeck/outpost#1117 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 72/100
kube-tarian/sigrun#202 ·
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 82/100
eugenioenko/ttt#1085 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
fullsend-ai/fullsend#8688 · 1 条评论 ·
维护者通常 1 天内回复
-
question raised-by:verifier
难度 2/5 1-3 小时 新手友好度 72/100
medici-finance/assay#4013 ·
维护者通常 1 天内回复