Crates.io | med_cli |
lib.rs | med_cli |
version | 0.6.4 |
source | src |
created_at | 2023-05-28 01:51:12.66466 |
updated_at | 2023-07-08 02:30:14.381716 |
description | A Rust Powered CLI tool for CSV/JSON Masking, Encryption, and Decryption. |
homepage | https://github.com/jayhuang75/rust-cli-med |
repository | https://github.com/jayhuang75/rust-cli-med |
max_upload_size | |
id | 876216 |
size | 72,254 |
This is a personal hobby project; based on the observation, sometimes we need a simple enough CLI tool with auditable capability for Data Masking/Encyption/Decryption for CSV/JSON files.
The binary name for M.E.D. is med, it depends on the med_core.
Archives of precompiled binaries for med are available for Windows, macOS and Linux. Users of platforms not explicitly mentioned below are advised to download one of these archives.
dnf install med
$ med --help
A simple to use, enterprise ready, rust powered data masking/encryption/decription cli tool
Usage: med <MODE> --file <FILE> [OPTIONS]
Arguments:
<MODE>
What mode to run the program in
Possible values:
- mask: Mask the data by *
- encrypt: Encrypt the data with provided KEY
- decrypt: Decrypt the data with provided KEY
Options:
-t, --type <TYPE> type of file we will process, available option [csv, json] [default: csv]
-k, --key <KEY> key for Encrypt and Decrypt the file.
-s, --standard <STANDARD> set the Encrypt and Decrypt standard
Possible values:
- des64: DES standard 64
- aes128: AES standard 128
- aes192: AES standard 192
- aes256: AES standard 256
-f, --file <FILE> file path for the
-c, --config <CONFIG> Sets a custom config yml path [default: conf.yaml]
-o, --output <OUTPUT> Sets a file/directory path for output [default: output]
-d, --debug <DEBUG> Sets debug flag [possible values: true, false]
-w, --worker <WORKER> Sets work flag
-h, --help Print help (see a summary with '-h')
-V, --version Print version
The configuration file can be any given name of yaml file.
// example of the conf.yaml
mask_symbols: "#####" # mask symbols
fields: # list of the cols/fields you want to mask
- name
- email
- phone
// mask the csv files in folders
med mask -f demo/data/csv -c demo/conf/conf_csv.yaml -w 3
// mask the json files in folders
med mask -t json -f demo/data/json -c demo/conf/conf_json.yaml -w 3
// encrypt the csv files
med encrypt -f demo/data/csv -c demo/conf/conf_csv.yaml -w 4 -k YOUR_SECRET -s des64
// decrypt the json files
med decrypt -t json -f output/demo/data/json -c demo/conf/conf_json.yaml -w 5 -k YOUR_SECRET -s des64
M.E.D. uses SQLite for the audit capture, mainly ensuring following the Entreprise level Audit base standard, capture, Who, When, Where(which machine), do what, and status, etc.
The metadata and migration are available here.
The audit db location will be different depending on your OS.
Platform | Value | Example |
---|---|---|
Linux | $HOME/.config/med | /home/bob/.config/med |
MacOS | $HOME/Library/Application Support/med | /Users/Bob/Library/Application Support/med |
Windows | {FOLDERID_RoamingAppData}/med | C:\Users\Bob\AppData\Roaming\med |
We prepare the database migration capabilites and this migrations folder NEED to be in the same directoy of your binary.