id: file-change-default-port

info:
  name: Change SSH Default Port
  author: pussycat0x
  severity: info
  description: |
    Reduces Automated Attacks: Changing the default port can help avoid most automated attacks that target port 22.
  remediation: |
    Set Port 2222 in /etc/ssh/sshd_config to change the default SSH port and restart the SSH service.
  reference:
    - https://vishalraj82.medium.com/hardening-openssh-security-37f5d634015f
    - https://gcore.com/learning/how-to-change-ssh-port/
  metadata:
    verified: true
  tags: audit,config,file,ssh

file:
  - extensions:
      - all

    matchers:
      - type: word
        words:
          - "#Port 22"
          - "# This is the sshd server system-wide configuration file"
        condition: and
# digest: 4a0a00473045022100e31a7b6e239ee575928c298085701bd16125c3c72e86466f51bebf03b782d9880220237893576668b4ebbb1904c323ff9e686059513594457a6d1a35daf608a6d700:922c64590222798bb761d5b6d8e72950