endpoint_security 0.1.0-universal-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop.yml +44 -0
- data/LICENSE.txt +21 -0
- data/README.md +114 -0
- data/Rakefile +170 -0
- data/codegen/ast.rb +67 -0
- data/codegen/emit_c.rb +68 -0
- data/codegen/emit_ruby.rb +128 -0
- data/codegen/ir.rb +193 -0
- data/codegen/overlay/availability.yml +158 -0
- data/codegen/overlay/version_map.yml +92 -0
- data/codegen/run.rb +80 -0
- data/codegen/snapshots/26.5.json +5828 -0
- data/examples/eslogger_clone.rb +5 -0
- data/examples/execblock.rb +16 -0
- data/examples/filemon.rb +10 -0
- data/examples/procmon.rb +13 -0
- data/ext/endpoint_security/client.c +795 -0
- data/ext/endpoint_security/client.h +88 -0
- data/ext/endpoint_security/endpoint_security.c +17 -0
- data/ext/endpoint_security/extconf.rb +37 -0
- data/ext/endpoint_security/field.c +719 -0
- data/ext/endpoint_security/field.h +42 -0
- data/ext/endpoint_security/generated/es_schema.c +1233 -0
- data/ext/endpoint_security/message.c +426 -0
- data/ext/endpoint_security/message.h +13 -0
- data/ext/endpoint_security/mute.c +291 -0
- data/ext/endpoint_security/mute.h +8 -0
- data/ext/endpoint_security/queue.c +124 -0
- data/ext/endpoint_security/queue.h +46 -0
- data/ext/endpoint_security/watchdog.c +243 -0
- data/lib/endpoint_security/availability.rb +30 -0
- data/lib/endpoint_security/client.rb +280 -0
- data/lib/endpoint_security/diagnostics.rb +26 -0
- data/lib/endpoint_security/doctor.rb +35 -0
- data/lib/endpoint_security/errors.rb +42 -0
- data/lib/endpoint_security/generated/availability.rb +169 -0
- data/lib/endpoint_security/generated/enums.rb +409 -0
- data/lib/endpoint_security/generated/event_types.rb +520 -0
- data/lib/endpoint_security/message.rb +29 -0
- data/lib/endpoint_security/object_model.rb +170 -0
- data/lib/endpoint_security/recorder.rb +26 -0
- data/lib/endpoint_security/version.rb +6 -0
- data/lib/endpoint_security.rb +38 -0
- data/support/entitlements.plist +8 -0
- data/support/esmock/esmock.c +482 -0
- data/support/esmock/esmock.h +21 -0
- data/support/sign_ruby.sh +13 -0
- metadata +90 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "endpoint_security"
|
|
4
|
+
|
|
5
|
+
blocked_team_id, blocked_signing_id = ARGV
|
|
6
|
+
abort "usage: ruby execblock.rb TEAM_ID SIGNING_ID" unless blocked_team_id && blocked_signing_id
|
|
7
|
+
|
|
8
|
+
ES::Client.open(auth_default: :allow) do |client|
|
|
9
|
+
client.subscribe(:auth_exec)
|
|
10
|
+
client.on(:auth_exec) do |message|
|
|
11
|
+
target = message.event.target
|
|
12
|
+
blocked = target.team_id == blocked_team_id && target.signing_id == blocked_signing_id
|
|
13
|
+
blocked ? message.deny!(cache: false) : message.allow!(cache: false)
|
|
14
|
+
end
|
|
15
|
+
client.run
|
|
16
|
+
end
|
data/examples/filemon.rb
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "endpoint_security"
|
|
4
|
+
|
|
5
|
+
events = %i[notify_open notify_write notify_create notify_unlink notify_rename]
|
|
6
|
+
ES::Client.open do |client|
|
|
7
|
+
client.subscribe(events)
|
|
8
|
+
events.each { |event| client.on(event) { |message| puts JSON.generate(message.to_h) } }
|
|
9
|
+
client.run
|
|
10
|
+
end
|
data/examples/procmon.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "endpoint_security"
|
|
4
|
+
|
|
5
|
+
ES::Client.open do |client|
|
|
6
|
+
client.subscribe(:notify_exec, :notify_fork, :notify_exit)
|
|
7
|
+
client.on(:notify_exec) do |message|
|
|
8
|
+
puts "exec pid=#{message.event.target.pid} path=#{message.event.target.executable.path}"
|
|
9
|
+
end
|
|
10
|
+
client.on(:notify_fork) { |message| puts "fork child=#{message.event.child.pid}" }
|
|
11
|
+
client.on(:notify_exit) { |message| puts "exit pid=#{message.process.pid}" }
|
|
12
|
+
client.run
|
|
13
|
+
end
|