1
0
Fork 0
mirror of synced 2024-12-21 21:51:09 -05:00

adding network group specs to sudoers

This commit is contained in:
Garrett Marone 2015-12-08 08:41:40 -08:00 committed by root
parent 2045591a9d
commit 2c42eafbad
2 changed files with 14 additions and 0 deletions

View file

@ -7,6 +7,10 @@ sudoers:
sudo:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
network_groups:
my-network-admin-group:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
defaults:
generic:
- env_reset

View file

@ -13,6 +13,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {'root': ['ALL=(ALL:ALL) ALL']}) %}
{%- set groups = sudoers.get('groups', {'sudo': ['ALL=(ALL:ALL) ALL']}) %}
{%- set network_groups = sudoers.get('network_groups', {'sudo': ['ALL=(ALL:ALL) ALL']}) %}
{%- else %}
{%- set defaults = sudoers.get('defaults', {}) %}
{%- set generic_defaults = defaults.get('generic', []) %}
@ -22,6 +23,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {}) %}
{%- set groups = sudoers.get('groups', {}) %}
{%- set network_groups = sudoers.get('network_groups', {}) %}
{%- endif %}
{%- set includedir = sudoers.get('includedir', '/etc/sudoers.d') -%}
{%- else %}
@ -33,6 +35,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {}) %}
{%- set groups = sudoers.get('groups', {}) %}
{%- set network_groups = sudoers.get('network_groups', {}) %}
{%- set includedir = sudoers.get('includedir', None) %}
{%- endif %}
{%- set aliases = sudoers.get('aliases', {}) %}
@ -95,6 +98,13 @@ Runas_Alias {{ name }} = {{ ",".join(runas) }}
{%- endfor %}
{%- endfor %}
# Network Group privilege specification
{%- for group,specs in network_groups.items() %}
{%- for spec in specs %}
+{{ group }} {{ spec }}
{%- endfor %}
{%- endfor %}
{% if includedir %}
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)