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

build(deps): bump github.com/hashicorp/consul-template from 0.25.2 to 0.28.0 #12187

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 4, 2022

Bumps github.com/hashicorp/consul-template from 0.25.2 to 0.28.0.

Changelog

Sourced from github.com/hashicorp/consul-template's changelog.

v0.28.0 (Mar 04, 2022)

BUG FIXES:

  • Fix issue returning typed nil pointers in template functions [GH-1535, GH-1418]
  • Support secret write queries w/ an empty write [GH-1532, GH-1453]

IMPROVEMENTS:

v0.27.2 (Nov 05, 2021)

BUG FIXES:

v0.27.1 (Sep 22, 2021)

IMPROVEMENTS:

  • Updated command execution on *nix systems to call the command directly, without the sh -c wrapping shell command, only in cases where the command is a single word (no spaces). This allows docker to run in environments (like a minimal docker image) where there is no shell (sh). Multi-word commands will continue to use the wrapping shell call. [GH-1509, GH-1508]

SECURITY:

v0.27.0 (Aug 16, 2021)

BREAKING CHANGES:

  • All command execution calls are now made (on *nix systems) using a shell command call ('/bin/sh -c ...') with process group set to ensure all signals are propagated to the called commands. This was done to eliminate the need for parsing the shell command as it was a continual source of bugs. Windows systems currently only support single command calls because of no (known) 'sh -c' equivalent on Windows. [GH-1496, GH-1494]

IMPROVEMENTS:

  • New Docker Image. Similar to old Alpine image but modernized and simplified [GH-1481, GH-1484]
  • New, more obvious, log level environment variable [GH-1383]
  • New 'writeToFile' template function [GH-1495, GH-1077]
  • New mergeMap and mergeMapWithOverride template functions [GH-1500, GH-1499].

BUG FIXES:

... (truncated)

Commits
  • ae2bbca Release v0.28.0
  • 1dd876f changelog and version updates for 0.28.0
  • be5fcd8 support command lists
  • 14a926e Allow the child to be provided a custom logger.
  • 2bf43d8 made timing based tests a bit more lenient
  • f9dd3bb Merge branch 'phemmer-template-error-fatal'
  • 1f3d98f Merge branch 'template-error-fatal' of github.com:phemmer/consul-template int...
  • 3ea7d99 bumping consul/vault version for CI
  • d874405 Merge pull request #1531 from deblasis/template_output_pragmatic_chown
  • fc22b48 Merge pull request #1516 from lawliet89/http-token-file
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/hashicorp/consul-template](https://github.com/hashicorp/consul-template) from 0.25.2 to 0.28.0.
- [Release notes](https://github.com/hashicorp/consul-template/releases)
- [Changelog](https://github.com/hashicorp/consul-template/blob/master/CHANGELOG.md)
- [Commits](hashicorp/consul-template@v0.25.2...v0.28.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/consul-template
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ensure that the new writeToFile function honors the sandbox_path before merging this.

@angrycub angrycub removed their assignment Mar 15, 2022
@angrycub
Copy link
Contributor

Unassigned myself. Not sure why dependabot threw me under that bus.

@schmichael
Copy link
Member

consul-template 0.28.0 does not appear to honor SandboxPath, so we can't merge it as-is.

Even more worrying is that the function chowns and chmods which seems ripe for a setuid-style attack. Luckily it appears the mode is masked which prevents that.

My inclination is to disable writeToFile by default via our client.template.function_denylist configuration parameter until a user comes forward with a compelling use case. Using multiple template stanzas seems like a more idiomatic approach to this functionality in Nomad and doesn't create any new security issues.

@ip-sf
Copy link

ip-sf commented Mar 28, 2022

until a user comes forward with a compelling use case.

I could perhaps offer one:

When trying to deploy a MongoDB Cluster via Nomad, the replica key that mongodb uses (PSK Symmetrical) has to have a UID/GID that is accessible by the Mongo user AND be set to perms: X00. Because of how all the internals work, the created template file is not accessible by mongo with default UID/GID and file RWX permissions.

Being able to simply add UID/GID would overcome this blocker:

template { 
  destination   = "local/mongo_replica.key"
  perms         = "600"
  uid           = 999
  gid           = 999
  change_mode   = "signal"
  change_signal = "SIGHUP"
  data          = <<-EOF
    ---
    - "SomeDummyKey"
  EOF
}

When setting perms: 640, the following error prevents mongod from starting
{"t":{"$date":"2022-03-28T19:42:03.879+00:00"},"s":"I", "c":"ACCESS", "id":20254, "ctx":"thread1","msg":"Read security file failed","attr":{"error":{"code":30,"codeName":"InvalidPath","errmsg":"permissions on /etc/mongo_replica.key are too open"}}}

setting to perms: 600:
{"t":{"$date":"2022-03-28T19:37:26.129+00:00"},"s":"I", "c":"ACCESS", "id":20254, "ctx":"main","msg":"Read security file failed","attr":{"error":{"code":30,"codeName":"InvalidPath","errmsg":"error opening file: /etc/mongo_replica.key: bad file"}}}

Which is counter-intuitive on the surface. Mongod is telling us that 'I can't read the file' because it's using the user mongod, but the file created is owned by root.

@schmichael
Copy link
Member

@ip-sf Thanks for sharing your use case! Setting the owner and permissions of rendered templates is covered by #5020. writeToFile would be another way to accomplish this, but we will not be enabling it for Nomad 1.3. See #12095 (comment) for details on writeToFile if you're curious.

We do peek at reaction emoji, so please vote on whatever issues are a priority for you.

@schmichael
Copy link
Member

Closing in favor of #12312 which disables writeToFile by default. See #12095 for details.

@schmichael schmichael closed this Mar 28, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 28, 2022

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/go_modules/github.com/hashicorp/consul-template-0.28.0 branch March 28, 2022 20:23
@ip-sf
Copy link

ip-sf commented Mar 28, 2022

@schmichael Thank you for the quick response and info!

I understand the reasoning for the actions being taken.

A question: If I am understanding this comment correctly:

See #12095 (comment) for details on writeToFile if you're curious.

I assume this is saying: We (royal) will disable this by default for , but if someone was so inclined they could set their own denylist and override the default, effectively re-enabling it and accepting any potential security implications?

If my understanding is correct, then thank you and that should serve as an appropriate workaround for my use case.

In any event, thank you personally for all you have done for the community!

@3nprob
Copy link

3nprob commented Mar 29, 2022

@ip-sf Sounds about right. It can be overridden here: https://www.nomadproject.io/docs/configuration/client#function_denylist=

@schmichael
Copy link
Member

We (royal) will disable this

Ha, yes, I suppose I can just say I 😅

if someone was so inclined they could set their own denylist and override the default, effectively re-enabling it and accepting any potential security implications

Yes, @3nprob is right. I want to make Nomad secure-by-default but configurable.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/dependencies Pull requests that update a dependency file theme/template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants