hashicorp / hashicorp/setup-terraform

sensitive values exposed

Open
#14 5 comments 10 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
1.6k
Forks
288
Avg merge
23h 21m
Merged PRs (30d)
3

Description

If an output marked as sensitive is specifically output, then the sensitive value is exposed in the workflow log.

For example, if I have the following outputs:
```yaml
output "access_key_id" {
value = aws_iam_access_key.user.id
description = "Access key id for test user"
sensitive = true
}

output "secret_access_key" {
value = aws_iam_access_key.user.secret
description = "Secret access key for test user"
sensitive = true
}
```
I see the following output from `terraform apply`:
```
Outputs:

access_key_id =
secret_access_key =
```

However, if I try the following:
```
- id: show-secret
run: terraform output secret_access_key
- run: |
echo "::add-mask::${{ steps.show-secret.outputs.stdout }}"
echo "${{ steps.show-secret.outputs.stdout }}"
```
I see the following output in the Actions log:
```
echo "::add-mask::
"
echo "
"
```

Consumers of this action are not able to mask the values themselves due to Github Actions' streaming output. According to [this comment](https://github.com/actions/runner/issues/475#issuecomment-635651102), this action would need to call `set-mask` before calling `set-output`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.