Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Feature Request: Add support for AWS IAM roles (ECS Task Role / EC2 Instance Profile) for SQS authentication

Abierto
#463 4 comentarios 8 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
aws, go
Área
backend, cloud

Línea de trabajo

Comienza en internal/config/mqconfig_aws.go y el método IsConfigured() citado en el issue, y luego rastrea dónde la validación de configuración lanza 'message queue configuration is required' y dónde se construye el cliente SQS (para confirmar que depende de la cadena de credenciales predeterminada del AWS SDK). Encuentra los tests de validación de configuración que cubren AWSSQSConfig y añade casos para entornos de rol IAM. Hecho significa que IsConfigured() devuelve true con solo Region configurado cuando está presente AWS_CONTAINER_CREDENTIALS_* o AWS_EXECUTION_ENV, que las claves explícitas siguen funcionando y que los tests de configuración existentes pasan.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

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:

  1. Detecting when running in an AWS environment with IAM roles available
  2. Using the AWS SDK's default credential provider chain
  3. 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:

  1. Creating IAM users with access keys (security anti-pattern)
  2. Using a sidecar container to provide credentials
  3. Forking Outpost to add IAM role support

None of these are ideal for production use.

References

Lenguaje dominante
Go
Estrellas
1.1k
Forks
70
Merge medio
1 d 18 h
PR fusionados (30 d)
56

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hookdeck/outpost

Todos los issues de hookdeck/outpost

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.