brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: codesign -dv shows who signed an app on your Mac

Security
~/tips/tip-macos-codesign-display

codesign -dv --verbose=4 /Applications/SomeApp.app

Shows the developer and certificate chain behind an app's code signature.

When an app wants an admin password or Full Disk Access, I want to know who actually made it. The name in the menu bar can say anything; the code signature can’t. codesign ships with every Mac and reads it for you.

To see the signature details:

codesign -dv --verbose=4 /Applications/SomeApp.app

The lines I look at are the Authority lines, which show the certificate chain from the developer’s certificate up to Apple, and TeamIdentifier, the developer’s team ID. That ID stays the same across all apps from one developer, so it’s a good way to check that an update really comes from the same people as the version you had.

codesign writes this info to standard error, so to filter it you redirect that first:

codesign -dv --verbose=4 /Applications/SomeApp.app 2>&1 | grep -E 'Authority|TeamIdentifier'

If you also want to know whether the app was changed after it was signed, the man page has a verify mode. Without other output it stays quiet on success, so add --verbose:

codesign --verify --verbose /Applications/SomeApp.app

The caveat: a valid signature tells you who signed it, not whether the app is trustworthy. A developer can sign junk too. And plenty of command-line tools and scripts aren’t signed at all, so a missing signature on a Homebrew binary is less alarming than on an app that asks for your password.

Further reading: codesign man page, App code signing process in Apple Platform Security

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link