Skip to content

Commit

Permalink
The access token is now passed in a http header (#83)
Browse files Browse the repository at this point in the history
This is done to avoid exposure as the data.http.id (which contains
the URL) in the logs.
  • Loading branch information
boris-dyga-SM authored Feb 1, 2024
1 parent 9cbefc9 commit ece5d22
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
# Crash log files
crash.log
test.log

# MacOS service files
.DS_Store

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Available targets:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.33.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.33.0 |

## Modules

Expand Down
10 changes: 2 additions & 8 deletions modules/conformance-pack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ resource "aws_config_conformance_pack" "default" {
}

data "http" "conformance_pack" {
/*
To access a public GitHub repo the following URL is used:
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/<path_to_file>
To access a private GitHub repo an access token with appropriate permissions should be generated first and then provided in the url:
https://<private_access_token>@raw.githubusercontent.com/<owner>/<repo>/<branch>/<path_to_file>
*/

url = var.access_token == "" ? var.conformance_pack : "${split("://", var.conformance_pack)[0]}://${var.access_token}@${split("://", var.conformance_pack)[1]}"
url = var.conformance_pack
request_headers = var.access_token == "" ? {} : { Authorization = "token ${var.access_token}" }
}

0 comments on commit ece5d22

Please sign in to comment.