FIDO2 and WebAuthn

Authentication has been an essential part of applications for some time now because applications need to know some information about the user who’s using the application. For the longest time, the solution to this has been username and passwords. Username passwords are popular because they’re convenient to implement. But they aren’t secure. There are many issues with passwords.

First, there’s the problem of transmitting this password securely. If you send the password over the wire, a man-in-the-middle could sniff it. That pretty much necessitated SSL over such communication or the equivalent of creating a hash of the password that’s sent over the wire instead of the actual password. But even those techniques didn’t solve the problem of the server securing the password, or a secure hash of the password. Or, for that matter, keeping you safe from replay attacks. Increasingly complex versions of this protocol were created, to the point where you could, with some degree of confidence, say that you were safe from man-in-the-middle attacks or replay attacks.

Users created a simple, easy to remember password, and brute force techniques guessed those passwords. So we came up with complex requirements for passwords, such as your password must contain an upper case, lower case, special character, and minimum length – and yet people still picked poor passwords. When they didn’t pick poor passwords that were easy to remember, they would reuse passwords across different systems. Or they would use password managers to store their passwords, until the password manager itself got compromised.

But even then, you’re not safe from passwords being leaked. Worse, leaked passwords are not detected – you don’t know if your password has been leaked until the leak is discovered. And these leaks could occur on a poorly implemented service. This means, no matter what you do, you’re still insecure.

Don’t Despair

There are solutions. There are concepts like MFA or one-time passwords that can be used in addition to your usual password. This is what you’ve experienced when you enter a credential, but in addition, you have to enter a code sent to you via SMS or from an authenticator app on your phone.

MFA and one-time passwords are great. In fact, I’d go to the extent of saying that if there’s a service you’re using that uses only username password, just assume it’s insecure, and don’t use it for anything critical. Additionally, pair it with common-sense practices like own your domain name, and a separate email address from your normal use email address for account recovery. Secret questions and answers that aren’t easy to guess, and answers that don’t make sense to anyone.

As great as MFA and one-time passwords are, they’re still not a perfect picture. There are a few big issues with this approach.

First, they are cumbersome to manage for the end user. I work with this stuff on a daily basis, and I find it frustrating to manage 100s of accounts, multiple authenticator apps, and I worry that if I ever broke my phone accidentally, I’d be transported to neanderthal times immediately. I can’t imagine how a common non-technology-friendly person deals with all this.

Second, MFAs and one-time passwords are both cumbersome and expensive for the service provider. All those SMS messages and push notifications cost money. This creates a barrier to entry for someone trying to get a service off the ground. Then there’s the question of which authenticator app to trust and whether that app be trusted. Is SMS good enough?

Third, there’s the issue of phishing. As great as MFA is, someone can set up a service that looks identical to a legit service, and unless you have very keen eyes watching every step, you may fall for it. Unfortunately, even the best of us is tired and stressed at times, and that’s when you fall for this. In fact, the unscrupulous service that pretends to be a legit service could simply forward your requests to the legit service after authentication while stealing your session. So you may think everything is hunky dory but your session has effectively been stolen.

Finally, there is authentication fatigue. Hey, I just want to login and use a system. Zero trust dictates that you assume a breach, so it’s common for services to over-authenticate. This creates authentication fatigue, and an already fatigued user could blindly approve an MFA request, especially if it’s cleverly disguised. It only takes one mistake for a hacker to get in the house, then they can do plenty of damage, potentially remaining undetected for a long time.

What am I Trying to Solve?

I’m not trying to secure passwords or make a better MFA solution here. The fundamental problem I wish to solve here is how an application can securely trust a user’s identity, such that the identity is not cumbersome to manage, is secure, convenient, and…

… this article is continued online. Click here to continue.

How to re-generate Azure QR Code

Log in to Azure portal -> Active Directory -> Users.

Add user phone under Authentication contact info. Click on “Require re-register multifactor authentication. Reset password. Send email to user to login here ;

https://azure.microsoft.com/en-us/features/azure-portal/

User will be able to change the temp password. Next step will be the wizard that will re-register multifactor authentication on user phone in Microsoft Authentication App.

Windows security settings

Instructions to setup screen saver and strengthen the password;

Screensaver Settings

  1. Open your start menu and search for Change Screen Saver
  • Set the screen saver to blank, set the time to 15, and tick the box next to On resume, display login screen. Apply the settings. Your computer will now lock the screen after 15 minutes of inactivity.

Password Settings

  1. Open your start menu and search for Edit group policy.
  • In the left pane navigate to Computer Configuration/Windows Settings/Security Settings/Account Policies/Password Policy
  • Double click on each policy listed below to open the menu. Change the policy to match what is listed below. Apply the change and close the window.
    • Enforce password history: 12 passwords remembered
    • Maximum password age: 90 days
    • Minimum password age: 1 day
    • Minimum password length: 12 characters
    • Password must meet complexity requirements: Enabled
  • Open a file explorer window. Right-click on This PC and choose Manage
  • In the left pane, navigate to System Tools/Local Users and Groups/Users
  • Find your account in the list of users. Double click your account to open the settings menu
  • In the list of settings, make sure Password never expires is NOT checked. If it is, remove the check and Apply the changes.
  • Hit CTRL+ALT+DEL to bring up the system menu. Choose Change a password to change your password to a new one that meets the requirements.

Protected web api configuration

Like web apps, the ASP.NET and ASP.NET Core web APIs are protected because their controller actions are prefixed with the [Authorize] attribute. The controller actions can be called only if the API is called with an authorized identity.

Consider the following questions:

  • Only an app can call a web API. How does the API know the identity of the app that calls it?
  • If the app calls the API on behalf of a user, what’s the user’s identity?

Read more here;

https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-protected-web-api-app-configuration

Server is ethernet connected on LAN, means exposed to the internet?

You may have an Internet connection, but you are almost certainly behind a NAT router, not directly connected to the Internet.  Normally, that NAT router is the only machine that faces the Internet, has a direct connection, and is under constant attack by numerous bots roaming the IP’s of the Internet. 

You only have a local IP for your local network.  Only the router has your true IP that is seen on the Internet.  When your browser or NTP service (or other Internet need you may have) needs to see something on the Internet, it makes a connection to an Internet server, and your router notes that connection and allows that server to respond, using the associated ports of your connection.  The router will route those responses back to your machine, and not any other. 

The outside bots and servers cannot attack or connect to your machine, because they can’t even see it, and they don’t know your local IP.  The only contact that outside machines can have with your machine is strictly through connections your machine initiates first, through your router.

Now if you *did* want to put your server directly on the Internet, most routers have a setting where they can put any machine into a ‘DMZ’, a special unprotected zone, which means the Internet is directly connected to any machine you choose!  And the router won’t block any Internet traffic then, but allow all of it to come through to you. 

I would strongly advise you to first disconnect ALL of your drives, and backup your boot drive, because you will be very rapidly attacked!  Never use the DMZ unless you have a lot of security experience!