Skip to content

Commit 1decfba

Browse files
committed
First draft
1 parent b19132e commit 1decfba

File tree

6 files changed

+56
-23
lines changed

6 files changed

+56
-23
lines changed

conf/documentation.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,13 @@ description=<<EOT
13401340
Use the information included in the accounting to update the iplog
13411341
EOT
13421342

1343+
[advanced.update_iplog_with_authentication]
1344+
type=toggle
1345+
options=enabled|disabled
1346+
description=<<EOT
1347+
Use the information included in the authentication to update the iplog
1348+
EOT
1349+
13431350
[advanced.update_iplog_with_external_portal_requests]
13441351
type=toggle
13451352
options=enabled|disabled

conf/pf.conf.defaults

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,11 @@ pfperl_api_processes=8
997997
# Use the information included in the accounting to update the iplog
998998
update_iplog_with_accounting=disabled
999999
#
1000+
# advanced.update_iplog_with_authentication
1001+
#
1002+
# Use the information included in the authentication to update the iplog
1003+
update_iplog_with_authentication=disabled
1004+
#
10001005
# advanced.update_iplog_with_external_portal_requests
10011006
#
10021007
# Use the information included in the accounting to update the iplog

go/pfconfigdriver/structs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ type PfConfAdvanced struct {
586586
ScanOnAccounting string `json:"scan_on_accounting"`
587587
PffilterProcesses string `json:"pffilter_processes"`
588588
UpdateIplogWithAccounting string `json:"update_iplog_with_accounting"`
589+
UpdateIplogWithAuthentication string `json:"update_iplog_with_authentication"`
589590
AdminCspSecurityHeaders string `json:"admin_csp_security_headers"`
590591
Multihost string `json:"multihost"`
591592
SsoOnAccessReevaluation string `json:"sso_on_access_reevaluation"`

html/pfappserver/root/src/views/Configuration/advanced/_components/TheForm.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
disabled-value="disabled"
9696
/>
9797

98+
<form-group-update-iplog-with-authentication namespace="update_iplog_with_authentication"
99+
:column-label="$i18n.t('Update the iplog using the authentication')"
100+
:text="$i18n.t('Use the information included in the authentication to update the iplog.')"
101+
enabled-value="enabled"
102+
disabled-value="disabled"
103+
/>
104+
98105
<form-group-update-iplog-with-external-portal-requests
99106
namespace="update_iplog_with_external_portal_requests"
100107
:column-label="$i18n.t('Update the iplog using the external portal requests')"
@@ -196,6 +203,7 @@ import {
196203
FormGroupSourceToSendSmsWhenCreatingUsers,
197204
FormGroupTimingStatsLevel,
198205
FormGroupUpdateIplogWithAccounting,
206+
FormGroupUpdateIplogWithAuthentication,
199207
FormGroupUpdateIplogWithExternalPortalRequests
200208
} from './'
201209
import {computed, toRefs} from '@vue/composition-api'
@@ -227,6 +235,7 @@ const components = {
227235
FormGroupSourceToSendSmsWhenCreatingUsers,
228236
FormGroupTimingStatsLevel,
229237
FormGroupUpdateIplogWithAccounting,
238+
FormGroupUpdateIplogWithAuthentication,
230239
FormGroupUpdateIplogWithExternalPortalRequests
231240
}
232241

html/pfappserver/root/src/views/Configuration/advanced/_components/index.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,31 @@ import TheView from './TheView'
1515
export {
1616
BaseFormButtonBar as FormButtonBar,
1717

18-
BaseFormGroupIntervalUnit as FormGroupAccountingTimebucketSize,
19-
BaseFormGroupSwitch as FormGroupActiveDirectoryOsJoinCheckBypass,
20-
BaseFormGroupSwitch as FormGroupAdminCspSecurityHeaders,
21-
BaseFormGroupIntervalUnit as FormGroupApiInactivityTimeout,
22-
BaseFormGroupIntervalUnit as FormGroupApiMaxExpiration,
23-
BaseFormGroupSwitch as FormGroupConfigurator,
24-
BaseFormGroupChosenOne as FormGroupHashPasswords,
25-
BaseFormGroupInput as FormGroupHashingCost,
26-
BaseFormGroupChosenOne as FormGroupLanguage,
27-
BaseFormGroupTextarea as FormGroupLdapAttributes,
28-
BaseFormGroupSwitch as FormGroupLocationlogCloseOnAccountingStop,
29-
BaseFormGroupSwitch as FormGroupMultihost,
30-
BaseFormGroupSwitch as FormGroupNetflowOnAllNetworks,
18+
BaseFormGroupIntervalUnit as FormGroupAccountingTimebucketSize,
19+
BaseFormGroupSwitch as FormGroupActiveDirectoryOsJoinCheckBypass,
20+
BaseFormGroupSwitch as FormGroupAdminCspSecurityHeaders,
21+
BaseFormGroupIntervalUnit as FormGroupApiInactivityTimeout,
22+
BaseFormGroupIntervalUnit as FormGroupApiMaxExpiration,
23+
BaseFormGroupSwitch as FormGroupConfigurator,
24+
BaseFormGroupChosenOne as FormGroupHashPasswords,
25+
BaseFormGroupInput as FormGroupHashingCost,
26+
BaseFormGroupChosenOne as FormGroupLanguage,
27+
BaseFormGroupTextarea as FormGroupLdapAttributes,
28+
BaseFormGroupSwitch as FormGroupLocationlogCloseOnAccountingStop,
29+
BaseFormGroupSwitch as FormGroupMultihost,
30+
BaseFormGroupSwitch as FormGroupNetflowOnAllNetworks,
3131
BaseFormGroupOpenidAttributes as FormGroupOpenidAttributes,
32-
BaseFormGroupInputNumber as FormGroupPffilterProcesses,
33-
BaseFormGroupInputNumber as FormGroupPfperlApiProcesses,
34-
BaseFormGroupInputNumber as FormGroupPfperlApiTimeout,
35-
BaseFormGroupSwitch as FormGroupPortalCspSecurityHeaders,
36-
BaseFormGroupInput as FormGroupPfupdateCustomScriptPath,
37-
BaseFormGroupSwitch as FormGroupScanOnAccounting,
38-
BaseFormGroupChosenOne as FormGroupSourceToSendSmsWhenCreatingUsers,
39-
BaseFormGroupInputNumber as FormGroupTimingStatsLevel,
40-
BaseFormGroupSwitch as FormGroupUpdateIplogWithAccounting,
41-
BaseFormGroupSwitch as FormGroupUpdateIplogWithExternalPortalRequests,
32+
BaseFormGroupInputNumber as FormGroupPffilterProcesses,
33+
BaseFormGroupInputNumber as FormGroupPfperlApiProcesses,
34+
BaseFormGroupInputNumber as FormGroupPfperlApiTimeout,
35+
BaseFormGroupSwitch as FormGroupPortalCspSecurityHeaders,
36+
BaseFormGroupInput as FormGroupPfupdateCustomScriptPath,
37+
BaseFormGroupSwitch as FormGroupScanOnAccounting,
38+
BaseFormGroupChosenOne as FormGroupSourceToSendSmsWhenCreatingUsers,
39+
BaseFormGroupInputNumber as FormGroupTimingStatsLevel,
40+
BaseFormGroupSwitch as FormGroupUpdateIplogWithAccounting,
41+
BaseFormGroupSwitch as FormGroupUpdateIplogWithAuthentication,
42+
BaseFormGroupSwitch as FormGroupUpdateIplogWithExternalPortalRequests,
4243

4344
BaseViewResource as BaseView,
4445
TheForm,

lib/pf/radius.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ sub authorize {
145145
}
146146

147147
Log::Log4perl::MDC->put( 'mac', $mac );
148+
149+
my $framed_ip = $radius_request->{"Framed-IP-Address"};
150+
if (exists $radius_request->{"Framed-IP-Address"} && valid_ip($radius_request->{"Framed-IP-Address"})) {
151+
if (isenabled($Config{advanced}{update_iplog_with_authentication})) {
152+
my $client = pf::client::getClient();
153+
$logger->debug("Updating iplog from authentication request");
154+
$client->notify("update_ip4log", mac => $mac, ip => $radius_request->{"Framed-IP-Address"});
155+
}
156+
}
157+
148158
my $connection = pf::Connection->new;
149159
$connection->identifyType($nas_port_type, $eap_type, $mac, $user_name, $switch, $radius_request);
150160
my $connection_type = $connection->attributesToBackwardCompatible;

0 commit comments

Comments
 (0)