id: gdm-disable-user-list-enabled-check

info:
  name: Ensure GDM disable-user-list Option is Enabled
  author: Th3l0newolf
  severity: low
  description: |
    This template checks whether the GDM disable-user-list option is enabled.
  remediation: |
    Enable the `disable-user-list` option in GDM to prevent displaying the
    list of local users on the login screen.
  reference:
    - https://www.cisecurity.org/benchmark/ubuntu_linux
  tags: cis,linux,ubuntu,gdm,login,audit
  metadata:
    verified: true

self-contained: true

code:
  - engine:
      - bash
    args:
      - "-c"
      - |
        if [ "$(gsettings get org.gnome.login-screen disable-user-list 2>/dev/null)" = "true" ]; then
          echo "[gdm-disable-user-list-enabled-check:Policy-Pass] [GDM disable-user-list option is enabled] [CIS_PASS] [low]"
        else
          echo "[gdm-disable-user-list-enabled-check:Policy-Fail] [GDM disable-user-list option is not enabled] [CIS_FAIL] [low]"
        fi

    matchers:
      - type: word
        name: policy-pass
        words:
          - "Policy-Pass"

      - type: word
        name: policy-fail
        words:
          - "Policy-Fail"
# digest: 4a0a00473045022025a93b7d3071b399ffeb3961566cdd9c923917af8678a1a885e811441fa04f01022100a84cee2408f06cfe157bdfcc217d3d32df9a8292f62566c1fad7b7b4542d4758:922c64590222798bb761d5b6d8e72950