-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[macOS][packaging] Create an app bundle along with other package_data #7263
[macOS][packaging] Create an app bundle along with other package_data #7263
Conversation
@directionless this creates a simple app structure alongside the other Updating the packaging repo next |
Can we have it so that the osqueryd binary is only installed into the app bundle? |
I'm good either way, but I want to note that if we do that, end users will not be able to get a bare signed osqueryd. Only the app bundle. (Moving the binary out invalidates the signature) |
Yeah, we can just remove the earlier Lines 475 to 478 in be520e5
But as per @alessandrogario's comment, I am keeping most of |
Where is the signature data stored when you sign an app bundle? Is it possible to sign the binary, then sign the outer app bundle? |
|
For the |
yep, @directionless already did that |
I don't think so. I think the outer signature overwrites the inner. Using one of the app bundles from a CI build (ignore the notarization errors) # Existing sig, invalid in app bundle, valid outside it:
$ /usr/sbin/spctl -a -vvv --ignore-cache osquery.app/Contents/MacOS/osqueryd
osquery.app/Contents/MacOS/osqueryd: code has no resources but signature indicates they must be present
$ cp osquery.app/Contents/MacOS/osqueryd osquery-one
$ /usr/sbin/spctl -a -vvv --ignore-cache osquery-one
osquery-one: rejected
source=Unnotarized Developer ID
origin=Developer ID Application: OSQUERY A Series of LF Projects, LLC (3522FA9PXF)
# signed app bundle, valid inside but not outside:
$ codesign -s "3522FA9PXF" --force --entitlements /tmp/pd/control/osquery.entitlements --options runtime -v --timestamp osquery.app
osquery.app: replacing existing signature
osquery.app: signed app bundle with Mach-O thin (x86_64) [io.osquery.agent]
$ /usr/sbin/spctl -a -vvv --ignore-cache osquery.app/Contents/MacOS/osqueryd
osquery.app/Contents/MacOS/osqueryd: accepted
source=Notarized Developer ID
origin=Developer ID Application: OSQUERY A Series of LF Projects, LLC (3522FA9PXF)
$ cp osquery.app/Contents/MacOS/osqueryd osquery-two
$ /usr/sbin/spctl -a -vvv --ignore-cache osquery-two
osquery-two: invalid resource directory (directory or signature have been modified) I'm not sure how many people want a bare macho binary. My gut sense is that that's only something wanted by some vendors. I'm willing to ship both, or just the |
Notarization is for apps, so To summarize, if you release just the notarized osquery |
No, this is not correct. macho binaries, when then have the quarantine bit set, also must be notarized. My example showed notarization errors, because I didn't want to submit them to apple and wait for the test case. The plain signature was enough to show what was happening. I don't think the
|
Does this need the sha from osquery/osquery-packaging#11 ? |
Yeah, I can change it here, give me a minute. |
As I just commented in slack: So, conclusion from office hours:
I’m not sure what that means for the existing PRs sharvil has in flight. I’m not sure osqueryd should be in package-data/opt/osquery/bin/osqueryd, since that should be the symlink. I think there’s some nonsense to work through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbing this along the way. There may be more changes needed
…1 to master * commit 'f72b7c5510b8cd78c9d0450cbd1f31903681caa5': (53 commits) Add `TimeoutStopSec` to systemd unit files (osquery#7190) Prevent osquery from killing itself when the --force flag is used (osquery#7295) Linux: Support AF_PACKET sockets. (osquery#7282) libs: update openssl to 1.1.1l (osquery#7293) Correct macOS installed app bundle path in osqueryctl and doc (osquery#7289) macos path fix in launchd plist (osquery#7288) Update osquery installed artifacts default paths in code (osquery#7285) Update osquery installed artifacts paths in the documentation (osquery#7286) Update packaging SHA (osquery#7279) Change to the `disk_encryption` table to support QueryContext (osquery#7209) Add feature to skip denylist for event-based queries (osquery#7158) Support pid_with_namespace in more tables (osquery#7132) audit: socket_events improvements (osquery#7269) [linux][packaging] Update packaging paths (osquery#7271) Change logger_mode flag to be actually interpreted as an octal (osquery#7273) Update `uptime` table descrption (osquery#7270) [macOS][packaging] Create an app bundle along with other package_data (osquery#7263) Add case sensitive pragma to the pragma/actions authorizer allow list (osquery#7267) Fix audit rule removal upon osquery exit (osquery#7221) Fix osquery_info build_platform column value on Linux (osquery#7254) ...
Create an app bundle structure along side the other
package_data