Skip to content
Cryptography
ASD ISMISM-0487

ASD ISM 0487 Disable certain features for passwordless SSH logins

What it says

When using logins without a password for SSH connections, the following are disabled:

  • access from IP addresses that do not require access
  • port forwarding
  • agent credential forwarding
  • X11 forwarding
  • console access.

Quoted as published. Everything else on this page is written by Control Stack.

In plain English

Where SSH logins need no password, allow them only from the IP addresses that need access, and switch off port, agent credential and X11 forwarding and console access for them.

When SSH logins are made without a password, as when an automated job logs on with a key that no person unlocks, the following must be disabled for those logins:

  • access from any IP address that does not require it
  • port forwarding, which tunnels other connections through the session
  • agent credential forwarding, which lets the server use keys loaded on the connecting computer
  • X11 forwarding (remote graphical display) and console access (an interactive logon).

Why it matters

A passwordless key works for whoever obtains it. Limiting it to its source addresses and disabling forwarding and console access means it cannot be used from elsewhere, open tunnels or start an interactive session, and a compromised server cannot borrow the job's forwarded keys.

How to implement

  1. List every SSH login that needs no password.

    For each automated job, record the account, key, target server and the source addresses it connects from. Compare the authorised keys files on servers with this list, so keys nobody can explain show up, then remove those.

  2. Restrict each key where it is installed.

    In its authorised keys entry, add from= with the job's source addresses and the restrict option, which turns off port, agent and X11 forwarding and terminal allocation. On servers too old for restrict, use no-port-forwarding, no-agent-forwarding, no-X11-forwarding and no-pty. Add the forced command ISM-0488 requires.

  3. Back the key options with server settings.

    In a Match block for each automation account, set AllowTcpForwarding, AllowAgentForwarding, X11Forwarding and PermitTTY to no, in case a key lacks options. Limit source addresses at the host firewall too. Block console logons for the account in the server's logon access rules, not with a nologin shell, which also stops forced commands.

  4. Apply limits in each job's client and on providers' servers.

    Set ForwardAgent no and ForwardX11 no in every job's client settings, since a compromised server can ignore its own settings. For a provider's server, ask the provider to restrict your account's source addresses, forwarding and console access, and keep their confirmation; where it cannot, record a shortfall.

Keep it running

Update a key's allowed source addresses when its job moves to a new host, and remove the key when the job is retired (ISM-2146). Recheck the restrictions whenever someone edits authorised keys files or Match blocks.

Evidence and audit

  1. Check 1 of 3What an auditor asks for

    Ask for

    The authorised keys files for every service and automation account on a sample of SSH servers drawn from a network scan, with the list of passwordless logins and their jobs.

    Look at

    Whether each key matches a listed job and carries a source address limit and the forwarding and terminal restrictions.

    Good evidence

    Every key used without a password matches a listed job, is limited to that job's source addresses, and has port, agent and X11 forwarding and console access disabled.

  2. Check 2 of 3What an auditor asks for

    Ask for

    A test logon with a sampled automation key from an address outside its allowed list, then from an allowed address.

    Look at

    Whether the first is refused, and whether the second can open a terminal, a port forward, agent forwarding or X11 forwarding.

    Good evidence

    The logon from the other address fails, and from the allowed address all four requests are refused.

  3. Check 3 of 3What an auditor asks for

    Ask for

    The local logon settings for the sampled automation accounts.

    Look at

    Whether each account can log on interactively at the server's console.

    Good evidence

    None of the sampled accounts can log on at the console.

Mappings

Closest match in ISO/IEC 27001: A.5.15, Access control, which this control partially meets.

ISO 27001

ISO/IEC 27001: 2 mappings

  • A.5.15Access controlPartially meets
  • A.8.9Configuration managementPartially meets

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.