Skip to content

Commit 4c4dd0f

Browse files
authored
Merge pull request #7129 from hashicorp/b-consistent-ct-name
command: use consistent CONSUL_HTTP_TOKEN name
2 parents 0a93ddd + 7173cb2 commit 4c4dd0f

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ BUG FIXES:
3737
* scheduler: Fixed a bug that caused evicted allocs on a lost node to be stuck in running [[GH-6902](https://github.com/hashicorp/nomad/issues/6902)]
3838
* scheduler: Fixed a bug where `nomad job plan/apply` returned errors instead of ignoring system job updates for ineligible nodes. [[GH-6996](https://github.com/hashicorp/nomad/issues/6996)]
3939

40+
SECURITY:
41+
42+
* client: Nomad will no longer pass through the `CONSUL_HTTP_TOKEN` environment variable when launching a task. [[GH-7131](https://github.com/hashicorp/nomad/issues/7131)]
43+
4044
## 0.10.3 (January 29, 2020)
4145

4246
SECURITY:

client/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var (
2323
// filtered when passing the environment variables of the host to a task.
2424
DefaultEnvBlacklist = strings.Join([]string{
2525
"CONSUL_TOKEN",
26+
"CONSUL_HTTP_TOKEN",
2627
"VAULT_TOKEN",
2728
"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN",
2829
"GOOGLE_APPLICATION_CREDENTIALS",

command/job_revert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (c *JobRevertCommand) Run(args []string) int {
113113
// Parse the Consul token
114114
if consulToken == "" {
115115
// Check the environment variable
116-
consulToken = os.Getenv("CONSUL_TOKEN")
116+
consulToken = os.Getenv("CONSUL_HTTP_TOKEN")
117117
}
118118

119119
// Parse the Vault token

command/job_run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Alias: nomad run
5454
5555
The run command will set the consul_token of the job based on the following
5656
precedence, going from highest to lowest: the -consul-token flag, the
57-
$CONSUL_TOKEN environment variable and finally the value in the job file.
57+
$CONSUL_HTTP_TOKEN environment variable and finally the value in the job file.
5858
5959
The run command will set the vault_token of the job based on the following
6060
precedence, going from highest to lowest: the -vault-token flag, the
@@ -89,7 +89,7 @@ Run Options:
8989
-consul-token
9090
If set, the passed Consul token is stored in the job before sending to the
9191
Nomad servers. This allows passing the Consul token without storing it in
92-
the job file. This overrides the token found in $CONSUL_TOKEN environment
92+
the job file. This overrides the token found in $CONSUL_HTTP_TOKEN environment
9393
variable and that found in the job.
9494
9595
-vault-token
@@ -190,7 +190,7 @@ func (c *JobRunCommand) Run(args []string) int {
190190
// Parse the Consul token
191191
if consulToken == "" {
192192
// Check the environment variable
193-
consulToken = os.Getenv("CONSUL_TOKEN")
193+
consulToken = os.Getenv("CONSUL_HTTP_TOKEN")
194194
}
195195

196196
if consulToken != "" {

nomad/structs/config/consul.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func DefaultConsulConfig() *ConsulConfig {
145145
// creation of Consul Service Identity tokens for Consul Connect enabled Tasks.
146146
//
147147
// If allow_unauthenticated is false, the operator must provide a token on
148-
// job submission (i.e. -consul-token or $CONSUL_TOKEN).
148+
// job submission (i.e. -consul-token or $CONSUL_HTTP_TOKEN).
149149
func (c *ConsulConfig) AllowsUnauthenticated() bool {
150150
return c.AllowUnauthenticated != nil && *c.AllowUnauthenticated
151151
}

0 commit comments

Comments
 (0)