diff --git a/CHANGELOG.md b/CHANGELOG.md index 23a2ee2..3ec332d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ cookbook-rb-proxy CHANGELOG =============== +## 2.0.0 + + - Miguel Negron + - [6e7bc6a] Add sudoers config + ## 1.0.1 - Miguel Negrón diff --git a/resources/metadata.rb b/resources/metadata.rb index 4bee5cf..75bb40b 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -3,7 +3,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder proxy' -version '1.0.1' +version '2.0.0' depends 'rb-common' depends 'rb-selinux' diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 444bbae..dcb77b9 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -211,3 +211,12 @@ # mode 'proxy' # action (node['redborder']['services']['radiusd'] ? [:config_common] : [:remove]) # end + +template '/etc/sudoers.d/redBorder' do + source 'redBorder.erb' + cookbook 'rb-proxy' + owner 'root' + group 'root' + mode '0440' + retries 2 +end diff --git a/resources/templates/default/redBorder.erb b/resources/templates/default/redBorder.erb new file mode 100644 index 0000000..d54a3bd --- /dev/null +++ b/resources/templates/default/redBorder.erb @@ -0,0 +1,18 @@ +<%####################################################################### %> +<%# Copyright (c) 2024 ENEO Tecnología S.L. %> +<%# This file is part of redBorder. %> +<%# redBorder is free software: you can redistribute it and/or modify %> +<%# it under the terms of the GNU Affero General Public License License as published by %> +<%# the Free Software Foundation, either version 3 of the License, or %> +<%# (at your option) any later version. %> +<%# redBorder is distributed in the hope that it will be useful, %> +<%# but WITHOUT ANY WARRANTY; without even the implied warranty of %> +<%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %> +<%# GNU Affero General Public License License for more details. %> +<%# You should have received a copy of the GNU Affero General Public License License %> +<%# along with redBorder. If not, see . %> +<%####################################################################### %> +Defaults:redborder !requiretty +Defaults:redborder-monitor !requiretty, !syslog +redborder ALL= NOPASSWD:SETENV: /usr/lib/redborder/bin/rb_wakeup_chef.sh, /usr/lib/redborder/bin/rb_disassociate.sh -f, /sbin/service chef-client restart +redborder-monitor ALL= NOPASSWD: /usr/lib/redborder/bin/rb_get_sensor.sh, /usr/lib/redborder/bin/cachestat.sh, /bin/nice -n 19 /usr/sbin/fping -p 1 -c 10 *, /usr/lib/redborder/bin/rb_mem.sh *