Git Product home page Git Product logo

puppet-freeradius's Issues

Support Puppet 6

Please add support for Puppet 6.
We are deprecating our (example42) freeradius module and will mention this module as replacement.

Error using freeradius::module::files resource and the source attribute

If this is not the correct forum for a question like this I apologize. Just attempting to figure out what I am doing incorrectly. Thank you for you time.

When using the following code:

#Configure file module here for mac authorization
  freeradius::module::files {'authorized_macs':
    source => 'puppet:///modules/pinn_radius/authorized_macs',
    key       => '%{Calling-Station-ID}',
  }

I receive and error Error:

Validation of File[/etc/raddb/mods-config/authorized_macs/authorize] failed: You cannot specify more than one of content, source, target at /etc/puppetlabs/code/environments/production/modules/freeradius/manifests/module/files.pp:52

When I use this instead no error occurs

#Configure file module here for mac authorization
  freeradius::module::files {'authorized_macs':
    key       => '%{Calling-Station-ID}',
    content => '[00:00:00:AA:FF:BB]',
  }

Do you have any thoughts on what I am doing incorrectly?

'netmask' field in client definitions is depricated in FR3

Tue Nov 24 10:47:54 2015 : Warning: 'netmask' field found in client testswitch is deprecated, use CIDR notation instead. Please fix your configuration
Tue Nov 24 10:47:54 2015 : Warning: Support for 'netmask' will be removed in a future release

Rename "master" to "main"

Proposing we use "main" as the primary branch, rather than "master". While I absolutely agree with the cultural reasons for this, I'm proposing this more because this is going with the flow of the industry.

PDK was updated to expect the git main branch to be "main". This is configurable, but having custom config in there for each instance this comes up feels like we'll be paddling against the flow.

I don't think this would a significant change - we would update any PRs in flight (and all but one are mine so fine by me!).

Directory permissions too tight

The permissions for a couple of directories are too tight, I think/etc/raddb and /var/log/freeradus can be relaxed to 0755, as it circumvents using tab completion for the config files when working with sudo on systems.

home_server_pool undefined method `each' for "xxx":String

When i try to use the ressources home_server_pool via a very simple configuration :

  freeradius::home_server { "localhost":
    secret => 'xxxx',
    ipaddr => '127.0.0.1',
  }

  freeradius::home_server_pool { "my_auth_failover":
    home_server => 'localhost',
  }

I got a error :

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Failed to parse template freeradius/home_server_pool.erb:
  Filepath: /etc/puppet/code/environments/radius/modules/freeradius/templates/home_server_pool.erb
  Line: 6
  Detail: undefined method `each' for "localhost":String
 at /etc/puppet/code/environments/radius/modules/freeradius/manifests/home_server_pool.pp:18:16

I'm not a puppet expert but it's look like, the file templates/home_server_pool.erb need a small change to work as expected :

diff templates/home_server_pool.erb templates/home_server_pool.erb.old 
6,7c6,7
< <% if defined?(@home_server) -%>
< 	home_server = <%= @home_server %>
---
> <% @home_server.each do |server| -%>
> 	home_server = <%= server %>

Unable to use module with debian/jessie and 1labs repo

Due to the validate_re failing the module, on Debian/Jessie I'm unable to bootstrap a working Freeradius from 1labs repo. Can this be replaced with a warning instead?

 apt::source { '1labs':
    comment  => "1Labs Freeradius ${release} repository",
    location => 'http://pkg.1labs.ch/debian',
    release  => "${release}-1labs",
    repos    => 'fr30-release',
    key      => {
      id     => '13C0A89B5C671AAB72DC07B47DADAF130A2FCD77',
    },
  } ->

  class { '::freeradius':
    preserve_mods => false,
    utils_support => true,
  }

Rework manifests to enable OS-independent testing

The manifests currently reference files by their full name, which makes creating specs difficult. Instead, the name should be generic, and have a path attribute, for example:

