Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
add-trusted-cert
Advanced tools
An API for calling the security add-trusted-cert
command in macOS to add certificates to the system keychain.
For more information, see man security
and search for the add-trusted-cert
command.
import { addTrustedCert, POLICY_CONSTRAINTS, RESULT_TYPES } from 'add-trusted-cert'
(async () => {
// Add a cert trusted for SSL
await addTrustedCert({
resultType: RESULT_TYPES.TRUST_ROOT,
policyConstraint: POLICY_CONSTRAINTS.SSL,
// You might need this
sudo: true
}, 'server.pem.crt')
})()
Promise.<string>
Add certificate (in DER or PEM format) from certFile to per-user or local Admin Trust Settings. When modifying per-user Trust Settings, user authentication is required via an authentication dialog. When modifying admin Trust Settings, the process must be running as root, or admin authentication is required.
Returns: Promise.<string>
- Output of the security add-trusted-cert
command
See: man security add-trusted-cert
Param | Type | Description |
---|---|---|
options | object | |
[options.addToAdminCertStore] | boolean | If true, adds the cert to the admin cert store |
[options.resultType] | string | |
[options.policyConstraint] | Array.<string> | string | Policy constraints |
[options.appPath] | string | Application constraint |
[options.policyString] | string | Policy-specific string |
[options.allowedError] | Array.<(string|number)> | number | string | |
[options.keyUsageCode] | number | Key usage. For more than one usage, add values together (except -1). |
[options.keychain] | string | Keychain to which the cert is added. Default is '/Library/Keychains/System.keychain'. |
[options.settingsFileIn] | string | Input trust settings file; default is user domain |
[options.settingsFileOut] | string | Output trust settings file; default is user domain |
[options.sudo] | boolean | If true, use sudo to execute the command. |
certFile | string | Certificate file to add |
[execaOpts] | object | Options to supply to the execa call |
FAQs
Add trusted certificates to the macOS keychain via an API
The npm package add-trusted-cert receives a total of 9 weekly downloads. As such, add-trusted-cert popularity was classified as not popular.
We found that add-trusted-cert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.