Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
sops-secretsmanager-cdk
Advanced tools
Safely load secrets from sops into secretsmanager using the CDK
Safely load secrets from sops into secretsmanager using the CDK
import { SopsSecretsManager } from 'sops-secretsmanager-cdk';
...
const ssm = new SopsSecretsManager(this, 'StoreSecrets', {
path: './path/to/secretsfile.yaml',
kmsKey: myKey, // or use kms.Key.fromKeyArn, or omit and use the key in the sops file
secretName: 'TestSecret', // or secret: mySecret
mappings: {
nameInSecretsManager: {
path: ['path', 'to', 'value', 'in', 'secretsfile'],
// optionally pass encoding: 'json' to pass a portion of the secrets file
},
anotherThingInSecretsManager: {
path: ['other', 'path'],
},
// etc
},
});
if(ssm.secret) {
// secret is a Secret you can tag, for example
}
SopsSecretsManager
secret
and secretName
- must set exactly one of these
secret
, must be secretsManager.Secret | secretsManager.ISecret
secretName
, must be a string
asset
and path
- must set exactly one of these
asset
, must be a s3Assets.Asset
path
, must be a string
kmsKey
- optional
kms.IKey
mappings
, wholeFile
and singleValueMapping
- must set mappings
or singleValueMapping
or set wholeFile
to true
mappings
, must be a SopsSecretsManagerMappings
singleValueMapping
, must be a SopsSecretsManagerMapping
wholeFile
is true
fileType
- optional
'yaml'
or 'json'
if setwholeFile
is true, then defaults to 'json'
The mappings
property, if given, specifies how to make values from
the structured sops data (json or yaml) to keys in secrets manager.
It takes an object, where:
path
, required, an array of strings, pointing to a value in the structured sops dataencoding
, optional, 'string'
or 'json'
, control how to alter the value found from sops for storage in Secrets ManagerCDK v2:
import { SopsSecretsManager } from 'sops-secretsmanager-cdk';
// or
import { SopsSecretsManager } from 'sops-secretsmanager-cdk/cdkv2';
CDK v1:
import { SopsSecretsManager } from 'sops-secretsmanager-cdk/cdkv1';
Using the CDK's custom resource mini-framework, the sops secrets file is uploaded to S3 as an asset as is, still encoded. The custom resource Lambda then decodes the secrets (in memory, never on disk) and puts them into the SecretsManager secret.
Run the following to deploy a test stack named
SopsExampleStack
. Note that if a stack with this name exists, it
will be deleted:
$ npm run deploy-example
This compiles and uses the code from your working directory, finds an existing customer-managed KMS key, deploys a stack that uses an sample secret, and verifies that the created secret contains the expected data.
npm version (patch|minor|major)
as appropriategit push
and git push origin TAG
where TAG
is the tag that npm version
just createdThe tag triggers a Github Actions job to publish to npm.
14 November 2023
#115
#113
#114
#112
#110
#109
#111
#108
FAQs
Safely load secrets from sops into secretsmanager using the CDK
The npm package sops-secretsmanager-cdk receives a total of 474 weekly downloads. As such, sops-secretsmanager-cdk popularity was classified as not popular.
We found that sops-secretsmanager-cdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.