
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
dyno-driver
Advanced tools
Dyno Driver is MongoDB inspired abstraction for AWS DynamoDB. It obfuscates the archaic
// entity.ts
import { DynoEntity, DynoProp } from 'dyno-driver';
@DynoEntity({
tableName: 'docs',
index: [
{ pk: 'repo#repoId', sk: 'doc#docId' },
{ pk: 'doc#docId', sk: 'REPO#', },
{ pk: 'alias', sk: 'ALIAS#' },
{ pk: 'repo#repoId', sk: 'total' }
]
})
export class DocEntity {
@DynoProp({})
repoId: string;
@DynoProp({})
docId: string;
@DynoProp({})
isBig: boolean;
@DynoProp({})
alias: string;
@DynoProp({})
ages: number[];
@DynoProp({})
names: string[];
@DynoProp({})
list: any[];
@DynoProp({})
colors: Set<string>;
@DynoProp({})
deleteOn?: number;
@DynoProp({})
meta: object;
@DynoProp({})
meta2: Record<string, number>;
@DynoProp({})
body: Buffer;
}
import { DynoDriver } from 'dyno-driver';
// Instantiate the Driver
export const dyno = new DynoDriver({
tableName: 'test-table',
endpoint: "http://localhost:8000",
region: "local",
metrics: true,
entities: [DocEntity],
});
// Instantiate the docs model
export const docsModel = dyno.entity(DocEntity);
docs-service.ts
import { docsModel } from './dyno';
// Get a document using a full table scan
const doc = await docsModel.getOne({
order: 'asc',
});
// Get a document using table scan
const doc = await docsModel.getOne({
where: {
repoId: '1234abcd',
},
consistent: true,
order: 'asc',
});
// Get a document by pk + sk
const doc = await docsModel.getOne({
where: {
repoId: '1234abcd',
id: '1234abcd'
},
consistent: true,
});
// Get a document by pk + sk query
const doc = await docsModel.getOne({
where: {
repoId: '1234abcd',
id: { $gt: '1234' }
},
consistent: true,
order: 'asc',
});
// QUERY FIRST/LAST DOC WITH FILTER
const doc = await docsModel.getOne({
where: {
repoId: '1234abcd',
id: { $gt: '1234' },
status: 'active',
encoding: 'json'
},
consistent: true,
order: 'asc',
});
// GET FIRST/LAST DOC IN TABLE SCAN
const doc = await docsModel.getOne({
consistent: true,
order: 'asc',
});
https://www.totaltypescript.com/tsconfig-cheat-sheet
const tables = await docsModel.toCdkTables();
[
{
"table": {
"tableName": "dyno-test",
"removalPolicy": "destroy",
"billingMode": "PAY_PER_REQUEST",
"partitionKey": {
"name": "pk",
"type": "S"
},
"sortKey": {
"name": "sk",
"type": "S"
},
"timeToLiveAttribute": "ttl"
},
"indices": [
{
"indexName": "dyno-test-gsi-1",
"partitionKey": {
"name": "pk1",
"type": "S"
},
"sortKey": {
"name": "sk1",
"type": "S"
},
"projectionType": "ALL"
}
]
}
]
Use the getDbTables method to fetch ALL the table schemas from a live DynamoDB instance. These can then be compared with
const tables = await docsModel.getDbTables();
{
"delta-sync-main-table": {
"AttributeDefinitions": [
{
"AttributeName": "pk",
"AttributeType": "S"
},
{
"AttributeName": "sk",
"AttributeType": "S"
},
{
"AttributeName": "gpk",
"AttributeType": "S"
},
{
"AttributeName": "gsk",
"AttributeType": "S"
}
],
"BillingModeSummary": {
"BillingMode": "PAY_PER_REQUEST",
"LastUpdateToPayPerRequestDateTime": 2024-02-18T04: 50: 23.648Z
},
"CreationDateTime": 2024-02-18T04: 50: 23.648Z,
"GlobalSecondaryIndexes": [
{
"IndexArn": "arn:aws:dynamodb:ddblocal:000000000000:table/delta-sync-main-table/index/gsi",
"IndexName": "gsi",
"IndexSizeBytes": 15726656,
"IndexStatus": "ACTIVE",
"ItemCount": 9708,
"KeySchema": [
{
"AttributeName": "gpk",
"KeyType": "HASH"
},
{
"AttributeName": "gsk",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "ALL"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 0,
"WriteCapacityUnits": 0
}
}
],
"ItemCount": 9756,
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "sk",
"KeyType": "RANGE"
}
],
"ProvisionedThroughput": {
"LastDecreaseDateTime": 1970-01-01T00: 00: 00.000Z,
"LastIncreaseDateTime": 1970-01-01T00: 00: 00.000Z,
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 0,
"WriteCapacityUnits": 0
},
"TableArn": "arn:aws:dynamodb:ddblocal:000000000000:table/delta-sync-main-table",
"TableName": "delta-sync-main-table",
"TableSizeBytes": 15737213,
"TableStatus": "ACTIVE"
}
}
Four sections of the table schema are relevant for migrations:
const COMPARE_TABLE_PROPS = [
'AttributeDefinitions',
'GlobalSecondaryIndexes',
'KeySchema',
'TableName'
];
const schema = await docsModel.toModelSchemas();
{
"tableName": "test-table",
"billingMode": "PAY_PER_REQUEST",
"removalPolicy": "destroy",
"tableKeys": [
[
{
"name": "id",
"alias": "pk",
"type": "string",
"token": "S",
"prefix": "DOC#",
"isRequired": true,
"isKey": true,
"index": 0
},
{
"name": "repoId",
"alias": "sk",
"type": "string",
"token": "S",
"prefix": "REP#",
"isRequired": true,
"isKey": true,
"index": 0
}
],
[
{
"name": "repoId",
"alias": "pk1",
"prefix": "REP#",
"type": "string",
"token": "S",
"isRequired": false,
"isKey": true,
"index": 1
},
{
"name": "version",
"alias": "sk1",
"type": "string",
"token": "S",
"prefix": "VER#",
"isRequired": false,
"isKey": true,
"index": 1
}
]
]
}
FAQs
DynamoDb Node Driver
The npm package dyno-driver receives a total of 0 weekly downloads. As such, dyno-driver popularity was classified as not popular.
We found that dyno-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.