Opening the console to the internet safely

Laura White, the IT administrator of John Smith Ltd, must be able to fix a user or look at the state of the backups even when she is not in the office, and John Smith wants to use mail and files…

Situation

Laura White, the IT administrator of John Smith Ltd, must be able to fix a user or look at the state of the backups even when she is not in the office, and John Smith wants to use mail and files from the console at home. Today the console answers only from the internal network and the VPN: from the internet it gives «Access from the internet is not allowed».

Opening the console to the internet means putting an administration interface in front of anyone. Atlas allows it with one firm condition: from the internet a second factor is always required (a 6-digit code generated by an app on the phone, or a passkey with single sign-on). In this scenario you prepare the tokens, turn on the switch, check how it behaves and learn how to close it again.

The second factor, the internal networks and single sign-on are explained in the chapter Fundamental concepts; the sign-in step by step in the chapter First sign-in and using the console; the token page in User tools.

What you need

  • The public name atlas.johnsmith.test in the public DNS (→ 198.51.100.40) and tcp port 443 (and 80 for the certificate) reaching the appliance: how to do it is in the scenario Publishing an internal site, “Making 80 and 443 reach the appliance”. With a Let’s Encrypt certificate for the appliance’s name, browsers show no warnings.
  • A second factor on the appliance: the code server (privacyIDEA, installed with the VPN or with single sign-on) or single sign-on. Without it, the switch does not turn on.
  • A phone for each person who will use the console from outside, with an authenticator app (Google Authenticator, Aegis or similar) or Atlas’s Caveau.
  • That whoever must enrol the token does so from the internal network or the VPN: from the internet, without a token, you cannot get in and cannot even enrol it.
  • An administrator account (lwhite). root never gets in from the internet: «The root user can sign in only from the internal network or the VPN.» This is not a limit to work around.

Warning Open the console to the internet only after you have enrolled your token. If you open it without one and then sign out, to get back in from outside you have nothing left to do: you will have to return to the office, use the VPN or the SSH tunnel ssh -L 3000:127.0.0.1:3000 root@atlas.johnsmith.test and open http://localhost:3000/login?local=1 (loopback counts as internal network).

Steps

Checking what the second factor will ask for

  1. Open System → Modules and see whether «VPN Roadwarrior» or «Single sign-on (SSO)» are «Configured». One of the two is enough: each brings the code server (privacyIDEA) with it if it is missing. If neither is there, install one first. The VPN is described in the scenario Giving the VPN to people who work off site; single sign-on in the scenario Single sign-on (SSO) to an external application.
  2. If you chose single sign-on, remember that from the internet the password alone no longer works for the console: the sign-in page leads to the sign-in server, where you get in with password and code, or with a passkey. The password-only form stays as an emergency sign-in, only from the internal network and VPN (/login?local=1).

Who can enrol the token

  1. The rule applies to every account of a person (not a service, not a system object such as krbtgt): they can enrol their own second factor as soon as there is something on the appliance that asks for it. It is enough that one of these facts is true: the code server is installed; the interface is open to the internet; the VPN is installed; single sign-on is on. There is no per-user switch and you do not need to have «VPN» on in the user’s page: sign-in from outside asks it of everyone. The rule is that of version 1.3.6~deb29; on an older appliance check the installed version before trusting this step.
  2. If none of these conditions is true, or the code server is not running, the Tools → MFA enrollment item says «Multi-factor authentication is not enabled: it comes with the VPN (Settings → VPN Roadwarrior) or with single sign-on.» An account that is not a person reads «Multi-factor authentication is not required for your account.»

Enrolling the token, each for themselves

  1. Laura, from the office (internal network), opens Tools → MFA enrollment and presses «Enroll token».
  2. A QR code appears: she scans it with the app. The QR is shown only once; if she closes the page before scanning it the token stays “pending verification” and the QR cannot be seen again: it must be revoked and enrolled again.
  3. She types in the «Confirm the code» field the 6 digits the app shows at that moment and presses «Verify and activate». The state becomes “active”. Each user has at most one token.
  4. Repeat for jsmith, jgreen, jbrown, pblack and for anyone who must sign in from outside. If someone has changed phone, the administrator opens the same page, chooses the person from the list and presses «Revoke token» (the code is not needed); if the token shows as “locked” but the user still has the phone, «Unblock» is enough.
  5. As administrator, check at random that the tokens are “active” and not “pending verification”: a pending token does not count and that person would be refused from outside.

Checking trusted networks and protections

  1. Open Network → IPAM - IP address management and check that the networks from which people work in the office are marked «Trusted» (the appliance’s adapters and the Argos sites already are). A network that is not — a routed VLAN, a second LAN — is treated as the internet: the code is asked from there.
  2. Open System → Settings → Active Directory domain → Accounts & Passwords and check the account lockout: «Lockout threshold (attempts)» 10, «Lockout duration (min)» 30, «Reset lockout after (min)» 30 (the recommended values). With threshold 0 the page warns that a password can be tried without limit from the internet.
  3. Open System → Settings → Brute Force Defender. Among the agents there must be the management interface agent with the «Active» marker. «Max retries», «Window (s)» and «Ban time (s)» are global. If the page says fail2ban is not installed or not running, no address is blocked: fix it before continuing.

Turning on the switch

  1. Open System → Settings → Remote Support and Monitoring, «Access from the internet» section.
  2. Turn on «Allow access to the UI from the internet». Saving is immediate: «UI open to the internet» appears. If instead you read «A second factor is needed: enable the MFA server (privacyIDEA) or single sign-on (SSO) before opening the UI to the internet.», the second factor is still missing (step 1).

Really testing from outside

  1. From a phone on the mobile network (not on the company Wi-Fi) open https://atlas.johnsmith.test/.
  2. Without single sign-on: type «Username» lwhite and the password, press «Log in». The «Verification code» page appears with the text «You are signing in from outside the internal network: enter the code from your authenticator app.» Type the 6 digits in «OTP code» and press «Verify». The code must be entered within five minutes of the password.
  3. With single sign-on: the browser goes to the sign-in server’s page; type user and password and then the code, or use the passkey.
  4. Also try root: it must be refused with «The root user can sign in only from the internal network or the VPN.»

What people see

Who From inside (LAN, VPN) From the internet
Administrator with an active token (lwhite) password only password and code; sees all the areas
User with an active token (jgreen) password only password and code; sees only Tools (mail, files, calendar, Caveau…)
User without a token (pblack, who has not enrolled it) password only refused: «From outside the internal network an OTP code is needed, but your account has no active token: register the token from the internal network or the VPN.»
root system password never
Programs (Edon Client without SSO, agents) like the user in the password field: the password immediately followed by the 6-digit code, with no spaces

A session opened with the password alone from inside and then used from outside must confirm the code: the console shows a «Confirm your access» page before going on. A session lasts 8 hours, then the console brings you back to the sign-in page.

Check

  • From the mobile network: https://atlas.johnsmith.test/ opens with the padlock and asks for the code after the password; with a wrong password the page says «Invalid username or password.», with a wrong code «Invalid OTP code.»
  • From the mobile network, an account without a token receives the message about the missing token; a user with a token sees only Tools.
  • From inside, password-only sign-in still works and does not ask for the code.
  • In System → Settings → Remote Support and Monitoring the switch is on. To close it again just turn it off: it takes effect at once («UI closed to the internet»), and from outside only the client programs’ paths answer again (Edon Client, agents, Argos, download pages) with «Access from the internet is not allowed».
  • Try getting the password wrong on purpose 5 times with a test account from the mobile network: the page answers «Too many failed attempts. Try again later.» even with the right password, until the lockout (15 minutes) expires.

If something goes wrong

