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.
check: |
  /usr/bin/sudo /usr/bin/sudo -V | /usr/bin/awk -F": " '/Type of authentication timestamp record/{print $2}'
result:
  string: tty
fix: |
  [source,bash]
  ----
  /usr/bin/find /etc/sudoers* -type f -exec sed -i '' '/timestamp_type/d; /!tty_tickets/d' '{}' \;
  ----
references:
  cce:
    - CCE-94312-6
  cci:
    - CCI-002038
  800-53r5:
    - CM-5(1)
    - IA-11
  800-53r4:
    - IA-11
  srg:
    - SRG-OS-000373-GPOS-00157
    - SRG-OS-000373-GPOS-00156
  disa_stig:
    - APPL-15-004060
  cis:
    benchmark:
      - 5.5 (level 1)
    controls v8:
      - 4.3
  800-171r3:
    - 03.05.01
  bio:
    - 8.27.01
macOS:
  - '15.0'
tags:
  - 800-171
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - cis_lvl1
  - cis_lvl2
  - cisv8
  - cnssi-1253_low
  - cnssi-1253_high
  - stig
  - cnssi-1253_moderate
  - nlmapgov_plus
severity: medium
mobileconfig: false
mobileconfig_info:
