Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README to ref SECURE logs level #734

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The `go-pagerduty` library relies on various APIs to interact with PagerDuty's r
### To activate caching support

| Environment Variable | Example Value | Description |
| -------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| TF_PAGERDUTY_CACHE | memory | Activate **In Memory** cache. |
| TF_PAGERDUTY_CACHE | `mongodb+srv://[mongouser]:[mongopass]@[mongodbname].[mongosubdomain].mongodb.net` | Activate MongoDB cache. |
| TF_PAGERDUTY_CACHE_MAX_AGE | 30s | Only applicable for MongoDB cache. Time in seconds for cached data to become staled. Default value `10s`. |
Expand Down Expand Up @@ -144,6 +144,24 @@ $ go mod vendor
$ tail -f /PATH/TO/YOUR/LOG_FILE.log
```

### Secure Logs Level

In addition to the [log levels provided by Terraform](https://developer.hashicorp.com/terraform/internals/debugging), namely `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR` (in descending order of verbosity), the PagerDuty Provider introduces an extra level called `SECURE`. This level offers verbosity similar to Terraform's debug logging level, specifically for the output of API calls and HTTP request/response logs. The key difference is that API keys within the request's Authorization header will be obfuscated, revealing only the last four characters. An example is provided below:

```sh
---[ REQUEST ]---------------------------------------
GET /teams/DER8RFS HTTP/1.1
Accept: application/vnd.pagerduty+json;version=2
Authorization: <OBSCURED>kCjQ
Content-Type: application/json
User-Agent: (darwin arm64) Terraform/1.5.1
```

To enable the `SECURE` log level, you must set two environment variables:

* `TF_LOG=INFO`
* `TF_LOG_PROVIDER_PAGERDUTY=SECURE`

## Testing

In order to test the provider, you can simply run `make test`.
Expand Down
Loading