Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
github.com/gulien/aws-s3-csv-parser
A simple CLI which downloads a CSV file from S3 and inserts its data into a MySQL database.
Usage of aws-s3-csv-parser:
--bucket string Set the AWS S3 bucket
--key string Set the AWS S3 object key to download
--region string Set the AWS region
--skip-download Skip download if true (i.e, file has already been downloaded)
--timeout int Set the maximum duration in seconds before timing out (default 300)
The CSV file will, at least in the near future, always:
,
as separatorThe steps could be summarized to:
Most of the core logic can be found in the pkg
folder, while the main
file glues everything together.
In other words, one could move from a command to any other trigger (REST API, lambda, consumer) without having to change
the core logic.
Also, both the file storage (i.e, S3) and data source (i.e, MySQL) could be changed in the future by implementing the
filestorage.Downloader
and datastorage.Inserter
interfaces.
If the process fails for whatever reasons, one may relaunch the process from the start. Indeed, current implementation
ignores the MySQL Error 1062: Duplicate entry
error.
As we may not want to rely on manual intervention to trigger the process, we can imagine two different solutions.
The first one relies on AWS lambdas:
Everytime a new object (i.e., CSV file) is put into the S3 bucket, an event triggers a lambda which handles the process. This solution is cost-effective, but we might encounter some limitations in the future (e.g, reaching the lambda execution time limit if the CSV file is too big).
To work around those limitations, the second solution relies on a messages' queue + consumer:
📣 We could also switch from a MySQL database (i.e., AWS RDS) to DynamoDB serverless for saving even more money, but I do believe that SQL > No-SQL for data analysis.
Requirements
Makefile commands
make up
- Starts the MySQL database and phpMyAdmin Docker containersmake down
- Stops the MySQL database and phpMyAdmin Docker containersmake fmt
- Shortcut for go fmt
and go mod tidy
make lint
- Runs lintersmake todos
- Shows TODOsmake godoc
- Runs a local webserver for godocmake run
- Runs the application (REGION
, BUCKET
, KEY
, TIMEOUT
and SKIP_DOWNLOAD
are available as variables, i.e, make run BUCKET=foo
)make build
- Builds the application (VERSION
is available as variable, i.e, make build VERSION=foo
)FAQs
Unknown package
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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.