Skip to content

Expose unique response identifier for web identity credentials #483

@ianonavy

Description

@ianonavy

All opinions my own.

For organizations that use GitHub Actions and audit events with CloudTrail, it is useful to have joinable metadata to link specific GitHub Actions jobs to CloudTrail events. This allows security auditors to verify end-to-end the population of AWS operations invoked by a particular GitHub Actions workflow run attempt. I propose one of two approaches:

Approach 1: Allow configuration of masking policy for AWS Access Key ID

The AWS_ACCESS_KEY_ID is unique to a particular invocation of configure-aws-credentials as well as unique to a particular AssumeRoleWithWebIdentity event in CloudTrail. Since the access key IDs are temporary and the secret access keys are masked, one option might be to allow users to disable access key ID mapping such that they can be logged for traceability.

Example use case:

    - name: Configure AWS credentials from Test account
      uses: aws-actions/configure-aws-credentials@v1
      with:
        role-to-assume: arn:aws:iam::111111111111:role/my-github-actions-role-test
        aws-region: us-east-1
        mask-access-key-id: false

The API and implementation would probably be similar to the existing one for the AWS account ID.

Approach 2: Expose raw assume role ID

Assuming that assume role IDs are indeed unique to a particular AssumeRoleWithWebIdentity request, then adding data.AssumedRoleUser.AssumedRoleId the outputs of this action would allow end users to log it.

Example use case:

    - name: Configure AWS credentials from Test account
      uses: aws-actions/configure-aws-credentials@v1
      with:
        role-to-assume: arn:aws:iam::111111111111:role/my-github-actions-role-test
        aws-region: us-east-1
        output-assumed-role-id: true

We also considered using the configurable role-session-name, but we'd rather not rely on user-controlled inputs. In my opinion, the default behavior of the action should be to produce auditable metadata that can be emitted in logs on the GitHub Actions side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/smallThis issue will take less than a day of effort to fixfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions