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

Split /etc/wargate.yaml, have /etc/warpgate/ directory. #24

Closed
stappersg opened this issue Apr 16, 2022 · 2 comments
Closed

Split /etc/wargate.yaml, have /etc/warpgate/ directory. #24

stappersg opened this issue Apr 16, 2022 · 2 comments

Comments

@stappersg
Copy link
Contributor

This is feature request issue, it asks to split /etc/warp.yaml into several files.

Having only seen documentation of warpgate ( not having tried it ) there is only one big configuration file.

The idea:

/etc/
/etc/warpgate/
/etc/warpgate/main
/etc/warpgate/target/
/etc/warpgate/target/foo
/etc/warpgate/target/bar
/etc/warpgate/role/
/etc/warpgate/role/wgadmin
/etc/warpgate/role/engineer
/etc/warpgate/user/
/etc/warpgate/user/alice
/etc/warpgate/user/bob

What ends with a /, is a _directory.

/etc/warpgate/main is the YAML file that defines ssh port, webUI port and other main configuration.

In /etc/warpgate/target/foo is content like

   - name: foo
     allow_roles:
       - "warpgate:admin"
     ssh:
       host: 192.168.10.20
       username: root  # optional
       port: 22  # optional

In /etc/warpgate/user/alice is content like:

    - username: alice
      credentials:
        - type: password
          hash: "$argon2id$v=19$m=4096,...eq6Hog"
        - type: publickey
          key: ssh-ed25519 AAAAC3Nz...D4I

The advantages I see:

  • the warpgate process does not need write privilege in /etc/
  • changes in targets, users and roles don't need rewrite of one big fat single configuration file
  • adding and removal of users and targets can easy be done by other tooling as warpgate (think ansible or just cp and just rm)
@nikaro
Copy link

nikaro commented Apr 17, 2022

If you use Ansible you should use the "one big file" to ensure that you did not forget an user somewhere in a sub directory. And you don’t have to worry that your file is big since it is generated.

@Eugeny
Copy link
Member

Eugeny commented Sep 7, 2022

The upcoming v0.6 release will use database as the primary storage for targets/users/roles, allowing adding/editing them through the API. Storing them in the config file is now deprecated.

@Eugeny Eugeny closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants