Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
aws-dynamodb-parser
Readme
AWS DynamoDB utility for parsing DynamoDB responses
pip install aws-dynamodb-parser
parse
is the main method exposed for parsing DynamoDB responses when using boto3
.
The parse
function can handle all of the data types AWS DynamoDB supports as of October 2020.
Assuming we have a table TABLE_NAME
containing the following entries, with id
set as the partition key and timestamp
as the sort key.
All three fields included are strings.
id | timestamp | name |
---|---|---|
a77b5fc0-75cb-408c-bebf-863873506cce | 2020-10-01 13:13:47.388492 | First test entry |
a77b5fc0-75cb-408c-bebf-863873506cce | 2020-10-01 13:15:25.376589 | Second test entry |
fa853ff0-706e-45db-b6ae-aa6a8a1f7856 | 2020-10-01 13:16:47.720778 | Third test entry |
Parsing the result from a get_item
request:
import boto3
from aws_dynamodb_parser import parse
dynamodb_client = boto3.client("dynamodb")
response = dynamodb_client.get_item(
TableName="TABLE_NAME",
Key={
"id": {"S": "a77b5fc0-75cb-408c-bebf-863873506cce"},
"timestamp": {"S": "2020-10-01 13:13:47.388492"}
}
)
item = response.get("Item", {})
print(item)
# {'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:13:47.388492'}, 'name': {'S': 'First test entry'}}
entry = parse(item)
print(entry)
# {'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:13:47.388492', 'name': 'First test entry'}
Parsing the result from a query
request:
import boto3
from aws_dynamodb_parser import parse
dynamodb_client = boto3.client("dynamodb")
response = dynamodb_client.query(
TableName="TABLE_NAME",
KeyConditionExpression="#id = :id",
ExpressionAttributeNames={
"#id": "id"
},
ExpressionAttributeValues={
":id": {"S": "a77b5fc0-75cb-408c-bebf-863873506cce"}
}
)
items = response.get("Items", [])
print(items)
# [{'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:13:47.388492'}, 'name': {'S': 'First test entry'}}, {'id': {'S': 'a77b5fc0-75cb-408c-bebf-863873506cce'}, 'timestamp': {'S': '2020-10-01 13:15:25.376589'}, 'name': {'S': 'Second test entry'}}]
entries = parse(items)
print(entries)
# [{'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:13:47.388492, 'name': 'First test entry'}, {'id': 'a77b5fc0-75cb-408c-bebf-863873506cce', 'timestamp': '2020-10-01 13:15:25.376589', 'name': 'Second test entry'}]
Users can get the docstring help by running:
from aws_dynamodb_parser import parse
help(parse)
FAQs
AWS DynamoDB utility for parsing DynamoDB responses
We found that aws-dynamodb-parser demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.