Module: EndpointSecurity::Availability

Defined in:
lib/endpoint_security/availability.rb,
lib/endpoint_security/generated/availability.rb

Overview

Runtime support metadata for SDK events.

Constant Summary collapse

EVENT_MIN_OS =

Minimum macOS version keyed by event symbol.

{
  auth_exec: "10.15",
  auth_open: "10.15",
  auth_kextload: "10.15",
  auth_mmap: "10.15",
  auth_mprotect: "10.15",
  auth_mount: "10.15",
  auth_rename: "10.15",
  auth_signal: "10.15",
  auth_unlink: "10.15",
  notify_exec: "10.15",
  notify_open: "10.15",
  notify_fork: "10.15",
  notify_close: "10.15",
  notify_create: "10.15",
  notify_exchangedata: "10.15",
  notify_exit: "10.15",
  notify_get_task: "10.15",
  notify_kextload: "10.15",
  notify_kextunload: "10.15",
  notify_link: "10.15",
  notify_mmap: "10.15",
  notify_mprotect: "10.15",
  notify_mount: "10.15",
  notify_unmount: "10.15",
  notify_iokit_open: "10.15",
  notify_rename: "10.15",
  notify_setattrlist: "10.15",
  notify_setextattr: "10.15",
  notify_setflags: "10.15",
  notify_setmode: "10.15",
  notify_setowner: "10.15",
  notify_signal: "10.15",
  notify_unlink: "10.15",
  notify_write: "10.15",
  auth_file_provider_materialize: "10.15",
  notify_file_provider_materialize: "10.15",
  auth_file_provider_update: "10.15",
  notify_file_provider_update: "10.15",
  auth_readlink: "10.15",
  notify_readlink: "10.15",
  auth_truncate: "10.15",
  notify_truncate: "10.15",
  auth_link: "10.15",
  notify_lookup: "10.15",
  auth_create: "10.15",
  auth_setattrlist: "10.15",
  auth_setextattr: "10.15",
  auth_setflags: "10.15",
  auth_setmode: "10.15",
  auth_setowner: "10.15",
  auth_chdir: "10.15.1",
  notify_chdir: "10.15.1",
  auth_getattrlist: "10.15.1",
  notify_getattrlist: "10.15.1",
  notify_stat: "10.15.1",
  notify_access: "10.15.1",
  auth_chroot: "10.15.1",
  notify_chroot: "10.15.1",
  auth_utimes: "10.15.1",
  notify_utimes: "10.15.1",
  auth_clone: "10.15.1",
  notify_clone: "10.15.1",
  notify_fcntl: "10.15.1",
  auth_getextattr: "10.15.1",
  notify_getextattr: "10.15.1",
  auth_listextattr: "10.15.1",
  notify_listextattr: "10.15.1",
  auth_readdir: "10.15.1",
  notify_readdir: "10.15.1",
  auth_deleteextattr: "10.15.1",
  notify_deleteextattr: "10.15.1",
  auth_fsgetpath: "10.15.1",
  notify_fsgetpath: "10.15.1",
  notify_dup: "10.15.1",
  auth_settime: "10.15.1",
  notify_settime: "10.15.1",
  notify_uipc_bind: "10.15.1",
  auth_uipc_bind: "10.15.1",
  notify_uipc_connect: "10.15.1",
  auth_uipc_connect: "10.15.1",
  auth_exchangedata: "10.15.1",
  auth_setacl: "10.15.1",
  notify_setacl: "10.15.1",
  notify_pty_grant: "10.15.4",
  notify_pty_close: "10.15.4",
  auth_proc_check: "10.15.4",
  notify_proc_check: "10.15.4",
  auth_get_task: "10.15.4",
  auth_searchfs: "11.0",
  notify_searchfs: "11.0",
  auth_fcntl: "11.0",
  auth_iokit_open: "11.0",
  auth_proc_suspend_resume: "11.0",
  notify_proc_suspend_resume: "11.0",
  notify_cs_invalidated: "11.0",
  notify_get_task_name: "11.0",
  notify_trace: "11.0",
  notify_remote_thread_create: "11.0",
  auth_remount: "11.0",
  notify_remount: "11.0",
  auth_get_task_read: "11.3",
  notify_get_task_read: "11.3",
  notify_get_task_inspect: "11.3",
  notify_setuid: "12.0",
  notify_setgid: "12.0",
  notify_seteuid: "12.0",
  notify_setegid: "12.0",
  notify_setreuid: "12.0",
  notify_setregid: "12.0",
  auth_copyfile: "12.0",
  notify_copyfile: "12.0",
  notify_authentication: "13.0",
  notify_xp_malware_detected: "13.0",
  notify_xp_malware_remediated: "13.0",
  notify_lw_session_login: "13.0",
  notify_lw_session_logout: "13.0",
  notify_lw_session_lock: "13.0",
  notify_lw_session_unlock: "13.0",
  notify_screensharing_attach: "13.0",
  notify_screensharing_detach: "13.0",
  notify_openssh_login: "13.0",
  notify_openssh_logout: "13.0",
  notify_login_login: "13.0",
  notify_login_logout: "13.0",
  notify_btm_launch_item_add: "13.0",
  notify_btm_launch_item_remove: "13.0",
  notify_profile_add: "14.0",
  notify_profile_remove: "14.0",
  notify_su: "14.0",
  notify_authorization_petition: "14.0",
  notify_authorization_judgement: "14.0",
  notify_sudo: "14.0",
  notify_od_group_add: "14.0",
  notify_od_group_remove: "14.0",
  notify_od_group_set: "14.0",
  notify_od_modify_password: "14.0",
  notify_od_disable_user: "14.0",
  notify_od_enable_user: "14.0",
  notify_od_attribute_value_add: "14.0",
  notify_od_attribute_value_remove: "14.0",
  notify_od_attribute_set: "14.0",
  notify_od_create_user: "14.0",
  notify_od_create_group: "14.0",
  notify_od_delete_user: "14.0",
  notify_od_delete_group: "14.0",
  notify_xpc_connect: "14.0",
  notify_gatekeeper_user_override: "15.0",
  notify_tcc_modify: "15.4",
  reserved_0: "26.3",
  reserved_1: "26.3",
  reserved_2: "26.3",
  reserved_3: "26.4.0",
  reserved_4: "26.4.0",
  reserved_5: "26.4.0",
  reserved_6: "26.4.0",
  reserved_7: "26.5",
  reserved_8: "26.5"
}.freeze

Class Method Summary collapse

Class Method Details

.clear_probe_cache! ⇒ Hash

Clears native subscription probe results.

Returns:

  • (Hash) —

    emptied cache



28
# File 'lib/endpoint_security/availability.rb', line 28

def clear_probe_cache! = @probe_cache.clear

.probe_cache ⇒ Hash<Symbol, Boolean>

Results of native one-event subscription probes.

Returns:

  • (Hash<Symbol, Boolean>)


24
# File 'lib/endpoint_security/availability.rb', line 24

def probe_cache = @probe_cache

.runtime_version ⇒ Gem::Version

Returns running macOS version.

Returns:

  • (Gem::Version) —

    running macOS version



13
14
15
# File 'lib/endpoint_security/availability.rb', line 13

def runtime_version
  @runtime_version ||= Gem::Version.new(Open3.capture2("sw_vers", "-productVersion").first.strip)
end

.supported_event?(event) ⇒ Boolean

Returns whether event is available on this macOS version.

Returns:

  • (Boolean) —

    whether event is available on this macOS version



18
19
20
# File 'lib/endpoint_security/availability.rb', line 18

def supported_event?(event)
  runtime_version >= Gem::Version.new(EVENT_MIN_OS.fetch(event.to_sym))
end