file { "${fr_moduleconfigpath}/attr_filter/${name}":

should be:

file { "freeradius attr_filter ${name}":
   path => "${fr_moduleconfigpath}/attr_filter/${name}",

Similarly, systemd units, etc. which differ per-OS should use a common name regardless of OS.

Currently, all the specs assume redhat, so only redhat is fully tested.

(I am currently working on this and testing in my environment, PR to come this week)

Config templates per version

3.2 is out - not in major distros yet AFAIK, but... at least I'm using it with home cut packages.

This will mean some config changes. Logic within the templates checking version numbers will be very messy and hard to update for new versions, I think - I am thinking in order to make this work we might need sets of config templates per version. Freeradius 4.0 will have similar needs.

We have had some changes in early 3.0.x to later 3.0.x which required template updates as well - which could have been perhaps better done as separate templates rather than updating in place.

I'm not too sure - I don't think we want to end up with a template tree for every version, but, backwards incompatible changes perhaps?

Perhaps a function to resolve template filenames - so we only create new ones if required, rather than lots of duplicates.
Gets a bit messy though, if we have a bugfix to one, we may have to update 3 or 4...

conditionals in eap.erb template break startup

Per https://github.com/djjudas21/puppet-freeradius/blob/3.5.0/templates/eap.erb#L126-L159 , a closing curly bracket can be left dangling is $eap_gtc is true (default) and $gtc_challenge is undef (default).

Here is the output I see when using nothing but the defaults... egrep -v '\s*#' /etc/raddb/mods-enabled/eap | grep -v '^$' (lines 11-12 are questionable):

eap {
  default_eap_type = md5
  timer_expire     = 60
  ignore_unknown_eap_types = no
  cisco_accounting_username_bug = no
  max_sessions = ${max_requests}
  md5 {
  }
  leap {
  }
    auth_type = PAP
  }
  tls-config tls-common {
    private_key_file = ${certdir}/server.pem
    certificate_file = ${certdir}/server.pem
    ca_file = ${certdir}/ca.pem
    dh_file = ${certdir}/dh
    ca_path = ${cadir}
    cipher_list = "DEFAULT"
    ecdh_curve = "prime256v1"
    cache {
      enable = yes
      max_entries = 255
    }
    verify {
    }
    ocsp {
      enable = no
      override_cert_url = yes
      url = "http://127.0.0.1/ocsp/"
    }
  }
  tls {
    tls = tls-common
  }
  ttls {
    tls = tls-common
    default_eap_type = md5
    copy_request_to_tunnel = no
    use_tunneled_reply = no
    virtual_server = "inner-tunnel"
  }
  peap {
    tls = tls-common
    default_eap_type = mschapv2
    copy_request_to_tunnel = no
    use_tunneled_reply = no
    virtual_server = "inner-tunnel"
}
  mschapv2 {
  }
}

I suspect you want to move the gtc { clause to above https://github.com/djjudas21/puppet-freeradius/blob/3.5.0/templates/eap.erb#L138 , but will leave that for you to decide.

Error I am seeing from radiusd -X:

/etc/raddb/mods-enabled/eap[604]: Too many closing braces
Errors reading or parsing /etc/raddb/radiusd.conf

Cheers.

Hiera usage (ldap/client)

hi,

I just want to ask, of there is any plan for Hiera support. I tried to configure for example the LDAP module, like

freeradius::module::ldap: 'ensure'
freeradius::module::ldap::identity: 'cn=webadmin,ou=Accounts,dc=example,dc=com'
freeradius::module::ldap::password: 'secret'
freeradius::module::ldap::basedn: 'ou=People,dc=example,dc=com'

but it seems not working. So either I calling the class wrong, or it won't work with Hiera, so I have to create a profile class.

Any suggestions ?

freeradius_version fact rspec

This issue was split out from #149 (comment)

It turns out if you have a fact which calls Facter.value for something, it runs whatever commands it needs, rather than using whatever comes from rspec-puppet-facts.

I think there are probably more modern ways to handle this - using confine or similar - but that's thing for another day.

Add Resources freeradius::listen in the README.md

on the documentation, it's missing the ressources freeradius::listen

I'm proposing something like this in the README :

#### `freeradius::listen`

Define listening interface 

##### `type`
Default: `auth`. 
Must be one of : Enum['auth','acct','proxy','detail','status','coa']

##### `ip`
Default: `undef`. The IPv4 address of the interface to listen. `ip` and `ip6` are mutually exclusive.

##### `port`
Default: `undef`.

##### `max_connections`
Default : 16

##### `lifetime`
Default : 0

##### `idle_timeout`
Default : 30

Needs FreeRADIUS 3 when it has FreeRADIUS 3.0.11

I have been using puppet for about 6 months and figured radius is a good candidate to "puppetize". I am running Ubuntu 15.10 which I know is not officially supported but it should be possible to fix things so that it will work. I have not written any modules so am limited in my knowledge in that area.

I have FreeRADIUS 3.0.11 installed on a client but when running the agent I get a message saying that it is only compatible with FreeRADIUS 3. I have changed that error to a warning, but then get into all kinds of missing things for logrotate. Any suggestions where to start?

$ freeradius -v
radiusd: FreeRADIUS Version 3.0.11, for host x86_64-pc-linux-gnu, built on Mar 25 2016 at 19:13:16
Copyright (C) 1999-2016 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
$ sudo /opt/puppetlabs/bin/puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, This module is only compatible with FreeRADIUS 3 at /etc/puppetlabs/code/environments/production/modules/freeradius/manifests/init.pp:17:5 on node sdga.vsdb.ca
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
$

Duplicate logrotate configs

Dist: Debian/Buster
Package: freeradius
Version: 3.0.17+dfsg-1.1

Logrotate fails with the following error, since the package distributed logrotate config and the puppet module config have duplicate definitions for radius log files:

logrotate[27780]: error: freeradius:18 duplicate log entry for /var/log/freeradius/checkrad.log
logrotate[27780]: error: found error in file freeradius, skipping
logrotate[27780]: error: radiusd:4 duplicate log entry for /var/log/freeradius/radius.log
logrotate[27780]: error: found error in file radiusd, skipping
systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE

Move params logic to hiera data

The puppet language style guide (https://puppet.com/docs/puppet/7.6/style_guide.html) recommends using data binding rather than the params.pp pattern.

As well as being a more "modern" way of doing things, this also allows the user to override anything that params.pp would currently be calculating - making the module a lot more flexible.

This has the negative impact that the module's supported minimum Puppet version would be 4.9, as this is when Hiera 5 with in-module hiera data support was added. Given this was released in 2017 I think this is an OK minimum version.

The current minimum version is 4.0.0 (2015).

An example of this would be:
hiera.yaml:

---
version: 5

defaults:
  datadir: data
  data_hash: yaml_data

hierarchy:
  - name: "osfamily+osname/major release"
    paths:
      - "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
      - "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
  - name: "osfamily+osname"
    paths:
      - "os/%{facts.os.name}.yaml"
      - "os/%{facts.os.family}.yaml"
  - name: 'common'
    path: 'common.yaml'

data/debian/9.yaml:

---
freeradius::package: freeradius
freeradius::raddbdir: '${sysconfdir}/freeradius/3.0'
#... etc ...

It would also mean making most (if not all) of the fr_* variables be straight params on the freeradius class, i.e., for the above examples:

class freeradius (
  String $package,
  String $raddbdir,
#  .. etc ..
) {
# .. code ..
}

Call for Maintainers!

This project has been a bit unloved since I switched jobs in 2018 and stopped using this FreeRADIUS Puppet module in production. Since then I've been happy to accept pull requests and release new versions, but it's becoming clear that the module could do with a new maintainer - someone who actually uses the module.

I have started conversations with Vox Pupuli, the Puppet community group who maintain third-party modules about taking ownership but I also wanted to shout out to everyone who has forked or contributed to this code already in case anyone wants to help with maintenance:

@amateo @steadramon @sts @deligatedgeek @diranged @nward @coreone @rogermartensson @JonTheNiceGuy @OlivierLM @guest715 @ardrigh @mrobbert @geoffdavis @davidc @infracaninophile @carlgarner @starryparrot @craigwatson @treydock @pioto @rotanid @theosotr @ihpu @raphink @davidc0le @paulseward @bhechinger @BrandwatchLtd @broadinstitute @ceesco53 @chihoko @chris-gibbs @claranet @ConclusionMC @cwmoller @dabelenda @decibelhertz @djfraggle @eniuz @gwdg @hihiuztrewq @janit42 @krobertson @Lavaburn @mlosapio @pikseluls @riseops @ross-w @roumano @SearchLightNZ @sklemer1 @sohonet @SuPair @zennoc @zivis

Sorry for the mass tagging... feel free to unwatch this issue if you're not interested. Thanks! ๐Ÿ˜„

FreeRADIUS stopped working after a recent upgrade on RHEL 8

Hi,

After a FreeRADIUS upgrade on RHEL 8 (freeradius-3.0.20-3.module+el8.3.0+7597+67902674.x86_64), FreeRADIUS stopped working with this error in the logs:

Systemd start for radiusd failed!
journalctl log for radiusd:
-- Logs begin at Tue 2020-12-29 04:36:26 CET, end at Tue 2021-01-12 18:22:30 CET. --
Jan 12 18:22:30 <redacted> systemd[1]: Starting FreeRADIUS high performance RADIUS server....
Jan 12 18:22:30 <redacted> sh[1960192]: /bin/sh: /etc/raddb/certs/bootstrap: No such file or directory
Jan 12 18:22:30 <redacted> systemd[1]: radiusd.service: Control process exited, code=exited status=127
Jan 12 18:22:30 <redacted> systemd[1]: radiusd.service: Failed with result 'exit-code'.
Jan 12 18:22:30 <redacted> systemd[1]: Failed to start FreeRADIUS high performance RADIUS server..

I guess this is due to

purge => true,

What would be the best solution, keeping this file, or dropping a systemd override to prevent the service from calling this script as part of its ExecStartPre command?

Unable to manage sql.conf

Firstly, great module! It would be nice to be able to manage sql.conf if mysql support is enabled (requires at least the sql credentials). How do you see managing these as well as sql/mysql/schema.sql and sql/mysql/dialup.conf?

can't deploy cert files

Hello,

I'm trying to deploy certs.

freeradius::cert { 'RootCA01-2019.crt':
    content => '-----BEGIN CERTIFICATE-----MIIFETCCAvmgAwI......',
    type    => 'cert',
    }

Nothing is created in certs directory.

But if I create a dumb file, the module is OK :
Info: /Stage[main]/Freeradius/File[/etc/raddb/certs/toto.crt]: Filebucketed /etc/raddb/certs/toto.crt

Could you please help me ?

Thank you

LDAP not working when @name is used

ldap <%= @name %> {

When I configure a LDAP server using create_resource from hiera:

freeradius::module::ldap:
  'name_of_ldap':
    server: '192.168.0.1'
    ....

Then an entry gets created in the folder mods-enabled named 'name_of_ldap' with this content:

ldap name_of_ldap {
  server = '192.168.0.1
  ....
}

Which seems correct, but the FreeRadius server won't start and this error appears in the log:

Error: /etc/raddb/sites-enabled/name_of_ldap[75]: Unknown attribute 'LDAP-Group'

BUT when I remove name_of_ldap from the mod, so then it looks like this:

ldap {
  server = '192.168.0.1
  ....
}

It works fine. Am I missing something? Or is the code not correct.

Release.. v4?

I'm proposing a new release major version 4 - to signal that there are some breaking changes (which I think there are).

I'd like to create a milestone for it, and tag a couple of issues (and maybe create some issues) which can be part of that milestone, then we have a goal to work towards.

I think we can leave this issue open as a way to track any general discussion on v4 (if that's what we agree it should be called, if not we can rename this to something else).

logrotate package dependency

Hello, thanks for creating this module!

I got a little confused by the following error.

Evaluation Error: Error while evaluating a Function Call, Logrotate::Rule[wtmp]: rotate must be an integer at /etc/puppetlabs/code/environments/production/modules/logrotate/manifests/rule.pp:306:7 at /etc/puppetlabs/code/environments/production/modules/logrotate/manifests/defaults/debian.pp:16

I noted from the puppet forge dependencies page that your module had a dependency on rodjek/logrotate. I added it manually in my Puppet file.

After some head scratching I looked at your metadata.json file and realized it was actually yo61/logrotate (which has now been migrated to puppet/logrotate). Switching to that package fixed the error.

I wanted to let you know incase others might go down the same hole.

Thanks again!

freeradius::module::ldap multiple server

The syntax of ldap configuration have been change in freeradius , i got this warning when i start the daemin in debug mode :

Listing multiple LDAP servers in the 'server' configuration item is deprecated and will be removed in a future release.  Use multiple 'server' configuration items instead
- server = 'ldap1,ldap2'
+ server = 'ldap1'
+ server = 'ldap2'

Can you update the resource freeradius::module::ldap to follow this ?

detail module template has the same error as FreeRADIUS example

I have recently moved to the main branch of the puppet-freeradius module and freeradius failed to start after puppet ran. The issue was created by this commit d857d62, when the detail.erb template was updated to be the same as the detail example file in freeradius, which doesn't work because freeradius requires each module to be named and detail doesn't contain one. The detail.log example file does contain a name.

I can create a PR for this

Puppetlabs/firewall module dependency

Currently this module has a dependency on an old version of Puppetlabs/firewall, are there any plans to update this dependency?

I am happy submit a PR for a newer version

Client firewall rule is repeatedly added to iptables INPUT chain

When setting firewall to true for a client resource, the rule is repeatedly added to the iptables INPUT chain for each Puppet run. The problem appears to be with lines 61 and 68 in client.pp. The hyphen that follows the 100 i.e. 100**-**${shortname} needs to be replaced with a space in order for the Firewall resource to be able to match the rule on subsequent Puppet runs after it has been added to the iptables INPUT chain.

RPM-centric lines break on Debian based systems

In the file /manifests/init.pp are two Exec statements:

delete-radius-rpmnew
delete-radius-rpmsave

These lines are sensible - the debian equivelent to the .rpm* files are called .dpkg-*

Also, /bin/find doesn't exist on Debian Wheezy (at least) - it's /usr/bin/find. Perhaps an Exec line (like this: Exec {path => ["/bin/", "/sbin/", "/usr/bin/", "/usr/sbin/"] }) in the params.init might be a better idea?

Unknown function warn at /etc/puppet/modules/freeradius/manifests/init.pp:16 on node

Hello,

I'm trying to use the module from puppet forge, version 0.4.3 and I am seeing the below error.

Unknown function warn at /etc/puppet/modules/freeradius/manifests/init.pp:16 on node

This is caused when control socket is enabled as per the below code.

class { 'freeradius':
  control_socket  => true,
  max_requests    => 4096,
  max_servers     => 4096,
  mysql_support   => true,
  utils_support   => true,
}

This is using puppet server and client 3.7

for the time being i've disabled the controls sockets.

thanks
Luke

sites directly in sites-enabled

I already knew that sites were added to sites-enabled directly and didn't care, but yesterday I discovered that this caused serious problem at least with Debian package management: It creates a symlink "default" in sites-enabled, which overrides a site named "default" created with this module by puppet. This is when the downtime starts.
A puppet run would not fix it, because puppet does not care of content if it is a symlink.
This is where the downtime gets permanent until you delete the symlink and run puppet again.

The freeradius devs advise/instruct to use links in sites-enabled:

#	Virtual hosts should be put into the "sites-available"
#	directory.  Soft links should be created in the "sites-enabled"
#	directory to these files.

From my point of view it would be better to create the file in sites-available and a symlink to it in sites-enabled, just as "anyone else". Are there any arguments for keeping the old behaviour?

A workaround is renaming the sites to unused names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.