What you see What it means What to do
«A second factor is needed: enable the MFA server…» when turning on No second factor installed Step 1: install VPN or SSO
«Access from the internet is not allowed» The switch is off, or the network you come from is not trusted but you thought it was Step 14; step 10 for the networks
«From outside the internal network an OTP code is needed, but the MFA service is not answering. Try again later, or sign in from the internal network or the VPN.» The code server is stopped: from outside access is refused by design Sign in from inside or from the VPN and check the service in System → Status
«The token is locked after too many wrong codes: ask an administrator to unlock it.» Too many wrong codes An administrator presses «Unblock» in Tools → MFA enrollment
«Wrong or expired code. Try again with the current one.» (while enrolling) The code changed while you typed it, or the phone’s time is off Set the time to automatic
«The time to enter the code has run out: sign in again.» More than five minutes Start again
«Too many failed attempts. Try again later.» 5 errors from the same account or 20 from the same address in 15 minutes Wait. If the address has also been banned by fail2ban, another administrator removes it from System → Settings → Brute Force Defender → Blocked addresses, «Unblock» button
A user cannot find the MFA enrollment item None of the four conditions of step 3 is true, or it is a non-person account Check the module; appliance version
After a password change from outside, the page does not start at once From outside the password change comes after the code Follow the code step, then change the password

Examples

John Smith from home, with just the phone

John is not an administrator: he sees only Tools. From the phone he opens https://atlas.johnsmith.test/, types jsmith and the password and presses «Log in»; at the «Verification code» page he types the 6 digits from the app and presses «Verify». He opens Tools → Mail (if the Groupware module is there) or Tools → Folders. If instead he uses a program that cannot show a second step (Edon Client without SSO), in the password field he types the password immediately followed by the code: <password>123456.

An address banned by mistake

Jack got the password wrong several times from the café and can no longer even see the sign-in page: his address was banned by fail2ban. Another administrator, from a trusted network, opens System → Settings → Brute Force Defender, «Blocked addresses» tab, finds the address (with its DNS name, if resolvable, and the reason) and presses «Unblock»: «Address unblocked» appears. The lockout of the domain account (threshold, duration) is another thing and is removed from Active Directory → Users with «Unblock».

Closing the console again

If you go on holiday and do not want the console exposed, go back to System → Settings → Remote Support and Monitoring and turn off «Allow access to the UI from the internet». Turning it off is always possible; the notification is «UI closed to the internet». The enrolled tokens stay, and the VPN and the other functions that ask for the code are not touched.

Checklist before saying “done”

  1. The second factor is there (VPN or SSO) and every person who must sign in from outside has an “active” token.
  2. The office networks are «Trusted» in Network → IPAM and do not ask for the code.
  3. Account lockout threshold and Brute Force Defender are active.
  4. The «Allow access to the UI from the internet» switch is on and you have tested from the mobile network.
  5. You have tried root from outside (refused) and a user without a token (refused with the message about the token).

Things to know

  • The second factor is asked of everyone from outside, even those without the VPN. That is why the enrollment item is open to every person (atlas#53).
  • A private network (VLAN, second LAN) not marked «Trusted» counts as the internet. The default gateway always counts as outside: a router that forwards ports makes the whole internet look “internal”. If the router masquerades the addresses (instead of only forwarding), visitors appear with the router’s address and the protections against repeated logins treat them as a single client: check with the router’s technician.
  • Networks marked «Trusted» are never blocked by fail2ban: if a colleague at the site gets blocked often, mark their network in Network → IPAM instead of raising the thresholds.
  • The HTTPS console (443) follows the operator’s local firewall rules: a «Drop» rule on 443 closes it to you too. Firewall changes must be confirmed within 60 seconds.
  • If the second factor disappears later (for example you remove VPN and SSO), the switch stays on but the console from the internet is unusable until you restore it; turning it off is always possible.
  • Turning off «Enable MFA on the VPNs» removes the code from the VPN, not from the console (which keeps asking for it from the internet); if SSO is not installed, though, the enrolled tokens are deleted and must be redone.

For the technician With the interface closed, nginx lets only the client programs’ paths through from outside (/api/health, Edon Client, agents, Argos synchronisation, Citadel’s login, /download, /assist, /pabx/cfg/, /chat, /svc/mcp). The code server is privacyIDEA (edon-mfa); if edon-pgsql is restarted it may answer 500 until edon-mfa is restarted too. The failed-attempts log has a fixed line that fail2ban reads (agent “management interface”).

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer