id: insecure-etc-inetd-conf-permissions

info:
  name: macOS Insecure /etc/inetd.conf Permissions
  author: geeknik
  severity: high
  description: |
    Verifies permissions on the /etc/inetd.conf file used to configure the inetd daemon on macOS.
  impact: |
    Insecure permissions on /etc/inetd.conf could allow unauthorized users to modify the file and enable or disable network services.
  remediation: |
    Ensure that the /etc/inetd.conf file is owned by root with a system group (wheel, admin, etc.) and has permissions of 0644 or more restrictive.
  tags: macos,audit,local,security

self-contained: true

code:
  - engine:
      - sh
      - bash
    source: |
      ls -l /etc/inetd.conf 2>&1
    matchers-condition: and
    matchers:
      - type: status
        status:
          - 0
      - type: regex
        regex:
          - "^-rw-r--r--\\s+\\d+\\s+root\\s+\\w+"
        negative: true
# digest: 490a0046304402203a17f921ddd73a973258b7a7fe563d18218462436e060a5b6d27111c18f26f46022035c897ff32e61af7c5bf2dfd63b3c5c318182e88ce292d46962b404675dd93cc:922c64590222798bb761d5b6d8e72950