-
Notifications
You must be signed in to change notification settings - Fork 781
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
Knob to blacklist some template functions #1243
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exposes a knob for consul-template library users to disable some template functions. Functions like `env` and `plugin` may access sensitive values on host and are best disabled unilaterally.
I've pushed a commit on top of this with the following changes:
Here's what this looks like from the user's perspective: demo.hcl: template {
source = "./demo.conf",
function_blacklist = ["plugin"],
} demo.conf:
demo: $ echo 'SUPER_SECRET_SHOULD_NOT_SEE' > ./secret_file.txt
$ make dev
==> Installing consul-template for darwin/amd64
$ consul-template -log-level=debug -config=./demo.hcl -dry -once
2019/08/02 14:57:43.041320 [ERR] (cli) ./demo.conf: execute: template: :2:3: executing "" at <plugin "/bin/cat" "./secret_file.txt">: error calling plugin: function is disabled |
@tgross Do you have time to update the config example in the README.md with function_blacklist? I think between the delimiters and the wait is the best spot. |
@eikenb I've done that. How's that look? |
Looks good. Thanks. |
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 2, 2019
pulls in configuration option for blacklisting template functions from hashicorp/consul-template#1243
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 5, 2019
pulls in configuration option for blacklisting template functions from hashicorp/consul-template#1243 hashicorp/consul-template#1246
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 8, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 9, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 9, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249 hashicorp/consul-template#1254 [wip consul-template]
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 12, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249 hashicorp/consul-template#1254 pulls in vault KVv2 read fixes from: hashicorp/consul-template#1253
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 12, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249 hashicorp/consul-template#1254 pulls in vault KVv2 read fixes from: hashicorp/consul-template#1253
tgross
added a commit
to hashicorp/nomad
that referenced
this pull request
Aug 12, 2019
pulls in configuration option for blacklisting template functions from: hashicorp/consul-template#1243 hashicorp/consul-template#1246 pulls in configuration option for file sandboxing from: hashicorp/consul-template#1249 hashicorp/consul-template#1254 pulls in vault KVv2 read fixes from: hashicorp/consul-template#1253
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Exposes a knob for consul-template library users to disable some template functions. Functions like
env
andplugin
may access sensitive values on host and are best disabled unilaterally.