Skip to content

Commit 704051b

Browse files
authored
Resolve security review findings (#60)
* limit file permissions to owner-only read * restrict api command to https & profile host * update image in README * anonymize hostname telemetry when not known * CHANGELOG entries * fix hostname handling- validate and strip scheme * bump go-tfe to v2.0.0-beta1 * Update BUG FIXES-20260616-150538.yaml * review feedback * normalize hostnames from env * Update README.md * add debug clarity about which credential is used * Update profile.go * fix URL parse error, credential fallback, more log * rely on go-tfe to not send tokens to unallowed host * correct help text for --quiet * accept any response, not just application/vnd.api+json * ensure we don't send tokens to unconfigured hosts * Update README.md * add prediction for agents during harness install * modify CHANGELOG entries * adds support for IP address hostnames * reorder imports * bump go-tfe to v2.0.0
1 parent d7a8e1d commit 704051b

37 files changed

Lines changed: 597 additions & 254 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: BUG FIXES
2+
body: Profile configuration files are now created with read/write permissions for owner only.
3+
time: 2026-06-16T15:05:38.766655-06:00
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: BUG FIXES
2+
body: Hostname telemetry is anonymized when configured with a Terraform Enterprise host.
3+
time: 2026-06-16T15:06:04.201058-06:00
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
kind: ENHANCEMENTS
2-
body: The `tfctl harness install amp` command now supports installing the `tfctl` skill into the directories that Amp looks for.
2+
body: The `harness install` command supports shell autocompletion for supported coding agents and support for the Amp coding agent has been added.
33
time: 2026-06-18T11:15:24.079775-04:00
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: ENHANCEMENTS
2+
body: Adds debug logging for token configuration sources.
3+
time: 2026-06-18T14:57:00.037019-06:00
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: ENHANCEMENTS
2+
body: Hostnames are normalized before storage within profiles.
3+
time: 2026-06-18T14:58:10.514394-06:00
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: ENHANCEMENTS
2+
body: The `api` command now accepts arbitrary URLs, such as Archivist, but does not send tokens to any host except the configured API host.
3+
time: 2026-06-18T14:59:05.436321-06:00

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Comprehensive, official CLI access to the HCP Terraform / Terraform Enterprise p
66

77
The `tfctl` CLI provides high-level commands for common workflows, such as managing runs, variables, and workspaces, and direct API access for advanced automation. It supports multiple configuration profiles, allowing you to switch between different HCP Terraform organizations and Terraform Enterprise instances. It also integrates with AI coding agents to facilitate agent-assisted management of Terraform workflows.
88

9-
![tfctl](assets/hero.gif "tfctl")
9+
![tfctl](assets/demo.gif "tfctl demo")
1010

1111
## Installation
1212
You can install the CLI, command completion utility, and agent skill separately.
@@ -41,6 +41,7 @@ You can uninstall shell completion with the `tfctl --autocomplete-uninstall` com
4141

4242
The `tfctl` CLI ships with an agent skill that gives AI coding agents access to HCP Terraform through the `tfctl` command, but discourages non-human delete operations. You can install it using the `tfctl harness install` command or NPX. Replace `<agent>` with one of the following supported AI agents:
4343

44+
- `amp`
4445
- `antigravity`
4546
- `bob`
4647
- `claude`
@@ -89,9 +90,9 @@ Verify that the login is successful before leaving the token page in your browse
8990

9091
If the CLI does not find a token configured for the active profile, it checks your Terraform configuration for a matching token. Refer to [Terraform tokens](#terraform-tokens) for more information.
9192

92-
### Set organization
93+
### Set default organization
9394

94-
Run the `tfctl profile set default_organization` command to set the organization. Replace `<name>` with your HCP Terraform or Terraform Enterprise organization name.
95+
Run the `tfctl profile set default_organization` command to set the default organization. Replace `<name>` with your HCP Terraform or Terraform Enterprise organization name.
9596

9697
```bash
9798
$ tfctl profile set default_organization <name>
@@ -172,7 +173,7 @@ If you have not configured a particular option for the active profile, `tfctl` c
172173

173174
`TFCTL_HOSTNAME`: The Terraform Enterprise or HCP Terraform hostname to use. Defaults to `app.terraform.io`.
174175

175-
`TFCTL_TOKEN`: An HCP Terraform API token to use in conjunction with the default profile.
176+
`TFCTL_TOKEN`: An HCP Terraform API token to use in conjunction with the default profile. This variable is not used in conjunction with any other profile.
176177

177178
`TFCTL_TOKEN_<profile>`: An HCP Terraform API token to use in conjunction with the named profile.
178179

@@ -218,7 +219,7 @@ Use the `--help` flag to print out detailed usage instructions. For example, `tf
218219
- Data type: String
219220
- Optional parameter.
220221

221-
- `--quiet`: Minimizes output and disables interactive prompting.
222+
- `--quiet`: Minimizes output to stdout.
222223
- Data type: Boolean flag
223224
- Defaults to `false`.
224225

assets/demo.gif

86.9 KB
Loading

assets/hero.png

-129 KB
Binary file not shown.

assets/tfctl.png

-5.13 KB
Loading

0 commit comments

Comments
 (0)