I am developing a macOS application (targeting macOS 13 and later) that is non-sandboxed and needs to install and trust a root certificate by adding it to the System keychain programmatically.
I’m fine with prompting the user for admin privileges or password, if needed.
So far, I have attempted to execute the following command programmatically from both:
A user-level process
A root-level process
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /path/to/cert.pem
While the certificate does get installed, it does not appear as trusted in the Keychain Access app.
One more point:
The app is not distributed via MDM.
App will be distributed out side the app store.
Questions:
What is the correct way to programmatically install and trust a root certificate in the System keychain?
Does this require additional entitlements, signing, or profile configurations?
Is it possible outside of MDM management?
Any guidance or working samples would be greatly appreciated.
General
RSS for tagPrioritize user privacy and data security in your app. Discuss best practices for data handling, user consent, and security measures to protect user information.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm developing an Authorization Plug-In and have stumbled upon a concerning behavior regarding credential caching that may have security implications.
Consider this scenario: I'm working on a Mac without admin privileges, and I need to temporarily disable the Firewall for some testing. An administrator physically comes to my machine, inputs their credentials to disable the Firewall, and then leaves.
What follows is that, for a short period after this action, the administrator's credentials remain cached in Authorization Services. During this window, I can perform some additional privileged operations without any re-authentication. For example, I can open Activity Monitor and send SIGKILL signals to arbitrary privileged processes (!!).
From what I could gather, this happens because system.preferences.network shares cached credentials with other authorization rights. Even more concerning, even when I explicitly modify the authorization database to prevent credential sharing for this specific right, the behavior persists!
I suspect the issue relates to the underlying shared authentication rules (such as authenticate-admin-30, which com.apple.activitymonitor.kill uses), but I've been unable to modify these rules to test this theory.
From my understanding, the most concerning aspect is that even if all system Authorization Rights were configured to not share credentials, third-party applications could still create proprietary rights that might end up sharing credentials anyway.
From my Auth Plug-In, I've tried unsetting the kAuthorizationEnvironmentShared context value (even though the documentation in AuthorizationTags.h tells me that the value is ignored), and looking for ways to override the timeout for shared credentials, both without success.
Finally, I'm looking to answer some questions that have been raised:
I understand that this credential sharing is a feature, but isn't the behavior I described actually a security vulnerability? I worry that other (potentially more dangerous) operations may be able to exploit this.
Is there a recommended way to prevent privileged credentials from being reused across arbitrary authorization rights if the original process does not destroy the auth reference?
Are there any options from within an Authorization Plug-In to ensure more strict authentication boundaries?
What exactly is the authorization "session" mentioned in /System/Library/Security/authorization.plist? Does this concept imply that System Settings.app and Activity Monitor.app share the same session in my previous example?
This post ended up being quite long, but unfortunately, documentation on the subject seems incredibly scarce. For reference, the little information I could find came from:
QA 1277
The Credentials Cache and the Authentication Dialog
Comments on /System/Library/Security/authorization.plist
In some crashlog files, there are additional pieces of information related to codesigning.
I can understand what most of themcorresponds to (ID, TeamID, Flags, Validation Category). But there is one I have some doubt about: Trust Level.
As far as I can tell (or at least what Google and other search engines say), this is an unsigned 32 bit integer that defines the trust level with -1 being untrusted, 0, being basically an Apple executable and other potential bigger values corresponding to App Store binaries, Developer ID signature, etc.
Yet, I'm not able to find a corresponding detailed documentation about this on Apple's developer website.
I also had a look at the LightweightCodeRequirements "include" file and there does not seem to be such a field available.
[Q] Is there any official documentation listing the different values for this trust level value and providing a clear description of what it corresponds to?
I am new to swift development, and it's possible that I'm missing something fundamental/obvious. If so, I apologize in advance. My team is developing an application for iPadOS using SwiftUI, and I'm trying to accomplish something similar to what the original inquirer is asking for in this thread: https://developer.apple.com/forums/thread/725152. The only difference is that I'm trying to use a PIV smart card to achieve authentication to a server rather than digitally sign a document.
Unfortunately, I'm getting stuck when attempting to run the list() function provided in the accepted answer to the post mentioned above. When attempting to call SecItemCopyMatching(), I'm getting a -34018 missing entitlement error. I've attempted to add the com.apple.token to my app's keychain-access-groups entitlements, but this does not resolve the issue. I have checked the entitlements in my built app, per the recommendation in the troubleshooting guide here: https://developer.apple.com/forums/thread/114456. The entitlement for com.apple.token is indeed present in the plist. Based on other documentation I've read, however, it seems that the explicit declaration of com.apple.token should not even be required in the entitlements.
Is there something obvious that I'm missing here that would prevent my app from accessing the token access group?
Has anyone here encountered this? It's driving me crazy.
It appears on launch.
App Sandbox is enabled.
The proper entitlement is selected (com.apple.security.files.user-selected.read-write)
I believe this is causing an issue with app functionality for users on different machines.
There is zero documentation across the internet on this problem.
I am on macOS 26 beta. This error appears in both Xcode and Xcode-beta.
Please help!
Thank you,
Logan
WebAuthn Level 3 § 5.1.3 Step 22 Item 4 states the steps a user agent MUST follow when "conditional" mediation is used in conjunction with required user verification:
Let userVerification be the effective user verification requirement for credential creation, a Boolean value, as follows. If pkOptions.authenticatorSelection.userVerification
is set to required
If options.mediation is set to conditional and user verification cannot be collected during the ceremony, throw a ConstraintError DOMException.
Let userVerification be true.
On my iPhone 15 Pro Max running iOS 18.5, Safari + Passwords does not exhibit this behavior; instead an error is not reported and user verification is not performed (i.e., the UV bit is 0). Per the spec this results in a registration ceremony failure on the server which is made all the more "annoying" since the credential was created in Passwords forcing a user to then delete the credential. :
If the Relying Party requires user verification for this registration, verify that the UV bit of the flags in authData is set.
In contrast when I use Google Password Manager + Chrome on a Samsung Galaxy S24 running Android 15, user verification is enforced and the UV bit is 1.
Either the UV bit should be 1 after enforcing user verification or an error should be thrown since user verification cannot be performed.
WebAuthn Level 3 § 6.3.2 Step 2 states the authenticator must :
Check if at least one of the specified combinations of PublicKeyCredentialType and cryptographic parameters in credTypesAndPubKeyAlgs is supported. If not, return an error code equivalent to "NotSupportedError" and terminate the operation.
On my iPhone 15 Pro Max running iOS 18.5, Safari + Passwords does not exhibit this behavior; instead an error is not reported and an ES256 credential is created when an RP passes a non-empty sequence that does not contain {"type":"public-key","alg":-7} (e.g., [{"type":"public-key","alg":-8}]).
When I use Chromium 138.0.7204.92 on my laptop running Arch Linux in conjunction with the Passwords app (connected via the "hybrid" protocol), a credential is not created and instead an error is reported per the spec.
I’d like to confirm something regarding the hosting of the apple-app-site-association (AASA) file.
We have a server that publicly hosts the AASA file and is accessible globally. However, this server sits behind an additional security layer (a security server/reverse proxy).
My question is:
Will this security layer affect Apple’s ability to access and validate the AASA file for Universal Links or App Clips?
Are there specific requirements (e.g. headers, redirects, TLS versions, etc.) that we need to ensure the security server does not block or modify?
Any guidance or best practices would be appreciated.
Thanks!
Hi,
I’d like to confirm something regarding the hosting of the apple-app-site-association (AASA) file.
We have a server that publicly hosts the AASA file and is accessible globally. However, this server sits behind an additional security layer (a security server/reverse proxy).
My question is:
Will this security layer affect Apple’s ability to access and validate the AASA file for Universal Links or App Clips?
Are there specific requirements (e.g. headers, redirects, TLS versions, etc.) that we need to ensure the security server does not block or modify?
Any guidance or best practices would be appreciated.
When presenting a cookie banner for GDPR purposes, should ATT precede the cookie banner?
It seems that showing a Cookie Banner and then showing the ATT permission prompt afterwards (if a user elects to allow cookies/tracking) would be more appropriate.
Related question: Should the “Allow Tracking” toggle for an app in system settings serve as a master switch for any granular tracking that might be managed by a 3rd party Consent Management Platform?
If ATT is intended to serve as a master switch for tracking consent, if the ATT prompt is presented before a cookie banner, should the banner even appear if a user declines tracking consent?
I’m not finding any good resources that describe this flow in detail and I’m seeing implementations all over the place on this.
Help!
Thanks!!!
General:
Forums topic: Privacy & Security
Privacy Resources
Security Resources
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Topic:
Privacy & Security
SubTopic:
General
General:
Forums topic: Privacy & Security
Forums tag: Privacy
Developer > Security — This also covers privacy topics.
App privacy details on the App Store
UIKit > Protecting the User’s Privacy documentation
Bundle Resources > Privacy manifest files documentation
TN3181 Debugging an invalid privacy manifest technote
TN3182 Adding privacy tracking keys to your privacy manifest technote
TN3183 Adding required reason API entries to your privacy manifest technote
TN3184 Adding data collection details to your privacy manifest technote
TN3179 Understanding local network privacy technote
Handling ITMS-91061: Missing privacy manifest forums post
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
We are experiencing a significant issue with macOS security alerts that began on July 9th, at approximately 4:40 AM UTC. This alert is incorrectly identifying output files from our snippet tests as malware, causing these files to be blocked and moved to the Trash. This is completely disrupting our automated testing workflows.
Issue Description:
Alert: We are seeing the "Malware Blocked and Moved to Trash" popup window.
Affected Files: The security alert triggers when attempting to execute .par files generated as outputs from our snippet tests. These .par files are unique to each individual test run; they are not a single, static tool.
System-Wide Impact: This issue is impacting multiple macOS hosts across our testing infrastructure.
Timeline: The issue began abruptly on July 9th, at approximately 4:40 AM UTC. Before that time, our tests were functioning correctly.
macOS Versions: The problem is occurring on hosts running both macOS 14.x and 15.x.
Experimental Host: Even after upgrading an experimental host to macOS 15.6 beta 2, the issue persisted.
Local execution: The issue can be reproduced locally.
Observations:
The security system is consistently flagging these snippet test output files as malware.
Since each test generates a new .par file, and this issue is impacting all generated files, the root cause doesn't appear to be specific to the code within the .par files themselves.
This issue is impacting all the snippet tests, making us believe that the root cause is not related to our code.
The sudden and widespread nature of the issue strongly suggests a change in a security database or rule, rather than a change in our testing code.
Questions:
Could a recent update to the XProtect database be the cause of this false positive?
Are there any known issues or recent changes in macOS security mechanisms that could cause this kind of widespread and sudden impact?
What is the recommended way to diagnose and resolve this kind of false positive?
We appreciate any guidance or assistance you can provide. Thank you.
we develop extension "Autofill Credential Provider" function for passkey.
1.first step registe passkey
2.second step authenticate with passkey
step 1 & step 2 has finished and run success with provideCredentialWithoutUserInteraction.
But we want to prepare our interface for use to input password and select passkey what the want. however the func prepareInterfaceToProvideCredential in ASCredentialProviderViewController does call? what i missed? how can i do it?
While I was submitting a new feedback today for an iPhone/iPad storage issue, I saw a new log called “iOS storage log”.
I could find no reference to this when I searched online. It made me wonder if it was new and if it contained personal data?
Most of us only have one device, with all our personal data. Therefore, I’d appreciate any input on what personal data these logs contain.
Recently, we received an user enquiry regarding the inability to perform bookings for the app.
After investigation, we found that the issue appears to be caused by the failure of the Apple DeviceCheck service.
Based on our checks, approximately 0.01% of requests fail each day (e.g., on 26 June: 6 failures out of 44,544 requests) when using Apple DeviceCheck.
Could you please assist in raising the following enquiries with Apple Support?
What is the typical failure rate of Apple DeviceCheck? Are there any reliability metrics or benchmarks for its performance?
How can the failures be prevented, or is there a recommended retry mechanism to handle such failures?
Does the iOS version affect the performance or reliability of Apple DeviceCheck? Are there known issues or limitations with specific iOS versions?
How long does the token remain valid, and when should a new one be retrieved?
Does using a jailbroken device affect the functionality of Apple DeviceCheck?
this is my monitor image that shows DeviceCheck api responding very slowly.
I have a custom NSWindow that I want to exclude from screen capture by setting its sharing state to kCGWindowSharingStateSharingNone. The goal is to prevent this window from appearing in the content captured by ScreenCaptureKit.
[window setSharingType:NSWindowSharingType::NSWindowSharingNone];
However, on macOS 15.4+ (Sequoia), the window is still captured by ScreenCaptureKit and appears in the shared content.
Does anyone know if kCGWindowSharingStateSharingNone is still effective with ScreenCaptureKit on macOS 15.4 and later?
I want iOS device identifier for a framework that is used in multiple vendor's apps.
I'm developing a framework to control a peripheral. The framework has to send unique information to register the device with the peripheral.
My naive idea was to use IdentifierForVendor. But this API provides the device identifier for the same vendor's apps, not the framework. (The framework will be used by multiple vendors.)
Is there a usable device identifier for the framework, regardless of app vendor?
Please tell me any solution.
After registe Passkey with webauthn library, i create a passkeyRegistration with follow,
let passkeyRegistration = ASPasskeyRegistrationCredential(relyingParty: serviceIdentifier, clientDataHash: clientDataHashSign, credentialID: credentialId, attestationObject: attestationObject)
and then completeRegistrationRequest like that,
extensionContext.completeRegistrationRequest(using: passkeyRegistration)
But a bad outcome occurred from user agent. NotAllowedError:The request is not allowed by the user agent or the platform in the current context.
And the return data rawID & credentialPublicKey is empty,
Topic:
Privacy & Security
SubTopic:
General
Tags:
Autofill
Authentication Services
Passkeys in iCloud Keychain