Scan your whole stack
From OX Research Newsroom
Are you using aws-secrets-manager-core?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.2
aws-secrets-manager-core was last scanned on 30 Nov 2026 at version 1.0.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.2 LATEST | 30 Nov 2026 | No rules fired |
| 1.0.1 | 30 Nov 2026 | No rules fired |
| 1.0.0 | 30 Nov 2026 | No rules fired |
| 0.0.0-stage | 30 Nov 2026 | Not shown |
Findings for v1.0.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.0.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
aws-secrets-manager-core loads an AWS Secrets Manager secret into a Node process: a test runner, a
setup file or a script. It is the engine of
cypress-aws-secrets-manager,
mocha-aws-secrets-manager and
playwright-aws-secrets-manager, and it
ships their login scripts.
| You use | Install | What you get |
|---|---|---|
| Cypress | cypress-aws-secrets-manager |
The secret in config.env, and the updateSecret task. |
| Mocha | mocha-aws-secrets-manager |
One line in .mocharc.js loads the secret before any test file. |
| Playwright | playwright-aws-secrets-manager |
One import in playwright.config loads the secret, and a secrets fixture. |
| Another runner, a script or a tool | aws-secrets-manager-core |
The functions of this README. |
Each wrapper installs the core for you. Install the core yourself only to use it directly.
aws sso login --profile my-sso-profile. The AWS
CLI keeps the session on your machine, and every process uses it.process.env. No file holds it, unless you ask for a
local copy. The logs print the key names, never a value.npm install --save-dev aws-secrets-manager-core
You need:
aws configure sso of the
AWS CLI v2 creates,
or one of the other login strategies.1. Describe the secret. Create aws-secrets.config.js at the root of your project:
// aws-secrets.config.js
module.exports = {
secretName: 'my-team/e2e', // the name or the full ARN
region: 'eu-west-1',
profile: 'my-sso-profile'
}
2. Load it before the code that reads it. The synchronous form waits for the secret, so the next line can read it:
// load-secrets.js: require it before everything else
const core = require('aws-secrets-manager-core')
const reply = core.loadSync({ baseDir: __dirname })
if (!reply.reused) core.publishToEnv(reply.secrets, { source: reply.options })
The asynchronous form fits a global setup, or any async function:
// global-setup.js
const core = require('aws-secrets-manager-core')
module.exports = async () => {
const options = await core.resolveOptions({ baseDir: __dirname })
const secrets = await core.loadSecrets(options)
core.publishToEnv(secrets, { source: options })
}
In a package with "type": "module", a .js file is an ES module, which has no require and no
module.exports. There, name these files load-secrets.cjs and global-setup.cjs.
3. Log in, then run.
aws sso login --profile my-sso-profile
node --require ./load-secrets.js my-script.js
process.env.MY_KEY now holds the value of the key MY_KEY. A child process inherits the values,
and loadSync in it reuses them: it makes no second AWS call.
| Option | Required | Default | Meaning |
|---|---|---|---|
secretName |
Yes | The secret name, or its full ARN. | |
region |
Yes | The AWS region of the secret. | |
strategy |
No | multi |
How to get AWS credentials. See Login strategies. |
profile |
No | The AWS SSO profile of the profile strategy. |
|
pathToCredentials |
No | The file of the credentials strategy. See Credentials file. |
|
kmsKeyId |
No | The KMS key that updateSecret sends with the new value. Needed for a secret of another AWS account. |
|
localDir |
No | The folder of the local copy. See Local copy. | |
baseDir |
No | process.cwd() |
The folder that relative paths start from, and where the search for the configuration file starts. |
silent |
No | false |
Hides the progress lines. The status line, the warnings and the errors still print. |
logger |
No | stderr | An object with info, warn and error, and optionally log. Without it, every line goes to stderr, so stdout carries only the output of your program, such as a JSON report. |
override and allowUnsafeKeys are options of publishToEnv. The
Mocha and Playwright wrappers read them from the same configuration file.
resolveOptions and loadSync read three sources. A later source wins over an earlier one:
aws-secrets.config.js, aws-secrets.config.cjs,
aws-secrets.config.mjs and aws-secrets.config.json, in this order. It looks in baseDir, then
in each parent folder up to the root of the repository, the folder with .git. Outside a
repository, it stops at the nearest folder with package.json, else it reads baseDir only, so a
file above your project never runs. The nearest folder wins.loadSync({ baseDir: __dirname, silent: true }).| Variable | Option |
|---|---|
AWS_SECRETS_NAME |
secretName |
AWS_SECRETS_REGION |
region |
AWS_SECRETS_PROFILE |
profile |
AWS_SSO_STRATEGY |
strategy |
AWS_SECRETS_LOCAL_DIR |
localDir |
ENV_LOG_MODE=silent |
silent: true |
About the configuration file:
.js, .cjs or .mjs file exports the options, or a function, sync or async, that returns them.
A .js file in a package with "type": "module" can use export default.localDir or pathToCredentials starts from the folder of the file.secretName or region, or an unknown strategy, stops with an error that names the key
and where to set it. A blank string counts as missing."silent" must be true or false, not a string. The paths, names and strategy take a string, silent and override take true or
false, and allowUnsafeKeys takes a list of names."secretName" is missing. Set it in one of: aws-secrets.config.js, aws-secrets.config.cjs, aws-secrets.config.mjs, aws-secrets.config.json in the base folder or a parent folder; the options passed to loadSecrets(); the environment variable AWS_SECRETS_NAME.
loadSecrets and updateSecret take the options as you give them: they read no file and no variable.
Call resolveOptions first, as the quick start does.
| Strategy | Where the credentials come from |
|---|---|
profile |
The AWS SSO profile in profile. |
default |
The AWS SSO profile named default. |
unset |
The default credential chain of the AWS SDK: the profile in AWS_PROFILE when it is set, else the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN variables, then the shared AWS files, then a container or instance role. It reads every profile type. Use it on CI. |
credentials |
The file in pathToCredentials. |
multi (default) |
Tries profile, default, unset, then credentials, and stops at the first that works. When all fail, the error gives the reason of each one. |
profile and default read AWS SSO profiles only. For a profile with keys, a role or a
credential_process, use unset and set AWS_PROFILE to the profile name.multi moves on after any error, also when the login works and the secret does not exist. A later
attempt can then read the secret with other credentials. When no attempt gets the secret and a login
worked, the error says so: it names the strategy, the secret, the region and the AWS error, such as
ResourceNotFoundException.unset, AWS_PROFILE wins over the key variables: the AWS SDK for JavaScript skips the keys
when a profile is set.The credentials strategy reads a JSON or JavaScript file:
{
"accessKeyId": "AKIA...",
"secretAccessKey": "...",
"sessionToken": "..."
}
sessionToken is needed for temporary credentials only. A long-term IAM user key has none..js or .cjs file exports the object with module.exports, an .mjs file with
export default. A path without extension finds what require() finds: a .js or .json file,
or the index of a folder..mjs
file: then node --check <file> shows it.The core never logs you in. It uses the login that the AWS CLI keeps.
aws configure sso # one time: creates the profile
aws sso login --profile my-sso-profile # once a day
The AWS CLI keeps the login in ~/.aws/sso/cache, so one aws sso login serves every process on the
machine: Cypress, Mocha, Playwright, your scripts and the AWS CLI.
aws sso login --profile my-sso-profile. The SSO login script below runs it for you, and only
when the session has ended.The core ships two pairs of bash scripts. Each pair logs you in to AWS only when needed, then runs your command:
| Method | Your settings file | The login script that it runs |
|---|---|---|
| AWS SSO | sh/sso/aws_authenticate.sh |
sh/sso/aws_sso.sh: checks your SSO session, and logs you in when it has ended. |
| Assume role | sh/assume_role/aws_authenticate.sh |
sh/assume_role/aws_assume_role.sh: assumes the role of the environment, and logs you in when needed. |
1. Copy the settings file into your project once, then fill it in and commit it:
cp node_modules/aws-secrets-manager-core/sh/sso/aws_authenticate.sh .
AWS_PROFILE_<ENV> and ACCOUNT_ID_<ENV> for each environment: TEST, STAGE,
PROD and LOCAL, or your own names.ROLE_NAME, AWS_USER_ID_FILE_NAME, and USER_IDENTIFIER_PREFIX
or USER_IDENTIFIER_SUFFIX.2. Start your command through it, for example in package.json:
{
"scripts": {
"test:e2e": "bash aws_authenticate.sh test \"npx playwright test\""
}
} Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.