id: os_sudoers_timestamp_type_configure
title: Configure Sudoers Timestamp Type
discussion: |
  The file /etc/sudoers _MUST_ be configured to not include a timestamp_type of global or ppid and be configured for timestamp record types of tty.

  This rule ensures that the "sudo" command will prompt for the administrator's password at least once in each newly opened terminal window. This prevents a malicious user from taking advantage of an unlocked computer or an abandoned logon session by bypassing the normal password prompt requirement.
references:
  nist:
    cce:
      macos_27:
        - CCE-XXXXX-X
      macos_26:
        - CCE-95318-2
      macos_15:
        - CCE-94312-6
      macos_14:
        - CCE-92909-1
    800-53r5:
      - CM-5(1)
      - IA-11
    800-171r3:
      - 03.05.01
  disa:
    cci:
      - CCI-002038
    srg:
      - SRG-OS-000373-GPOS-00157
      - SRG-OS-000373-GPOS-00156
    disa_stig:
      macos_26:
        - APPL-26-004060
      macos_15:
        - APPL-15-004060
      macos_14:
        - APPL-14-004060
  bzk:
    bio:
      - 8.27
      - 8.27.01
  cis:
    benchmark:
      macos_26:
        - 5.5 (level 1)
      macos_15:
        - 5.5 (level 1)
      macos_14:
        - 5.5 (level 1)
    controls_v8:
      - 4.3
platforms:
  macOS:
    '27.0': {}
    '26.0':
      benchmarks:
        - name: cis_lvl1
        - name: cis_lvl2
        - name: disa_stig
          severity: medium
        - name: nlmapgov_plus
    '15.0':
      benchmarks:
        - name: cis_lvl1
        - name: cis_lvl2
        - name: disa_stig
          severity: medium
        - name: nlmapgov_plus
    enforcement_info:
      check:
        shell: '/usr/bin/sudo /usr/bin/sudo -V | /usr/bin/awk -F": " ''/Type of authentication timestamp record/{print $2}'''
        result:
          string: tty
      fix:
        shell: /usr/bin/find /etc/sudoers* -type f -exec sed -i '' '/timestamp_type/d; /!tty_tickets/d' '{}' \;
tags:
  - 800-171
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - cisv8
  - cnssi-1253_low
  - cnssi-1253_high
  - cnssi-1253_moderate
