Skip to Content
Installation

Log In to Mondoo Platform With Your Browser

Log in to Mondoo Platform from cnspec as yourself, with your browser or a one-time code, to scan from your own machine without a registration token.

cnspec login without a token logs you in to Mondoo Platform as yourself. You approve the login in your browser, and cnspec can then scan and report results for a limited time. You don't need a registration token, and nothing is registered permanently.

Use it to scan from your own workstation. For a server, a service, or a pipeline that scans on its own, register cnspec instead.

Choose how to connect cnspec

Log in with your browserRegister with a token
Commandcnspec logincnspec login --token "TOKEN"
Who cnspec isYou. Results are reported under your user.A service account created for this machine.
What you need firstA Mondoo account with access to a space.A registration token or a credentials file.
How long it lasts8 hours. Log in again after that.Until you log out or the service account is removed.
What it can doScan, and report the results to the space you choose.Scan, report, and run as a service.
Needs a terminalYes. Someone has to approve the login.No.

Log in

  1. In a terminal, run:

    cnspec login

    If your organization is not in the US region, name your region's API endpoint. Read Log in to another region.

  2. Your browser opens the Mondoo Console. If you aren't signed in to Mondoo, sign in.

  3. The page Authorize Mondoo CLI says that Mondoo CLI wants to sign in to Mondoo as you. Check that it is the login you just started: Device names your machine, Client names the cnspec version, and Requested shows when the login began. If you didn't start it, select Deny.

    The Authorize Mondoo CLI page in the Mondoo Console, with the device, the cnspec version, when the login was requested, what the login will be able to do, and the organization to sign in to

  4. Under Sign in to, select your organization. Then choose what the login is for:

    • One space: select the space that receives your scan results.
    • The whole organization: scans go to the organization, and its asset routing rules decide the space of each asset.
  5. Select Approve.

  6. Return to the terminal. cnspec confirms the login and says when it ends:

    ✓ Logged in as sasha@lunalectric.com · space Lunalectric/Production · valid until 2026-12-01 17:30 CET (8h)

You can now scan. For example:

cnspec scan local

If the browser does not open

cnspec prints the URL it tried to open. Open it in any browser, approve the login, and paste the code the page shows into the terminal.

Log in without a browser on the machine

On a machine without a browser, for example over SSH, cnspec logs you in with a one-time code. You can also ask for this:

cnspec login --no-browser

cnspec prints a one-time code and a URL:

! First copy your one-time code: WXYZ-1234
Open https://app.mondoo.com/activate?region=US in a browser and enter the code.

Open the URL in a browser on any device, sign in to Mondoo, enter the code, and continue as in steps 3 to 5 above. The terminal confirms the login when you are done.

If the machine does have a browser and you didn't pass --no-browser, cnspec also offers to open the page there: press Enter.

The code is valid for 10 minutes. If it runs out before you approve, run the command again.

Log in to another region

A login belongs to one region, and cnspec login uses the US region unless you say otherwise. If your organization is in another region, pass that region's API endpoint:

cnspec login --api-endpoint https://eu.api.mondoo.com

If the page in the browser has no organization or space to choose, you are most likely in the wrong region.

cnspec stores the endpoint with the login, so later commands such as cnspec scan don't need the flag.

What a login can do

A login is you: Mondoo records scans and results under your user, and you can never do more with it than your own permissions allow. It is also narrower than you:

  • It works in the space or organization you chose, and nowhere else.
  • It can scan and report results, and fetch the policies a scan needs.
  • It cannot change anything else. Commands that manage policies and frameworks, such as cnspec policy upload and cnspec policy list, are refused. Run those with a registered cnspec.
  • It ends after 8 hours and is not renewed. Run cnspec login again to continue.

While a login is valid, cnspec login only confirms it:

✓ Already logged in as sasha@lunalectric.com · space Lunalectric/Production · valid until 2026-12-01 17:30 CET (6h)
Run "cnspec logout" first, or "cnspec login --force" to log in again.

To log in again anyway, for example for another space, run cnspec login --force.

On a machine that is already registered

cnspec login keeps an existing registration and does not start a browser login. To log in as yourself on such a machine, keep the login in its own configuration file and name that file when you scan:

cnspec login --config ~/.config/mondoo/login.yml
cnspec scan local --config ~/.config/mondoo/login.yml

See and end your logins

To log out from the terminal:

cnspec logout

This ends the login on Mondoo Platform and removes it from the configuration file.

To revoke a login from the Mondoo Console:

  1. In the top right corner of the Mondoo Console, select your user icon and then User Settings.
  2. Select Authentication.
  3. Under Active sessions, find the login. Each row shows the device, the client, what the login can do, what it is signed in to, and when it expires.
  4. Select Revoke and confirm.

A revoked login stops working within a few minutes. Owners and editors of a space or an organization also see its logins under Active sessions in the space or organization settings, and can revoke them there.

Troubleshoot

What you seeWhat it meansWhat to do
browser login is not enabled on this server — use cnspec login --tokenThe Mondoo Platform you are connecting to does not offer browser login.Register cnspec with a token.
The page has no organization or space to chooseYour account has no access in this region.Log in to another region.
the login request was deniedThe login was denied in the browser.Run cnspec login again and select Approve.
the login request expired before it was approvedThe one-time code ran out.Run cnspec login --no-browser again and approve within a few minutes.
your login ended at ...The login ended after 8 hours.Run cnspec login.
the server no longer accepts your login: it has ended or was revokedThe login was revoked in the Mondoo Console, or it ended.Run cnspec login.
no valid permissions to access the resource from a cnspec policy commandA login can scan. It cannot manage policies.Run the command with a registered cnspec.
client is already logged in, skippingcnspec on this machine is registered, and cnspec login keeps the registration.Use a separate configuration file, as described under What a login can do.
run cnspec login in a terminal, or pass a registration tokencnspec login is not running in a terminal, so nobody can approve a login.Run it in a terminal, or register cnspec for a machine that runs unattended.

Last updated on

On this page