Gatekeeper

RSS for tag

Gatekeeper on macOS helps protect users from downloading and installing malicious software by checking for a Developer ID certificate from apps distributed outside the Mac App Store.

Posts under Gatekeeper tag

200 Posts

Post

Replies

Boosts

Views

Activity

Parallel processing app distributed by developer won't run sandboxed
I have a macOS app that I have been distributing for free outside the app store for more than 15 years, without notarization, without sandboxing, and without hardened runtime, all with no problems. If I understand correctly, macOS will soon be modified so that it will not launch any developer-distributed apps that are not notarized. Notarization will require both hardened runtime and sandboxing, and unhappily, my app will not run when notarized -- I have added sandboxing and hardened runtime, than gotten it notarized and tried -- and that is because it will not run when sandboxed. Thus I have two questions: Will there be some means, that I perhaps have missed, for my users to run my app as is, in un-notarized form with no sandboxing and no hardened runtime? (Assume that they are willing to click "Okay" on any macOS popups of the form "Abandon hope, all ye who enter here.") Perhaps I have missed something about the signing or distribution process ... ? If not, is there some entitlement I can obtain to allow my app to run when sandboxed? Perhaps the question is even "Should there be such an entitlement?" And to that end, I must now explain why it cannot run sandboxed: My app is a parallel processing system: To work properly it must open multiple copies of itself -- that's right, there will be multiple instances of the app window visible on the console, distinguished by tint, title and location so the user can tell which is which, and multiple app badges in the dock, similarly distinguished. Doing so is easy -- I use the c++ "system" function to call the Unix executable that is buried within the ".app" folder, passing it a command tail whereby the launched copy can tell how to distinguish itself. I build up the text string for the call piece by piece, but the result looks rather like this: system("<path-to-my-app>/MyApp.app/Contents/MacOS/MyApp -tail-item-1 -tail-item-2 ... &"); The app is written in mixed C++ and Objective C. The usual "Main.mm" file contains the entry point for the program, a "main()" function that does nothing but call "NSApplicationMain()", but I have added code to "main()" that runs before the call of NSApplicationMain(). That code uses C function "getopt()" to look for the extra command-tail items. If any are present, the app acts appropriately -- generally assigning non-default values to global variables that are used later in initialization. The first instance of the app that is called -- presumably by the user mousing on an icon somewhere -- knows by the absence of extra command-tail items that it is the first one launched, and thus knows to launch multiple additional instances of itself using this mechanism. The launched instances know by the presence of extra command-tail items that they are not the first one launched, and act differently, based on the command-tail items themselves. All this has been working fine for over a decade when the app is not sandboxed and does not have a hardened runtime. For what it is worth, the app will run with hardened runtime, provided the option "Disable Executable Memory Protection" is checked. Furthermore, when it is also sandboxed and I open it with no extra copies of itself launched (the number to launch is a preferences option), that single app instance runs fine. I have instrumented the code, and what seems to be happening is that the system call to launch another app returns zero -- implying it succeeded -- but has no effect: It is as if someone had special-cased "system" to do nothing, but to report success nonetheless. That is an entirely reasonable feature of a hardened runtime -- allowing arbitrary system calls would be a security disaster looking for a place to happen. The point is that my app would not be making an arbitrary system call -- it would be trying to open one specific app -- itself -- which would be sandboxed with a hardened runtime, and notarized. That is not likely to be a huge security problem. Incidentally, not all system calls fail this way -- I can do system("osascript -e 'tell app \"Safari\" to activate';"); or system( "open -a \"Safari\" <path to a help file located in MyApp's Resources>"); with impunity. Also incidentally, using AppleScript to launch another copy of MyApp from within itself doesn't do what I want: The system notices that MyApp is already running and just makes it active instead of launching a new copy, and there is no way to pass in a command tail anyway. I don't wish to appear to be advertising, so I won't identify my app, but a little more detail might be useful: It is a parallel program interpreter. The language implemented is the "Scheme" dialect of Lisp. Each instance running is a complete read/eval/print loop embedded in an application window where the user can read and type. The first instance of the app launched mmaps a large memory area for the Lisp system's main memory: That works kind of like a big heap in more conventional programs. It is not executable code, it contains Lisp data structures that an application instance can access. The other instances launched use the same mmapped area. The shared memory has lots of lock bits. I use low-level "lockless coding" -- hand-coded assembler with the Intel "lock" prefix or the more complicated arm64 stuff -- to keep simultaneous access by different app instances from corrupting the shared memory. Parallel Scheme has many uses, which include debugging and monitoring of running Scheme programs, and having multiple tail-recursive "actors" (Lisp jargon) operate on the same data at the same time. Enough said. I would like to be able to notarize this app so that users who obtained it outside the app store could understand that Apple had checked it for dangerous code. If that were possible, I might even try submitting it to the app store -- but that would be another story. Do I have any hope of keeping this product available?
5
0
1.8k
Aug ’23
Apple cannot check signed bundle for malicious software
I have an App bundle that I signed with the certificate I received from my boss. despite signing and verifying it. it doesn't run on our test Mac without changing the trust settings. It gives an error saying that apple cannot check it for malicious software and software needs to be updated. this is the result of running the code sign verification: `codesign --display --requirements - --verbose=4 ./myapp.app Executable=/Users/*removed*/Documents/test/myapp.app/Contents/MacOS/app Identifier=com.*removed*.*removed*/ Format=app bundle with Mach-O thin (arm64) CodeDirectory v=20400 size=582872 flags=0x0(none) hashes=18208+3 location=embedded VersionPlatform=1 VersionMin=851968 VersionSDK=852736 Hash type=sha256 size=32 CandidateCDHash sha256=*removed* CandidateCDHashFull *removed* Hash choices=sha256 CMSDigest=*removed* CMSDigestType=2 Executable Segment base=0 Executable Segment limit=48218112 Executable Segment flags=0x1 Page size=4096 Launch Constraints: None CDHash=*removed* Signature size=9060 Authority=Developer ID Application: *removed* Authority=Developer ID Certification Authority Authority=Apple Root CA Timestamp=*Removed* Info.plist entries=15 TeamIdentifier=*Removed* Sealed Resources version=2 rules=13 files=475 designated => identifier "com.*removed*.*removed*" and anchor apple generic and certificate 1[*removed*] /* exists */ and certificate leaf[*removed*] /* exists */ and certificate leaf[subject.OU] = *removed*` I removed some info as I'm not sure if it'd be safe to share online. I apologize. The projector is written in c++ and uses wxWidgets for GUI
1
0
1k
Jul ’23
The staple and validate action failed! Error 73.
HiI have a flat pkg that I sucessfully notarised but when I come to staple the ticket I get the following error:"Although we wrote the ticket, the written data did not validate. Please restore thefile.pkg from backup to try again.The staple and validate action failed! Error 73."I did not touch the pkg in teh few minutes it took to receive the confirmaton email. The pkg itself looks notarised when I check it. Strange...
7
0
5.8k
Jul ’23
Stapling Error 65 (Applescript app)
Trying to notarize and AppleScript app following the instructions at Der Flounder (that are based on an Automator app).Code Signing works fineNotarization work fine.However when trying to stape the successful notarization the response to:xcrun stapler staple "/Volumes/HardDrive/MyApp.app"is:Processing: /Volumes/HardDrive/MyApp.app CloudKit query for MyApp.app (2/936578f9cf6dff6314bdebeba427cac9dab3f7e8) failed due to "record not found". Could not find base64 encoded ticket in response for 2/936578f9cf6dff6314bdebeba427cac9dab3f7e8 The staple and validate action failed! Error 65.
22
0
13k
Jul ’23
App cannot be opened because the developer cannot be verified.
Submit my app to Mac App Store. workflow: Sign with cert: Developer ID Application ---> Success Notarize ---> Success Sign with cert: 3rd Party Mac Developer Application ---> Success productbuild with cert: 3rd Party Mac Developer Installer, and get .pkg artifact---> Success Transporter upload ---> Success TestFlight notify, and app update to the latest version ---> Success Click open, and then the ERROR comes like the screenshot photo So I'm confusing which step's wrong. And I believe my account certificates, profiles are all configured with no problem. Anybody have any clues? I've been here for many days.
4
0
2.5k
Jul ’23
"Installer" would like to access files in your Downloads folder
Hi, I have a signed and notarized .pkg file. When I distribute this to my users, they're prompted if "Installer" can access files in the Downloads folder. Most of them click "OK", so that this installer can succeed, however those that click "Don't allow" can never install the .pkg file again. I've checked the following to no obvious resolution: Quarantine flags (no obvious flags were found) System Preferences, Security, Files and Folders (Installer.app is not listed) spctl --list (The .pkg shows there, but nothing obvious about it being blocked) A workaround is to copy this .pkg file to the Desktop folder. When run, the same prompt will appear again, except for the "Desktop" folder. If you click "OK", it succeeds. Since this behavior prevents the .pkg from running from Downloads ever again, how can this be reverted/fixed?
4
0
4k
Jul ’23
Not able to Read or Write to "/Contents/Resource" folder with Xcode 14.3.1
I have my macOS app, which I'm distributing outside the MAC App Store through Notarizing the App. When my end-user unzipped my App (which they downloaded from a shared URL path) and opened it, It crashed after the first time opening (by clicking on the Gatekeeper check popup: "Chrome downloaded this file today at 11:10 AM. Apple checked it for malicious software and none was detected. ") In my macOS app (distributing outside the MAC App Store through Notarizing the app), though I removed AppSandbox capability, I am still not able to read/write to the Resource folder. Error ESPlus-2023-06-28-173050_ips.txt Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “SupportTextFiles” in the folder “Resources”." UserInfo={NSFilePath=/x.app/Contents/Resources/SupportTextFiles, NSUnderlyingError=0x6000030e3c00 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
1
0
1.4k
Jun ’23
Auto Update for app outside AppStore. Quarantine and Ventura 13.1+
Hi, I distribute my app for macOS outside AppStore. I implemented Auto Update function which worked perfectly up to Ventura 13.0. And it was broken since Ventura 13.1+ The old version of my app downloads a ZIP arhive with a new version to temporary folder and unpack it to User's Library > Application Support > My AppFolder. The new unpacked version gets attribute com.apple.quarantine and the old app cannot run it. Before Ventura 13.1 the new unpacked app could be run successfully and it closes the old version and replaces the old APP bundle in Applications. And then a copy of new app in a temporary folder is being deleted. In fact, the new APP could work as an agent to perform the update of my app. Both apps (old and new) are signed and notarized by one team (the same signature).
3
0
1.5k
May ’23
getting - cannot be opened because the developer cannot be verified.
from some reason after some time my application dmg was signed and worked perfectly fine i started to get "cannot be opened because the developer cannot be verified." when clicking on the application after it was installed. when running the signing process i get Current status: Accepted...............Processing complete when checking the Submission ID received at apple it also showed approved what other issues might it be?
5
0
1.3k
May ’23
NSUpdateSecurityPolicy AllowProcesses where and how to add Items
Hi, in the video wwdc2022-10096 at about 05:45 it is explained how to allow other software to update your software by adding team-idetifiers an signing-identifiers to an Info.plist. I would need a few more details. Which Info.plist file do I have to change? I use pkgbuild to build the packages and productbuild to combine them. pkgbuild --analyse --root generates an .plist-file for every single package. Do I have to add the Information there? productbuild --sythesize generates an xml-file discribing the whole thing. This would refer better to the installer as a whole, but it is not an info.plist. How and where exactly to add the information? I tried to use plutil, but it doesn't like array-names to start with numbers as team-identifiers often do. Also it crashes quite often. The .plist-files generated by pkgbuild either contain an empty array or several unnamed items. [ ] Do I even need to add something threre? The other one contains several Items: [   0 => {     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Library/PreferencePanes/XXX.prefPane"   }   1 => {     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Library/Frameworks/XXX.framework"   }   2 => {     "BundleHasStrictIdentifier" => 1     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Applications/XXX.app"   } ] Should it look like this? A more detailed example would be great. Thanks!
2
0
2.5k
May ’23
Library validation failed: problems with dynamic library
I am developing a new pam module in Monterey [12.6], where I have a dynamic library [.so file] (usage external curl & openssl library) which is referenced from PAM. More specifically, this is a setup to allow Multi factor Authentication to be used for all authentication.it simply calls some apis. When I added this module for sudo authentication in /etc/pam.d/sudo file as auth sufficient /usr/local/lib/security/pam_google_authenticator.so It logs "Library Validation failed: Rejecting 'pam_google_authenticator.so' (Team ID: XXXXXXX, platform: no) for process 'sudo(2498)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not" but it still loads my pam module and everything is working fine. But when I added this module for lock screen into /etc/pam.d/screensaver same as above, it logs "Library Validation failed: Rejecting 'pam_google_authenticator.so' (Team ID: XXXXXXXX, platform: no) for process 'loginwindow(15839)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not" and took back to logon window[not sleep window] I have code signed pam_google_authenticator.so with codesign --force --deep --sign "Developer ID Application: --------------(XXXXXXX)" /usr/local/lib/securitypam_google_authenticator.so For your reference I can here are the logs in console app crash report System Integrity Protection: enabled Crashed Thread: 3 Dispatch queue: com.apple.loginwindow.auth Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [25964] I have found other references to this error but those seem to involve application bundles. In my case I have a single .so library (plus the two others) I wish to invoke. The library is from https://github.com/google/google-authenticator-libpam Again, this works fine in the three previous OS versions. What do I need to change to make it work here? Advice most appreciated, please. Thank you!
3
1
1.6k
May ’23
will safari support extension only from App Store in Mac OS
I have signed Safari app using product-> archive with automatic sign option using developer ID and notarised to distribute out side of App Store. Finally , I have observed that Safari is showing extension only in develop mode by selecting allowing unsigned apps option. why safari treating properly signed as unsigned ? Is my understanding correct?
0
0
846
May ’23
Gatekeeper and binaries rejected by spctl
I noticed jq (installed from Homebrew) has an ad hoc signature and is rejected by spctl but runs fine. I don't remember ever being prompted by my Mac as to whether this binary should be allowed to run. I repeated the experiment with another binary (aescrypt) downloaded from Homebrew. Should Gatekeeper prevent these binaries from executing until I intervene? Is there any online documentation explaining the conditions that allow some binaries that are rejected by spctl and have no signature chain rooted at Apple to execute? (Or am I just not understanding how to use Gatekeeper and spctl?) codesign analysis: % codesign -vvd /opt/homebrew/bin/aescrypt Executable=/opt/homebrew/Cellar/aescrypt/0.7/bin/aescrypt Identifier=aescrypt Format=Mach-O thin (arm64) CodeDirectory v=20400 size=545 flags=0x20002(adhoc,linker-signed) hashes=14+0 location=embedded Signature=adhoc Info.plist=not bound TeamIdentifier=not set Sealed Resources=none Internal requirements=none And checking spctl analysis: % spctl --assess -vvv /opt/homebrew/bin/aescrypt /opt/homebrew/bin/aescrypt: rejected
2
0
1.4k
May ’23
stapling DMG fails with error 68: Certificate authority pinning mismatch.
We have a DMG for our Mac desktop app that has notarized OK, but on stapling we get the error below. The DMG and its contained app are signed (prior to Catalina this was sufficient.) The .app folder is directly constructed in our build process (not using XCode or similar); the .dmg is by DMGCanvas. The app only contains the UI; the libs and command-line tools are in a sibling folder, laid out much as they are on our other *nix builds. (When installed, everything is placed in a dedicated folder inside /Applications to keep it all in one place.)Searching for the error "Certificate authority pinning mismatch" almost entirely links to cssmapple.h, which implies not many other people have run into this?OS: 10.15.1Xcode: 11.1xcrun: 48Notarization:Request Identifier: 71c0468a-2a58-46ae-b699-22462e8593b0Stapling:Properties are { NSURLIsDirectoryKey = 0; NSURLIsPackageKey = 0; NSURLIsSymbolicLinkKey = 0; NSURLLocalizedTypeDescriptionKey = "Disk Image"; NSURLTypeIdentifierKey = "com.apple.disk-image-udif"; "_NSURLIsApplicationKey" = 0; } Codesign offset 0xcee4caf length: 9556 Stored Codesign length: 9556 number of blobs: 3 Total Length: 9556 Found blobs: 3 Props are { cdhash = {length = 20, bytes = 0xfb512617c5c078595f7a2ab6f74c73d7fa00a73c}; digestAlgorithm = 2; flags = 0; secureTimestamp = "2019-09-12 15:10:53 +0000"; signingId = "FICO Xpress 8.7.0 for Mac Installer"; teamId = KL84GEX7ZW; } JSON Data is { records = ( { recordName = "2/2/fb512617c5c078595f7a2ab6f74c73d7fa00a73c"; } ); } Headers: { "Content-Type" = "application/json"; } Domain is api.apple-cloudkit.com Certificate trust evaluation did not return expected result. (5) [leaf AnchorApple ChainLength IntermediateMarkerOid] Certificate trust evaluation for api.apple-cloudkit.com did not return expected result. Certificate authority pinning mismatch. Certificate trust evaluation did not return expected result. (5) [leaf AnchorApple ChainLength IntermediateMarkerOid] Certificate trust evaluation for api.apple-cloudkit.com did not return expected result. Certificate authority pinning mismatch. Could not establish secure connection to api.apple-cloudkit.com Response is (null) error is Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup} Size of data is 0 CloudKit's response is inconsistent with expections: (null) The staple and validate action failed! Error 68.
9
0
6.6k
May ’23
JPackage signing leaves app unusable since updating to Ventura
I had a process for generating an app using JPackage that was working well in Catalina. The signing process worked and generated apps that could be downloaded from my website and run without problems. When my users had Ventura they could install from the dmg, but running the app gave "can't be opened because Apple cannot check it for malicious software". This is the error I used to get on Catalina before signing. I updated my development computer to Ventura in the hopes that building using that OS version would clean up the problem, but no such luck. The app runs without problems when I run it from the build location. I just get the above error when the dmg is downloaded from the internet. The setting to allow applications from trusted developers is correct on my system. I'm using: Java 17 (though Java 20 does behaves the same) Xcode 14.3 is installed (jpackage uses it under the hood) My signing certificate shows as "this certificate is valid" in the system keychain using "codesign -vvv --deep --strict" on the dmg and app claims "satisfies its Designated Requirement" (though I don't know what that means and there's no other information given) Attempting to run codesign to sign the app tells me "already signed" The code I have is pure Java, but does use JavaFX There are no warnings or errors from jpackage when building I would really appreciate suggestions on why the signing doesn't appear to be working any longer. Thank you!
3
0
1.8k
Apr ’23
Is it possible to code sign a screensaver?
I'd like to share a screensaver I developed (for OSX) but I couldn't find a way to code-sign it. Without it, it is almost impossible to install on other machines due to 'Gatekeepr' warnings. (right click & `open` works, but most people don't know about it.)Any ideas on code-signing or distribution alternatives? I'm simply sending the .saver bundle at the moment
6
0
3.9k
Apr ’23
Successfully Notarized in xCode, but rejected using spctl command-line
Hi, I've succesfully notarzied an OSX app using xcode (see attached image). But when running " %spctl -a -vvv -t install Meetverse_UTFSM_MAC_v091.app" I get Meetverse_UTFSM_MAC_v091.app: rejected source=Unnotarized Developer ID %codesign -v --verbose Meetverse_UTFSM_MAC_v091.app shows : Meetverse_UTFSM_MAC_v091.app: valid on disk Meetverse_UTFSM_MAC_v091.app: satisfies its Designated Requirement When I try to open the app in other computers Gatekeeper shows "Can't be opened , Apple cannot check for malicious software" I've tried exporting several times the notarized app, with different builds. Any help would be appreciated, thank you.
2
0
1.1k
Apr ’23
Are cloud-managed certificates usable from the command line?
Hello, I am trying to distribute a macOS app directly to consumers. Recently I came across this article titled 'Cloud-managed certificates', which details that Apple will sign apps by authorizing you via you Developer program membership, but would like to see if this is usable from the command line or thirdparty tools. To confirm that this article does what it says, I created a new generic SwiftUI app on a new Mac that does not have any existing "Developer ID Application" certificates in keychain. In the signing tab, it shows With this, when I 'archive', the Xcode Organizer appears. If I click distribute, then 'Developer ID', 'Upload', 'Automatically manage signing', it correctly displays "Certificate: Cloud Managed Developer ID Application" and then gives me the option to notarize it. Now, this was all done via the Xcode Organizer via an Xcode-managed app. I was wondering if it would be possible to use this cloud-managed signing service from the CLI, so that I can integrate it with existing tooling and CI/CD pipelines.
1
1
1.9k
Apr ’23
Library validation failed: problems with dynamic library
I have a setup (working in 10.1[345]) which now fails in Big Sur, where I have a dynamic library (which calls another external library which in turn calls another) which is referenced from PAM. More specifically, this is a setup to allow PIV smartcards to be used for "sudo" authentication. Thus, I have a line in /etc/pam.d/sudo which calls /usr/local/libexec/pam_ssh_agent_auth.so. This library calls a perl script which does a network LDAP lookup for the current user. I have code-signed the pam_ssh_agent_auth library as well as the non-system library it references (as seen by "otool -L") and the non-system library that the intermediate one calls. These are all located in /usr/local/libexec as well. When I run a sudo command now, e.g., "sudo date", the command simply hangs. The error I see in Console is: Library Validation failed: Rejecting '/usr/local/libexec/pam_ssh_agent_auth.so' (Team ID: 82A95CK2HC, platform: no) for process 'sudo(16107)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not. I have found other references to this error but those seem to involve application bundles. In my case I have a single .so library (plus the two others) I wish to invoke. The library is from https://github.com/jbeverly/pam_ssh_agent_auth/releases Again, this works fine in the three previous OS versions. What do I need to change to make it work here? Advice most appreciated, please. Thank you!
4
0
2.5k
Mar ’23
source=Unnotarized Developer ID when making pkg file for Electron app
Hi, I created an app in Electron and I'm using electron forge to make the app and pkg file. Each time I make the project the .app and .pkg files are created with no errors. When I run the "spctl -a -vvv -t install" command on the .app file, it says that the app is accepted. However, when I run the command on the .pkg file it says that it is rejected with "source=Unnotarized Developer ID" and the "origin=Develop ID Installer: " is the valid certificate that I created. Is someone able to help me troubleshoot this issue?
1
0
1.5k
Mar ’23
Parallel processing app distributed by developer won't run sandboxed
I have a macOS app that I have been distributing for free outside the app store for more than 15 years, without notarization, without sandboxing, and without hardened runtime, all with no problems. If I understand correctly, macOS will soon be modified so that it will not launch any developer-distributed apps that are not notarized. Notarization will require both hardened runtime and sandboxing, and unhappily, my app will not run when notarized -- I have added sandboxing and hardened runtime, than gotten it notarized and tried -- and that is because it will not run when sandboxed. Thus I have two questions: Will there be some means, that I perhaps have missed, for my users to run my app as is, in un-notarized form with no sandboxing and no hardened runtime? (Assume that they are willing to click "Okay" on any macOS popups of the form "Abandon hope, all ye who enter here.") Perhaps I have missed something about the signing or distribution process ... ? If not, is there some entitlement I can obtain to allow my app to run when sandboxed? Perhaps the question is even "Should there be such an entitlement?" And to that end, I must now explain why it cannot run sandboxed: My app is a parallel processing system: To work properly it must open multiple copies of itself -- that's right, there will be multiple instances of the app window visible on the console, distinguished by tint, title and location so the user can tell which is which, and multiple app badges in the dock, similarly distinguished. Doing so is easy -- I use the c++ "system" function to call the Unix executable that is buried within the ".app" folder, passing it a command tail whereby the launched copy can tell how to distinguish itself. I build up the text string for the call piece by piece, but the result looks rather like this: system("<path-to-my-app>/MyApp.app/Contents/MacOS/MyApp -tail-item-1 -tail-item-2 ... &"); The app is written in mixed C++ and Objective C. The usual "Main.mm" file contains the entry point for the program, a "main()" function that does nothing but call "NSApplicationMain()", but I have added code to "main()" that runs before the call of NSApplicationMain(). That code uses C function "getopt()" to look for the extra command-tail items. If any are present, the app acts appropriately -- generally assigning non-default values to global variables that are used later in initialization. The first instance of the app that is called -- presumably by the user mousing on an icon somewhere -- knows by the absence of extra command-tail items that it is the first one launched, and thus knows to launch multiple additional instances of itself using this mechanism. The launched instances know by the presence of extra command-tail items that they are not the first one launched, and act differently, based on the command-tail items themselves. All this has been working fine for over a decade when the app is not sandboxed and does not have a hardened runtime. For what it is worth, the app will run with hardened runtime, provided the option "Disable Executable Memory Protection" is checked. Furthermore, when it is also sandboxed and I open it with no extra copies of itself launched (the number to launch is a preferences option), that single app instance runs fine. I have instrumented the code, and what seems to be happening is that the system call to launch another app returns zero -- implying it succeeded -- but has no effect: It is as if someone had special-cased "system" to do nothing, but to report success nonetheless. That is an entirely reasonable feature of a hardened runtime -- allowing arbitrary system calls would be a security disaster looking for a place to happen. The point is that my app would not be making an arbitrary system call -- it would be trying to open one specific app -- itself -- which would be sandboxed with a hardened runtime, and notarized. That is not likely to be a huge security problem. Incidentally, not all system calls fail this way -- I can do system("osascript -e 'tell app \"Safari\" to activate';"); or system( "open -a \"Safari\" <path to a help file located in MyApp's Resources>"); with impunity. Also incidentally, using AppleScript to launch another copy of MyApp from within itself doesn't do what I want: The system notices that MyApp is already running and just makes it active instead of launching a new copy, and there is no way to pass in a command tail anyway. I don't wish to appear to be advertising, so I won't identify my app, but a little more detail might be useful: It is a parallel program interpreter. The language implemented is the "Scheme" dialect of Lisp. Each instance running is a complete read/eval/print loop embedded in an application window where the user can read and type. The first instance of the app launched mmaps a large memory area for the Lisp system's main memory: That works kind of like a big heap in more conventional programs. It is not executable code, it contains Lisp data structures that an application instance can access. The other instances launched use the same mmapped area. The shared memory has lots of lock bits. I use low-level "lockless coding" -- hand-coded assembler with the Intel "lock" prefix or the more complicated arm64 stuff -- to keep simultaneous access by different app instances from corrupting the shared memory. Parallel Scheme has many uses, which include debugging and monitoring of running Scheme programs, and having multiple tail-recursive "actors" (Lisp jargon) operate on the same data at the same time. Enough said. I would like to be able to notarize this app so that users who obtained it outside the app store could understand that Apple had checked it for dangerous code. If that were possible, I might even try submitting it to the app store -- but that would be another story. Do I have any hope of keeping this product available?
Replies
5
Boosts
0
Views
1.8k
Activity
Aug ’23
Apple cannot check signed bundle for malicious software
I have an App bundle that I signed with the certificate I received from my boss. despite signing and verifying it. it doesn't run on our test Mac without changing the trust settings. It gives an error saying that apple cannot check it for malicious software and software needs to be updated. this is the result of running the code sign verification: `codesign --display --requirements - --verbose=4 ./myapp.app Executable=/Users/*removed*/Documents/test/myapp.app/Contents/MacOS/app Identifier=com.*removed*.*removed*/ Format=app bundle with Mach-O thin (arm64) CodeDirectory v=20400 size=582872 flags=0x0(none) hashes=18208+3 location=embedded VersionPlatform=1 VersionMin=851968 VersionSDK=852736 Hash type=sha256 size=32 CandidateCDHash sha256=*removed* CandidateCDHashFull *removed* Hash choices=sha256 CMSDigest=*removed* CMSDigestType=2 Executable Segment base=0 Executable Segment limit=48218112 Executable Segment flags=0x1 Page size=4096 Launch Constraints: None CDHash=*removed* Signature size=9060 Authority=Developer ID Application: *removed* Authority=Developer ID Certification Authority Authority=Apple Root CA Timestamp=*Removed* Info.plist entries=15 TeamIdentifier=*Removed* Sealed Resources version=2 rules=13 files=475 designated => identifier "com.*removed*.*removed*" and anchor apple generic and certificate 1[*removed*] /* exists */ and certificate leaf[*removed*] /* exists */ and certificate leaf[subject.OU] = *removed*` I removed some info as I'm not sure if it'd be safe to share online. I apologize. The projector is written in c++ and uses wxWidgets for GUI
Replies
1
Boosts
0
Views
1k
Activity
Jul ’23
The staple and validate action failed! Error 73.
HiI have a flat pkg that I sucessfully notarised but when I come to staple the ticket I get the following error:"Although we wrote the ticket, the written data did not validate. Please restore thefile.pkg from backup to try again.The staple and validate action failed! Error 73."I did not touch the pkg in teh few minutes it took to receive the confirmaton email. The pkg itself looks notarised when I check it. Strange...
Replies
7
Boosts
0
Views
5.8k
Activity
Jul ’23
Stapling Error 65 (Applescript app)
Trying to notarize and AppleScript app following the instructions at Der Flounder (that are based on an Automator app).Code Signing works fineNotarization work fine.However when trying to stape the successful notarization the response to:xcrun stapler staple "/Volumes/HardDrive/MyApp.app"is:Processing: /Volumes/HardDrive/MyApp.app CloudKit query for MyApp.app (2/936578f9cf6dff6314bdebeba427cac9dab3f7e8) failed due to "record not found". Could not find base64 encoded ticket in response for 2/936578f9cf6dff6314bdebeba427cac9dab3f7e8 The staple and validate action failed! Error 65.
Replies
22
Boosts
0
Views
13k
Activity
Jul ’23
App cannot be opened because the developer cannot be verified.
Submit my app to Mac App Store. workflow: Sign with cert: Developer ID Application ---> Success Notarize ---> Success Sign with cert: 3rd Party Mac Developer Application ---> Success productbuild with cert: 3rd Party Mac Developer Installer, and get .pkg artifact---> Success Transporter upload ---> Success TestFlight notify, and app update to the latest version ---> Success Click open, and then the ERROR comes like the screenshot photo So I'm confusing which step's wrong. And I believe my account certificates, profiles are all configured with no problem. Anybody have any clues? I've been here for many days.
Replies
4
Boosts
0
Views
2.5k
Activity
Jul ’23
"Installer" would like to access files in your Downloads folder
Hi, I have a signed and notarized .pkg file. When I distribute this to my users, they're prompted if "Installer" can access files in the Downloads folder. Most of them click "OK", so that this installer can succeed, however those that click "Don't allow" can never install the .pkg file again. I've checked the following to no obvious resolution: Quarantine flags (no obvious flags were found) System Preferences, Security, Files and Folders (Installer.app is not listed) spctl --list (The .pkg shows there, but nothing obvious about it being blocked) A workaround is to copy this .pkg file to the Desktop folder. When run, the same prompt will appear again, except for the "Desktop" folder. If you click "OK", it succeeds. Since this behavior prevents the .pkg from running from Downloads ever again, how can this be reverted/fixed?
Replies
4
Boosts
0
Views
4k
Activity
Jul ’23
Not able to Read or Write to "/Contents/Resource" folder with Xcode 14.3.1
I have my macOS app, which I'm distributing outside the MAC App Store through Notarizing the App. When my end-user unzipped my App (which they downloaded from a shared URL path) and opened it, It crashed after the first time opening (by clicking on the Gatekeeper check popup: "Chrome downloaded this file today at 11:10 AM. Apple checked it for malicious software and none was detected. ") In my macOS app (distributing outside the MAC App Store through Notarizing the app), though I removed AppSandbox capability, I am still not able to read/write to the Resource folder. Error ESPlus-2023-06-28-173050_ips.txt Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “SupportTextFiles” in the folder “Resources”." UserInfo={NSFilePath=/x.app/Contents/Resources/SupportTextFiles, NSUnderlyingError=0x6000030e3c00 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Replies
1
Boosts
0
Views
1.4k
Activity
Jun ’23
Auto Update for app outside AppStore. Quarantine and Ventura 13.1+
Hi, I distribute my app for macOS outside AppStore. I implemented Auto Update function which worked perfectly up to Ventura 13.0. And it was broken since Ventura 13.1+ The old version of my app downloads a ZIP arhive with a new version to temporary folder and unpack it to User's Library > Application Support > My AppFolder. The new unpacked version gets attribute com.apple.quarantine and the old app cannot run it. Before Ventura 13.1 the new unpacked app could be run successfully and it closes the old version and replaces the old APP bundle in Applications. And then a copy of new app in a temporary folder is being deleted. In fact, the new APP could work as an agent to perform the update of my app. Both apps (old and new) are signed and notarized by one team (the same signature).
Replies
3
Boosts
0
Views
1.5k
Activity
May ’23
getting - cannot be opened because the developer cannot be verified.
from some reason after some time my application dmg was signed and worked perfectly fine i started to get "cannot be opened because the developer cannot be verified." when clicking on the application after it was installed. when running the signing process i get Current status: Accepted...............Processing complete when checking the Submission ID received at apple it also showed approved what other issues might it be?
Replies
5
Boosts
0
Views
1.3k
Activity
May ’23
NSUpdateSecurityPolicy AllowProcesses where and how to add Items
Hi, in the video wwdc2022-10096 at about 05:45 it is explained how to allow other software to update your software by adding team-idetifiers an signing-identifiers to an Info.plist. I would need a few more details. Which Info.plist file do I have to change? I use pkgbuild to build the packages and productbuild to combine them. pkgbuild --analyse --root generates an .plist-file for every single package. Do I have to add the Information there? productbuild --sythesize generates an xml-file discribing the whole thing. This would refer better to the installer as a whole, but it is not an info.plist. How and where exactly to add the information? I tried to use plutil, but it doesn't like array-names to start with numbers as team-identifiers often do. Also it crashes quite often. The .plist-files generated by pkgbuild either contain an empty array or several unnamed items. [ ] Do I even need to add something threre? The other one contains several Items: [   0 => {     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Library/PreferencePanes/XXX.prefPane"   }   1 => {     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Library/Frameworks/XXX.framework"   }   2 => {     "BundleHasStrictIdentifier" => 1     "BundleIsRelocatable" => 0     "BundleIsVersionChecked" => 1     "BundleOverwriteAction" => "upgrade"     "NSUpdateSecurityPolicy" => {       "AllowProcesses" => {         "123ABC" => [           0 => "com.example.pal.about"         ]       }     }     "RootRelativeBundlePath" => "Applications/XXX.app"   } ] Should it look like this? A more detailed example would be great. Thanks!
Replies
2
Boosts
0
Views
2.5k
Activity
May ’23
Library validation failed: problems with dynamic library
I am developing a new pam module in Monterey [12.6], where I have a dynamic library [.so file] (usage external curl & openssl library) which is referenced from PAM. More specifically, this is a setup to allow Multi factor Authentication to be used for all authentication.it simply calls some apis. When I added this module for sudo authentication in /etc/pam.d/sudo file as auth sufficient /usr/local/lib/security/pam_google_authenticator.so It logs "Library Validation failed: Rejecting 'pam_google_authenticator.so' (Team ID: XXXXXXX, platform: no) for process 'sudo(2498)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not" but it still loads my pam module and everything is working fine. But when I added this module for lock screen into /etc/pam.d/screensaver same as above, it logs "Library Validation failed: Rejecting 'pam_google_authenticator.so' (Team ID: XXXXXXXX, platform: no) for process 'loginwindow(15839)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not" and took back to logon window[not sleep window] I have code signed pam_google_authenticator.so with codesign --force --deep --sign "Developer ID Application: --------------(XXXXXXX)" /usr/local/lib/securitypam_google_authenticator.so For your reference I can here are the logs in console app crash report System Integrity Protection: enabled Crashed Thread: 3 Dispatch queue: com.apple.loginwindow.auth Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [25964] I have found other references to this error but those seem to involve application bundles. In my case I have a single .so library (plus the two others) I wish to invoke. The library is from https://github.com/google/google-authenticator-libpam Again, this works fine in the three previous OS versions. What do I need to change to make it work here? Advice most appreciated, please. Thank you!
Replies
3
Boosts
1
Views
1.6k
Activity
May ’23
will safari support extension only from App Store in Mac OS
I have signed Safari app using product-> archive with automatic sign option using developer ID and notarised to distribute out side of App Store. Finally , I have observed that Safari is showing extension only in develop mode by selecting allowing unsigned apps option. why safari treating properly signed as unsigned ? Is my understanding correct?
Replies
0
Boosts
0
Views
846
Activity
May ’23
Gatekeeper and binaries rejected by spctl
I noticed jq (installed from Homebrew) has an ad hoc signature and is rejected by spctl but runs fine. I don't remember ever being prompted by my Mac as to whether this binary should be allowed to run. I repeated the experiment with another binary (aescrypt) downloaded from Homebrew. Should Gatekeeper prevent these binaries from executing until I intervene? Is there any online documentation explaining the conditions that allow some binaries that are rejected by spctl and have no signature chain rooted at Apple to execute? (Or am I just not understanding how to use Gatekeeper and spctl?) codesign analysis: % codesign -vvd /opt/homebrew/bin/aescrypt Executable=/opt/homebrew/Cellar/aescrypt/0.7/bin/aescrypt Identifier=aescrypt Format=Mach-O thin (arm64) CodeDirectory v=20400 size=545 flags=0x20002(adhoc,linker-signed) hashes=14+0 location=embedded Signature=adhoc Info.plist=not bound TeamIdentifier=not set Sealed Resources=none Internal requirements=none And checking spctl analysis: % spctl --assess -vvv /opt/homebrew/bin/aescrypt /opt/homebrew/bin/aescrypt: rejected
Replies
2
Boosts
0
Views
1.4k
Activity
May ’23
stapling DMG fails with error 68: Certificate authority pinning mismatch.
We have a DMG for our Mac desktop app that has notarized OK, but on stapling we get the error below. The DMG and its contained app are signed (prior to Catalina this was sufficient.) The .app folder is directly constructed in our build process (not using XCode or similar); the .dmg is by DMGCanvas. The app only contains the UI; the libs and command-line tools are in a sibling folder, laid out much as they are on our other *nix builds. (When installed, everything is placed in a dedicated folder inside /Applications to keep it all in one place.)Searching for the error "Certificate authority pinning mismatch" almost entirely links to cssmapple.h, which implies not many other people have run into this?OS: 10.15.1Xcode: 11.1xcrun: 48Notarization:Request Identifier: 71c0468a-2a58-46ae-b699-22462e8593b0Stapling:Properties are { NSURLIsDirectoryKey = 0; NSURLIsPackageKey = 0; NSURLIsSymbolicLinkKey = 0; NSURLLocalizedTypeDescriptionKey = "Disk Image"; NSURLTypeIdentifierKey = "com.apple.disk-image-udif"; "_NSURLIsApplicationKey" = 0; } Codesign offset 0xcee4caf length: 9556 Stored Codesign length: 9556 number of blobs: 3 Total Length: 9556 Found blobs: 3 Props are { cdhash = {length = 20, bytes = 0xfb512617c5c078595f7a2ab6f74c73d7fa00a73c}; digestAlgorithm = 2; flags = 0; secureTimestamp = "2019-09-12 15:10:53 +0000"; signingId = "FICO Xpress 8.7.0 for Mac Installer"; teamId = KL84GEX7ZW; } JSON Data is { records = ( { recordName = "2/2/fb512617c5c078595f7a2ab6f74c73d7fa00a73c"; } ); } Headers: { "Content-Type" = "application/json"; } Domain is api.apple-cloudkit.com Certificate trust evaluation did not return expected result. (5) [leaf AnchorApple ChainLength IntermediateMarkerOid] Certificate trust evaluation for api.apple-cloudkit.com did not return expected result. Certificate authority pinning mismatch. Certificate trust evaluation did not return expected result. (5) [leaf AnchorApple ChainLength IntermediateMarkerOid] Certificate trust evaluation for api.apple-cloudkit.com did not return expected result. Certificate authority pinning mismatch. Could not establish secure connection to api.apple-cloudkit.com Response is (null) error is Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://api.apple-cloudkit.com/database/1/com.apple.gk.ticket-delivery/production/public/records/lookup} Size of data is 0 CloudKit's response is inconsistent with expections: (null) The staple and validate action failed! Error 68.
Replies
9
Boosts
0
Views
6.6k
Activity
May ’23
JPackage signing leaves app unusable since updating to Ventura
I had a process for generating an app using JPackage that was working well in Catalina. The signing process worked and generated apps that could be downloaded from my website and run without problems. When my users had Ventura they could install from the dmg, but running the app gave "can't be opened because Apple cannot check it for malicious software". This is the error I used to get on Catalina before signing. I updated my development computer to Ventura in the hopes that building using that OS version would clean up the problem, but no such luck. The app runs without problems when I run it from the build location. I just get the above error when the dmg is downloaded from the internet. The setting to allow applications from trusted developers is correct on my system. I'm using: Java 17 (though Java 20 does behaves the same) Xcode 14.3 is installed (jpackage uses it under the hood) My signing certificate shows as "this certificate is valid" in the system keychain using "codesign -vvv --deep --strict" on the dmg and app claims "satisfies its Designated Requirement" (though I don't know what that means and there's no other information given) Attempting to run codesign to sign the app tells me "already signed" The code I have is pure Java, but does use JavaFX There are no warnings or errors from jpackage when building I would really appreciate suggestions on why the signing doesn't appear to be working any longer. Thank you!
Replies
3
Boosts
0
Views
1.8k
Activity
Apr ’23
Is it possible to code sign a screensaver?
I'd like to share a screensaver I developed (for OSX) but I couldn't find a way to code-sign it. Without it, it is almost impossible to install on other machines due to 'Gatekeepr' warnings. (right click & `open` works, but most people don't know about it.)Any ideas on code-signing or distribution alternatives? I'm simply sending the .saver bundle at the moment
Replies
6
Boosts
0
Views
3.9k
Activity
Apr ’23
Successfully Notarized in xCode, but rejected using spctl command-line
Hi, I've succesfully notarzied an OSX app using xcode (see attached image). But when running " %spctl -a -vvv -t install Meetverse_UTFSM_MAC_v091.app" I get Meetverse_UTFSM_MAC_v091.app: rejected source=Unnotarized Developer ID %codesign -v --verbose Meetverse_UTFSM_MAC_v091.app shows : Meetverse_UTFSM_MAC_v091.app: valid on disk Meetverse_UTFSM_MAC_v091.app: satisfies its Designated Requirement When I try to open the app in other computers Gatekeeper shows "Can't be opened , Apple cannot check for malicious software" I've tried exporting several times the notarized app, with different builds. Any help would be appreciated, thank you.
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’23
Are cloud-managed certificates usable from the command line?
Hello, I am trying to distribute a macOS app directly to consumers. Recently I came across this article titled 'Cloud-managed certificates', which details that Apple will sign apps by authorizing you via you Developer program membership, but would like to see if this is usable from the command line or thirdparty tools. To confirm that this article does what it says, I created a new generic SwiftUI app on a new Mac that does not have any existing "Developer ID Application" certificates in keychain. In the signing tab, it shows With this, when I 'archive', the Xcode Organizer appears. If I click distribute, then 'Developer ID', 'Upload', 'Automatically manage signing', it correctly displays "Certificate: Cloud Managed Developer ID Application" and then gives me the option to notarize it. Now, this was all done via the Xcode Organizer via an Xcode-managed app. I was wondering if it would be possible to use this cloud-managed signing service from the CLI, so that I can integrate it with existing tooling and CI/CD pipelines.
Replies
1
Boosts
1
Views
1.9k
Activity
Apr ’23
Library validation failed: problems with dynamic library
I have a setup (working in 10.1[345]) which now fails in Big Sur, where I have a dynamic library (which calls another external library which in turn calls another) which is referenced from PAM. More specifically, this is a setup to allow PIV smartcards to be used for "sudo" authentication. Thus, I have a line in /etc/pam.d/sudo which calls /usr/local/libexec/pam_ssh_agent_auth.so. This library calls a perl script which does a network LDAP lookup for the current user. I have code-signed the pam_ssh_agent_auth library as well as the non-system library it references (as seen by "otool -L") and the non-system library that the intermediate one calls. These are all located in /usr/local/libexec as well. When I run a sudo command now, e.g., "sudo date", the command simply hangs. The error I see in Console is: Library Validation failed: Rejecting '/usr/local/libexec/pam_ssh_agent_auth.so' (Team ID: 82A95CK2HC, platform: no) for process 'sudo(16107)' (Team ID: none, platform: yes), reason: mapping process is a platform binary, but mapped file is not. I have found other references to this error but those seem to involve application bundles. In my case I have a single .so library (plus the two others) I wish to invoke. The library is from https://github.com/jbeverly/pam_ssh_agent_auth/releases Again, this works fine in the three previous OS versions. What do I need to change to make it work here? Advice most appreciated, please. Thank you!
Replies
4
Boosts
0
Views
2.5k
Activity
Mar ’23
source=Unnotarized Developer ID when making pkg file for Electron app
Hi, I created an app in Electron and I'm using electron forge to make the app and pkg file. Each time I make the project the .app and .pkg files are created with no errors. When I run the "spctl -a -vvv -t install" command on the .app file, it says that the app is accepted. However, when I run the command on the .pkg file it says that it is rejected with "source=Unnotarized Developer ID" and the "origin=Develop ID Installer: " is the valid certificate that I created. Is someone able to help me troubleshoot this issue?
Replies
1
Boosts
0
Views
1.5k
Activity
Mar ’23