Support

Admin Tools

#29444 TFA mandatory with LoginGuard

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by GSommaruga on Wednesday, 28 March 2018 05:44 CDT

GSommaruga
With LoginGuard I can display a screen to invite the user to define a TFA, but I can not force the user to do so.
The user can even deactivate the screen, so from that moment the user can log in without any further protection.
Is there a way to make it mandatory?
Is there a way to list users without TFA?

For many users a TFA is just an unnecessary complication and it is right not to force them to activate it. But for other users or for other contexts it must necessarily be mandatory.
Thanks in advance.

nicholas
Akeeba Staff
Manager
Logging into the site requires successfully completing Two Step Verification, i.e. 2SV must be already set up.

Setting up 2SV requires being logged into the site.

You see where the problem lies?

No, we can't whitelist the interaction with LoginGuard because that creates a loophole through which an attacker who has subverted only the username and password can add / replace the existing 2SV methods thereby circumventing 2SV which would make LoginGuard worse than useless, it would make it DANGEROUS (giving a false sense of security).

No, we can't limit the interaction when a 2SV has not been added yet because during the set up verification step you have set up a 2SV method on the site and we will disable it if you can't prove that it's also set up correctly on your end. This means that the action of adding a 2SV method would trigger the protection.

No, we can't selectively whitelist the interaction with a specific 2SV method because it's not only complicated, it's pointless when we have second step methods which allow multiple instances e.g. YubiKey and U2F. Selectively allowing interaction would allow the attacker to e.g. add their own YubiKey should the user being attacked was already using YubiKey with LoginGuard.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

GSommaruga
At this moment I see the page that asks me to define the TFA; then, I close it and proceed to work in Backend.
So anyone could do it.
I activate LoginGuard, but he does not activate his TFA.

If you can not make TFA mandatory, it might be enough to see in Backend a list of users with the TFA option enabled (not their codes).
In this way I can solicit the user to activate at least one TFA, otherwise I disable the user.

nicholas
Akeeba Staff
Manager
At this moment I see the page that asks me to define the TFA; then, I close it and proceed to work in Backend.


And I explained why in my previous post, in detail.

I activate LoginGuard, but he does not activate his TFA.


And I explained why in my previous post, in GREAT detail.

If you can not make TFA mandatory, it might be enough to see in Backend a list of users with the TFA option enabled (not their codes).


You cannot add columns to Joomla's Users page. You can only add tabs when editing a user. That's a Joomla restriction. If you find me a way to circumvent it without the need to modify Joomla's core files then of course I can implement this :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

GSommaruga
I have read and understood your reasons.
I only point out, without controversy, that the security of the login is left to the personal responsibility of the users.
At the moment, I can only define the complexity of the password and make available to users with some security tools, such as reCaptcha in registration and TFA in login.
LoginGuard provides additional TFA tools, but nothing more.
It is certainly not a criticism of you, but a realization that this is the current situation with Joomla.

If it is not possible to have a list of who is using TFA in the users administration panel or somewhere else, it will mean that we will open the profile of the individual user, one at a time.

Thank you.

nicholas
Akeeba Staff
Manager
I only point out, without controversy, that the security of the login is left to the personal responsibility of the users.


This is correct. That's the whole point of two step verification.

LoginGuard provides additional TFA tools, but nothing more.


Yeah, well, I guess we only give you the most advanced second factor authentication framework for Joomla and nothing more as in no, we don't push it down anyone's throat because that would currently defeat the purpose of improving security through LoginGuard. We write software which actually improves the security of your site, not something to provide a laborious charade and a false sense of security - we're not modeling our software off airport "security". If we find a way to force users to enable 2SV without without compromising their security, sure, we will.

f it is not possible to have a list of who is using TFA in the users administration panel or somewhere else, it will mean that we will open the profile of the individual user, one at a time.


Correct. The pages which list records are plain HTML/PHP templates, driven by data fetched by a non-overridable PHP class. Without template overrides you can't modify the former. Without hacking core you can't inject more data in the latter. This is what prevents us from doing it: hacking core defeats the purpose of security.

On the contrary, the pages where you edit a user's profile are XML forms and you can inject additional fieldsets i.e. tabs on the page. We use that to inject the TFA view using an HMVC implementation which nobody has attempted before in Joomla. It wasn't a simple task but we made it look like it thanks to over a decade of experience doing difficult things. Impossible takes a while, difficult we do right away.

The only alternative I see is providing a list of users and their 2SV status in LoginGuard itself. I am not sure how I feel about this. It is something that in all seriousness requires thinking about hard. How does that impact the user experience of administrators? Does that leave us with any possible security issues e.g. a Super User being able to access this page during the captive login? Does it diffuse the security setup of your site, requiring double configuration for limiting access to personal information (which may have GDPR implications)?

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager
For added giggles I did try to implement the mandatory 2SV. There are two ways to implement it, bad and worse.

The bad way to implement it is to check during login if the user does not have 2SV already set up and make them unable to access any other area of the site except LoginGuard. This is the same concept as the captive login. When they add a new 2SV method the flag "needs 2SV setup" goes away and they can visit the site freely. So freely, in fact, that they can now delete the newly added 2SV method without triggering the mandatory 2SV enable. If you have not already seen why this is hilariously insecure you are caught asleep on the wheel.

And now we come to the worse way to implement it. If you want to make sure that users cannot circumvent the requirement you have to check whether they have 2SV set up on every. single. page. load. of. the. site. That adds up to 50msec which doesn't sound like much... until you realise that Joomla itself only takes 300msec to load a page.

So, I think that puts the final nail in this feature request's coffin.

BTW, implementing what I described is trivial and you don't even have to modify LoginGuard's code. You can just write a system plugin yourself, aping the way our built-in plugin handles captive login. If you really want to shoot your feet you can absolutely do it. I won't provide you with any footguns.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

GSommaruga
Nicholas, I would like to be clear.
I'm already testing LoginGuard and I'm very satisfied.

Here, Joomla's security experts are you and I have not made any criticism of your work.

In a business context, I have to make sure that all "critical" users use all the security tools we have put at their disposal.
Alternatively it is useful that there is some "alarm" when security is put in crisis.
My question should only be seen in this context.

As far as I'm concerned, the thread can be concluded here.
Thank you for your attention, your patience and the information you gave me.

nicholas
Akeeba Staff
Manager
I was just explaining why we haven't included such an "obvious" feature. It's not that I don't understand why you need some users to have 2SV enabled forcibly. It's that it either compromises their security or leads to loopholes which circumvent your requirement. If there's no way to ship a feature that WORKS I'd rather not ship it at all.

For what it's worth, you could probably use a simple SQL reporting tool (or even phpMyAdmin itself) to generate a report of which users don't have 2SV enabled but should. After all, LoginGuard's tables are keyed to the Joomla user ID.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

GSommaruga
OK, this is a great suggestion.
I have already checked with a simple query.
Thank you very much.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!