pass parameters to rlm_perl script in a redundant setup

classic Classic list List threaded Threaded
5 messages Options
| Threaded
Open this post in threaded view
|

pass parameters to rlm_perl script in a redundant setup

Users mailing list
Hello,

The redundant and redundant-load-balance setting is totally awesome.
I would like to run perl modules in a redundant configuration.

redundant {
   perl-auth-A
   perl-auth-B
}

With both being

perl perl-auth-A {
    filename = /my/perl/script.pl
}

perl perl-auth-B {
    filename = /my/perl/script.pl
}

basically the same script but with two different configurations.
So I am wondering how it is even possible to pass the information to
the script, if it would run as "A" or "B".
I could not figure to add some information maybe using update-control.

So I am wondering if it is possible in some way to do

perl perl-auth-A {
    filename = /my/perl/script.pl
    option = A
}

perl perl-auth-B {
    filename = /my/perl/script.pl
    option = B
}

Currently I need to create a copy of the perl script and do:

perl perl-auth-A {
    filename = /my/perl/script-A.pl
}

perl perl-auth-B {
    filename = /my/perl/script-B.pl
}

Any hint is highly appreciated.
I am running on FreeRADIUS 3.0.16.

Thanks a lot
Cornelius


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

signature.asc (849 bytes) Download Attachment
| Threaded
Open this post in threaded view
|

Re: pass parameters to rlm_perl script in a redundant setup

Jorge Pereira-2
You could use the section config{} to determine such arguments as can be seen in https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/raddb/mods-available/perl#L61 <https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/raddb/mods-available/perl#L61>
--
Jorge Pereira
[hidden email]




> On 21 Mar 2020, at 15:05, Cornelius Kölbel via Freeradius-Users <[hidden email]> wrote:
>
> Hello,
>
> The redundant and redundant-load-balance setting is totally awesome.
> I would like to run perl modules in a redundant configuration.
>
> redundant {
>   perl-auth-A
>   perl-auth-B
> }
>
> With both being
>
> perl perl-auth-A {
>    filename = /my/perl/script.pl
> }
>
> perl perl-auth-B {
>    filename = /my/perl/script.pl
> }
>
> basically the same script but with two different configurations.
> So I am wondering how it is even possible to pass the information to
> the script, if it would run as "A" or "B".
> I could not figure to add some information maybe using update-control.
>
> So I am wondering if it is possible in some way to do
>
> perl perl-auth-A {
>    filename = /my/perl/script.pl
>    option = A
> }
>
> perl perl-auth-B {
>    filename = /my/perl/script.pl
>    option = B
> }
>
> Currently I need to create a copy of the perl script and do:
>
> perl perl-auth-A {
>    filename = /my/perl/script-A.pl
> }
>
> perl perl-auth-B {
>    filename = /my/perl/script-B.pl
> }
>
> Any hint is highly appreciated.
> I am running on FreeRADIUS 3.0.16.
>
> Thanks a lot
> Cornelius
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: pass parameters to rlm_perl script in a redundant setup

Alan DeKok-2
In reply to this post by Users mailing list
On Mar 21, 2020, at 2:05 PM, Cornelius Kölbel via Freeradius-Users <[hidden email]> wrote:

> The redundant and redundant-load-balance setting is totally awesome.
> I would like to run perl modules in a redundant configuration.
>
> redundant {
>   perl-auth-A
>   perl-auth-B
> }
>
> With both being
>
> perl perl-auth-A {
>    filename = /my/perl/script.pl
> }
>
> perl perl-auth-B {
>    filename = /my/perl/script.pl
> }
>
> basically the same script but with two different configurations.

  What do you mean by "different configurations"?  If it's the same file, there is no different configuration.

> So I am wondering how it is even possible to pass the information to
> the script, if it would run as "A" or "B".

  Yes... the files mods-available/perl describes how attributes are passed to the module.

> I could not figure to add some information maybe using update-control.

  Those attributes are in %RAD_CHECK.

> So I am wondering if it is possible in some way to do
>
> perl perl-auth-A {
>    filename = /my/perl/script.pl
>    option = A
> }

  No.  If that was possible, it would be documented.

  And even if it was possible, how would "option" be passed to the Perl script?

> Currently I need to create a copy of the perl script and do:
>
> perl perl-auth-A {
>    filename = /my/perl/script-A.pl
> }

  That's simple, and it works.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: pass parameters to rlm_perl script in a redundant setup

Users mailing list
In reply to this post by Users mailing list
Hello Jorge,
thanks a lot.That was exactly, what I was looking for.Kind
regards,Cornelius
Am Samstag, den 21.03.2020, 15:29 -0300 schrieb Jorge Pereira:

> You could use the section config{} to determine such arguments as can
> be seen in
> https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/raddb/mods-available/perl#L61
> > On 21 Mar 2020, at 15:05, Cornelius Kölbel via Freeradius-Users <
> > [hidden email]> wrote:
> >
> > Hello,
> >
> > The redundant and redundant-load-balance setting is totally
> > awesome.
> > I would like to run perl modules in a redundant configuration.
> >
> > redundant {
> >    perl-auth-A
> >    perl-auth-B
> > }
> >
> > With both being
> >
> > perl perl-auth-A {
> >     filename = /my/perl/script.pl
> > }
> >
> > perl perl-auth-B {
> >     filename = /my/perl/script.pl
> > }
> >
> > basically the same script but with two different configurations.
> > So I am wondering how it is even possible to pass the information
> > to
> > the script, if it would run as "A" or "B".
> > I could not figure to add some information maybe using update-
> > control.
> >
> > So I am wondering if it is possible in some way to do
> >
> > perl perl-auth-A {
> >     filename = /my/perl/script.pl
> >     option = A
> > }
> >
> > perl perl-auth-B {
> >     filename = /my/perl/script.pl
> >     option = B
> > }
> >
> > Currently I need to create a copy of the perl script and do:
> >
> > perl perl-auth-A {
> >     filename = /my/perl/script-A.pl
> > }
> >
> > perl perl-auth-B {
> >     filename = /my/perl/script-B.pl
> > }
> >
> > Any hint is highly appreciated.
> > I am running on FreeRADIUS 3.0.16.
> >
> > Thanks a lot
> > Cornelius
> >
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

signature.asc (849 bytes) Download Attachment
| Threaded
Open this post in threaded view
|

Re: pass parameters to rlm_perl script in a redundant setup

Users mailing list
In reply to this post by Alan DeKok-2
Hi Alan,

thanks for the response.

Am Samstag, den 21.03.2020, 14:31 -0400 schrieb Alan DeKok:

> On Mar 21, 2020, at 2:05 PM, Cornelius Kölbel via Freeradius-Users <
> [hidden email]> wrote:
> > The redundant and redundant-load-balance setting is totally
> > awesome.
> > I would like to run perl modules in a redundant configuration.
> >
> > redundant {
> >   perl-auth-A
> >   perl-auth-B
> > }
> >
> > With both being
> >
> > perl perl-auth-A {
> >    filename = /my/perl/script.pl
> > }
> >
> > perl perl-auth-B {
> >    filename = /my/perl/script.pl
> > }
> >
> > basically the same script but with two different configurations.
>
>   What do you mean by "different configurations"?  If it's the same
> file, there is no different configuration.
The script in question forwards the user credentials to a multi factor
system.
As it would be interesting to have a "redundant" or "redundant-load-
balance" setup, we need the script in one case to contact MFA-Server-A
and in the other case MFA-Server-B. (This way, the perl script does not
need to handle redundancy.)

The config helps to contact Server-A in one case and Server-B in the
other case with the same script.
Jorges link was successful.

Thanks a lot!
Cornelius


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

signature.asc (849 bytes) Download Attachment