Page MenuHomePhabricator

Move management routers ssh port
Open, LowPublic

Description

The management routers have ssh open to the world for OOB access.
As it listens on the standard port 22/tcp, it's subject to a lot of bruteforce attempts
They're all unsuccessful as we use key auth, which has been improved with T163969, but those are still:
1/ flooding the logs
2/ occasionally overwhelming the CPU

The next step is to move the ssh port to a different port (eg. 2222) to reduce most of those attempts.

The .ssh/config file will need to be updated accordingly so normal and emergency access stays smooth.

Event Timeline

ayounsi created this task.

This is not supported by 3/5 of our management routers. They will need to be replaced by more recent gear anyway.

ayounsi mentioned this in Unknown Object (Task).Mar 24 2021, 8:53 AM
ayounsi added a subtask: Unknown Object (Task).

I changed the LibreNMS check to exclude management routers.
To revert once this task is done:

Processor usage over 85% EXCEPT Management routers

RobH closed subtask Unknown Object (Task) as Resolved.Nov 5 2021, 7:56 PM

Change 785274 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/homer/public@master] Management routers: move ssh port to 2222

https://gerrit.wikimedia.org/r/785274

Before we merge/deploy any of those changes, Rancid and Homer use 22 as default SSH port.
Rancid supports adding :22 after the hostname according to this comment.

Homer will need a patch to support custom ports.

Change 890394 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/software/homer@master] Allow different port than default 22

https://gerrit.wikimedia.org/r/890394

Change 890402 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/puppet@production] Rancid: use port 2222 for mgmt routers

https://gerrit.wikimedia.org/r/890402

Change 890811 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/homer/public@master] Use port 2222 for management router ssh

https://gerrit.wikimedia.org/r/890811

Change 785274 abandoned by Ayounsi:

[operations/homer/public@master] Management routers: move ssh port to 2222

Reason:

Squash fail... Change moved to I8fab3debc72ee51271ee71060ea72ba1beaab73d

https://gerrit.wikimedia.org/r/785274

Change 890394 merged by jenkins-bot:

[operations/software/homer@master] Allow different port than default 22

https://gerrit.wikimedia.org/r/890394