Skip to content

vault: 0.6.5 -> 0.7.2 with service #26130

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

Closed
wants to merge 2 commits into from
Closed

vault: 0.6.5 -> 0.7.2 with service #26130

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented May 26, 2017

Motivation for this change

Updating vault and a service to run it !

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@mention-bot
Copy link

@katyucha, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pradeepchhetri, @edolstra and @offlinehacker to be potential reviewers.


${if cfg.telemetry.extraConfig != "" then "
telemetry {
${if cfg.telemetry.disable_hostname then "disable_hostname = \"true\"" else ""}
Copy link
Member

Choose a reason for hiding this comment

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

telemetry.disable_hostname only takes effect if telemetry.extraConfig is set?

Copy link
Author

Choose a reason for hiding this comment

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

No need of this parameter if you doesn't set telemetry destination in extraConfig like a statsd, circonus or statsite...

Copy link
Member

Choose a reason for hiding this comment

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

I see, so this is self-hosted telemetry and not external. Thanks for the clarification!

Copy link
Contributor

@cstrahan cstrahan left a comment

Choose a reason for hiding this comment

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

Overall, this looks great! Just pointed out some changes that I think would improve things a bit.

};

tls_disable = mkOption {
type = types.str;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use types.bool.

Copy link
Author

Choose a reason for hiding this comment

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

Done

};

tls_min_version = mkOption {
type = types.str;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use something like types.enum [ "tls10" "tls11" "tls12" ]

Copy link
Author

Choose a reason for hiding this comment

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

Done

};

cluster_address = mkOption {
type = types.str;
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than using "" to denote an unset cluster_address, I'd recommend making this types.nullOr types.str, with default = null.

Copy link
Author

Choose a reason for hiding this comment

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

all right, I'll write that for others string else " ''

};

tls_prefer_server_cipher_suites = mkOption {
type = types.str;
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be something like types.nullOr (types.enum [ "tls10" "tls11" "tls12" ]).

Copy link
Author

Choose a reason for hiding this comment

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

Hi. I note for TLS but for Cipher, it's a big list you can see here: https://golang.org/src/crypto/tls/cipher_suites.go . Is types.enum a little bit crazy for this case ?

};

tls_require_and_verify_client_cert = mkOption {
type = types.str;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be types.bool.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@ghost ghost changed the title vault: 0.6.5 -> 0.7.1 with service WIP: vault: 0.6.5 -> 0.7.1 with service May 27, 2017
@ghost ghost changed the title WIP: vault: 0.6.5 -> 0.7.1 with service vault: 0.6.5 -> 0.7.1 with service May 28, 2017
@pSub pSub added 8.has: package (update) This PR updates a package to a newer version 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels May 28, 2017
Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

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

updated

@joelthompson
Copy link
Contributor

Hi @katyucha -- this looks cool!

Is there a reason you're bumping Vault to 0.7.1 and not 0.7.2, which fixes a bug with the audit logging?


${if cfg.listener.tls_prefer_server_cipher_suites then "tls_prefer_server_cipher_suites = \"true\"" else "tls_prefer_server_cipher_suites = \"false\"" }

${if cfg.listener.tls_require_and_verify_client_cert then "tls_require_and_verify_client_cert = \"true\"" else "tls_require_and_verify_client_cert = \"false\"" }
Copy link
Member

Choose a reason for hiding this comment

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

You could use:

tls_require_and_verify_client_cert = "${boolToString cfg.listener.tls_require_and_verify_client_cert}";

or even abstract it some more and use it on more places:

let boolOption = name: opt: "${name} = \"${boolToString opt}\"";
in ''
  ${boolOption "tls_prefer_server_cipher_suites" cfg.listener.tls_require_and_verify_client_cert}
'';

So you don't have to repeat yourself. Same with the string options. :)

@ghost ghost changed the title vault: 0.6.5 -> 0.7.1 with service WIP : vault: 0.6.5 -> 0.7.1 with service May 31, 2017
@ghost ghost changed the title WIP : vault: 0.6.5 -> 0.7.1 with service vault: 0.6.5 -> 0.7.2 with service Jun 1, 2017
Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Updated !

@ghost ghost changed the title vault: 0.6.5 -> 0.7.2 with service WIP: vault: 0.6.5 -> 0.7.2 with service Jun 6, 2017
@ghost ghost changed the title WIP: vault: 0.6.5 -> 0.7.2 with service vault: 0.6.5 -> 0.7.2 with service Jun 7, 2017

Verified

This commit was signed with the committer’s verified signature.
globin Robin Gloster
@joachifm
Copy link
Contributor

Is this ready to integrate?

@joelthompson
Copy link
Contributor

A question to security experts: should the daemon run as root (as now) or a vault user should be created for it ?

HashiCorp recommends NOT running as root:

Don't run as root. Vault is designed to run as an unprivileged user, and there is no reason to run Vault with root or Administrator privileges. Running Vault as a regular user reduces its privilege. Configuration files for Vault should have permissions set to restrict access to only the Vault user.

However, if you do run as non-root, you either need to disable_mlock in the config or set the ipc_lock capability. See the disable_mlock documentation

@joachifm
Copy link
Contributor

Some variation of serviceConfig.AmbientCapabilities = cap_ipc_lock perhaps.

@ghost
Copy link
Author

ghost commented Jun 29, 2017

Volt fork my MR ... no need of this now

@ghost ghost closed this Jun 29, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: package (update) This PR updates a package to a newer version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants