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

Added owner fields in radius filter #6324

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use HTML::FormHandler::Moose;
use pf::constants::role qw(@ROLES);
use pf::config qw(%Config);
use pf::util::radius_dictionary qw($RADIUS_DICTIONARY);
use pf::constants::filters qw(@BASE_FIELDS @NODE_INFO_FIELDS @FINGERBANK_FIELDS @SWITCH_FIELDS @SECURITY_EVENT_FIELDS);
use pf::constants::filters qw(@BASE_FIELDS @NODE_INFO_FIELDS @FINGERBANK_FIELDS @SWITCH_FIELDS @SECURITY_EVENT_FIELDS @OWNER_FIELDS);
extends 'pfappserver::Form::Config::FilterEngines';
with qw(
pfappserver::Base::Form::Role::Help
Expand Down Expand Up @@ -98,6 +98,7 @@ sub options_field_names {
@FINGERBANK_FIELDS,
@SWITCH_FIELDS,
@SECURITY_EVENT_FIELDS,
@OWNER_FIELDS,
(
map { "radius_request.$_" } (
@{$Config{radius_configuration}{radius_attributes} // []}
Expand Down
9 changes: 6 additions & 3 deletions lib/pf/radius.pm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ use pf::security_event;
use pf::constants::security_event qw($LOST_OR_STOLEN);
use pf::Redis;
use pf::constants::eap_type qw($EAP_TLS $MS_EAP_AUTHENTICATION $EAP_PSK);
use pf::person;

our $VERSION = 1.03;

Expand Down Expand Up @@ -228,6 +229,7 @@ sub authorize {
$args->{'ssid'} = $ssid;
$args->{'node_info'} = $node_obj;
$args->{'fingerbank_info'} = pf::node::fingerbank_info($mac, $node_obj);
$args->{'owner'} = person_view_simple($node_obj->{'pid'});
my $filter = pf::access_filter::radius->new;
my $rule = $filter->test('preProcess', $args);
if ($rule) {
Expand Down Expand Up @@ -508,7 +510,8 @@ sub accounting {
connection_sub_type => $connection_sub_type,
radius_request => $radius_request,
ssid => $ssid,
node_info => $node_obj
node_info => $node_obj,
owner => person_view_simple($node_obj->{'pid'})
};
my $filter = pf::access_filter::radius->new;
my $rule = $filter->test($headers->{'X-FreeRADIUS-Server'}.".".$headers->{'X-FreeRADIUS-Section'}, $args);
Expand Down Expand Up @@ -1127,8 +1130,8 @@ sub radius_filter {
connection_sub_type => $connection_sub_type,
radius_request => $radius_request,
ssid => $ssid,
node_info => $node_obj

node_info => $node_obj,
owner => person_view_simple($node_obj->{'pid'}),
};
my $filter = pf::access_filter::radius->new;
my $rule = $filter->test($scope, $args);
Expand Down