Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

[Enhancement]: Enable mungectl to set file access permissions on the munge key file #5

Description

@NucciTheBoss

mungectl currently just sets the munge.key file owner to user root and group root. We should allow administrators to set the user and group that will own the munge.key. The root user works as a default, but typically administrators will use a dedicated munge user and group to own the key.

We should also enable administrators to set the mode of the munge.key file. Right now we're using the default mode which works, but some may want to set a mode of 0o600 so that only the munge user can read the key.

This is a relatively easy addition since we just need to add some additional flags to the generate and set subcommands that feed into the os package:

mungectl key generate -u/--user -g/--group -m/--mode
mungectl key set -u/--user -g/--group -m/--mode

...

os.Chmod("/path/to/keyfile", ...)
os.Chown("/path/to/keyfile", ..., ...)

We could also add support for configuring a default user, group, and mode so that the administrator isn't required to pass these flags every time using viper.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions