Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardened macOS binaries and libraries with the runtime hardened flag set on #428

Open
dferreiralopessc opened this issue Feb 7, 2023 · 0 comments
Labels
enhancement New feature or request mac

Comments

@dferreiralopessc
Copy link

Currently, the ruby binary coming with td-agent is not hardened

> codesign -dv /opt/td-agent/bin/ruby
Executable=/opt/td-agent/bin/ruby
Identifier=ruby-5555494463eb77d3aef0307a949c84abf11e480c
Format=Mach-O thin (x86_64)
CodeDirectory v=20400 size=614 flags=0x2(adhoc) hashes=13+2 location=system
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=0 size=12

The runtime hardened protection on macOS ensures processes started with runtime hardened protected binaries are not inspected or altered. As an example, it is possible to start the td-agent deamon and inspect the process with lldb.
More on hardened runtine protection can be found here

It is best practice to secure binaries and all libraries used by it with the hardened runtime protection to avoid unwanted parties to inspect memory and/or alter flow of execution.
The runtime flag can be set on a binary with

codesign -f -s 'apple_developper_certificate' --option=runtime /opt/td-agent/bin/ruby

This will also need to be done on other libraries used by the binary (ie: /opt/td-agent/lib/*.dylib).

Is this something we could do as part of the build process here for td-agent on macOS?

@ashie ashie added enhancement New feature or request mac labels Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mac
Projects
None yet
Development

No branches or pull requests

2 participants