@darnoldvcs said in Captive Portal Pass-through MAC Auto Entry is registering unauthenticated users:
I have tested this on 22.05 & 23.01.
What is / Is there a reason not to test de the current version - 23.05 ?
For good manners : I use 23.05, as it removes issues present in 23.01 ;)
With only this option checked :
@darnoldvcs said in Captive Portal Pass-through MAC Auto Entry is registering unauthenticated users:
Pass-through MAC Auto Entry: Checked/Enabled
I had to identify with valid credentials, and then the MAC was added to the MACs table.
These two :
54a7c9c3-d164-4e80-b6eb-4253f72705bb-image.png
I have never tested these .
But setting them to "1" both does expose what you've mentioned above.
I still don't know what "Pass-through credits per MAC address" actually is. 1 hour ? or 1 "something" ?
But, I've seen the same thing : with these to set to "1", the MAC address of my device was added right away in the MAC table, granting me indefinite access from that moment.
That behavior doesn't match with the description
When enabled, a MAC passthrough entry is automatically added after the user has successfully authenticated.
edit :
I've been looking around in the documentation.
In the captive portal /usr/local/captiveportal/index.php file, around line 192 :
8bf8f900-5314-4f43-ad58-f51ce72ea634-image.png
The function "portal_consume_passthrough_credit($clientmac)" return 'true' if these 2 :
54a7c9c3-d164-4e80-b6eb-4253f72705bb-image.png
are set (bigger then 0).
The if statement is true, so a log line is add to the captive portal log :
captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT");
which means a user with MAC '$clientmac' and "unauthenticated" is added.
Like :
08c5ad14-4c20-4d73-bcd5-26b19c42f723-image.png
and then the mighty portal_allow( ....... ) is called.
This isn't a real login, an "unauthenticated", is more a "temporarily accepted auto login".
Nevertheless, because this is a new session, and "passthrumacadd" is set/checked (around line 2075 /etc/inc/captiveportal.inc) is now unconditionally added.
Easy way out : these options are somewhat 'mutually exclusive'.
The thing is : the captive portal logistics is ..... messy (I'm still looking for a better word) or somewhat what could be called as 'spaghetti code'.
The main settings page makes the portal admin think that all kind of option can me used together.
This is a typical case of : no way.
edit :
Change /etc/inc/captiveportal.inc : https://github.com/pfsense/pfsense/blob/5e92d678f642277642acb7f471cd430ed53aae16/src/etc/inc/captiveportal.inc#L2075
I tried to play with :
if (isset($config['captiveportal'][$cpzone]['passthrumacadd']) &&
empty($config['captiveportal'][$cpzone]['freelogins_count']) &&
empty($config['captiveportal'][$cpzone]['freelogins_resettimeout'])) {
which stands for
If ("passthrumacadd" == checked) and
both 'freelogins_count' and 'freelogins_resettimeout' are not set,
then do the MAC add passtrough.
But this was not a solution.
There need to be a test to see if the MAC in case is in the grace ( freelogins_resettimeout ) period.
This could be done by checking /var/db/captiveportal_usedmacs_cpzone1.db (cpzone1 is my captive portal zone name) ...
My first advise still stands : @darnoldvcs please keep it simple(r).
If possible, ditch the "passthrumacadd" option - and say sorry to your visitors : after a while (hard reset or IP change) : they have to login again.
If these people are really, or more or less trusted users : give them another, more trusted network that doesn't use the captive portal.