https://github.com/percona-lab/sanitizer
POC for a log sanitizer for pt-stalk, pt-mysql-summary, pt-summary
https://github.com/percona-lab/sanitizer
Last synced: 11 months ago
JSON representation
POC for a log sanitizer for pt-stalk, pt-mysql-summary, pt-summary
- Host: GitHub
- URL: https://github.com/percona-lab/sanitizer
- Owner: Percona-Lab
- Created: 2018-03-05T11:58:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T16:31:32.000Z (almost 8 years ago)
- Last Synced: 2025-02-06T16:59:08.462Z (about 1 year ago)
- Language: Go
- Size: 69.3 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pt-secure-data
Collect, sanitize, pack and encrypt data. By default, this program will collect the output of:
- `pt-stalk --no-stalk --iterations=2 --sleep=30 --host=$mysql-host --dest=$temp-dir --port=$mysql-port --user=$mysql-user --password=$mysql-pass`
- `pt-summary`
- `pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass`
Usage:
```
pt-secure-data [] [ ...]
```
### Global flags
|Flag|Description|
|-----|-----|
|--help|Show context-sensitive help (also try --help-long and --help-man).|
|--debug|Enable debug log level.|
### **Commands**
#### **Help command**
Show help
#### **Collect command**
Collect, sanitize, pack and encrypt data from pt-tools.
Usage:
```
sanitizer collect
```
|Flag|Description|
|-----|-----|
|--bin-dir|Directory having the Percona Toolkit binaries (if they are not in PATH).|
|--temp-dir|Temporary directory used for the data collection. Default: ${HOME}/data_collection\_{timestamp}|
|--include-dir|Include this dir into the sanitized tar file|
|--config-file|Path to the config file. Default: `~/.my.cnf`|
|--mysql-host|MySQL host. Default: `127.0.0.1`|
|--mysql-port|MySQL port. Default: `3306`|
|--mysql-user|MySQL user name.|
|--mysql-password|MySQL password.|
|--ask-mysql-pass|Ask MySQL password.|
|--extra-cmd|Also run this command as part of the data collection. This parameter can be used more than once.|
|--encrypt-password|Encrypt the output file using this password.
If ommited, it will be asked in the command line.|
|--no-collect|Do not collect data|
|--no-sanitize|Do not sanitize data|
|--no-encrypt|Do not encrypt the output file.|
|--no-sanitize-hostnames|Do not sanitize host names.|
|--no-sanitize-queries|Do not replace queries by their fingerprints.|
|--no-remove-temp-files|Do not remove temporary files.|
#### **Decrypt command**
Decrypt an encrypted file. The password will be requested from the terminal.
Usage:
```
sanitizer decrypt
```
#### **Encrypt command**
Encrypt a file. The password will be requested from the terminal.
Usage:
```
sanitizer encrypt
```
#### **Sanitize command**
Replace queries in a file by their fingerprints and obfuscate hostnames.
Usage:
```
sanitizer sanitize [flags]
```
|Flag|Description|
|-----|-----|
|--input-file| Input file. If not specified, the input will be Stdin.|
|--output-file|Output file. If not specified, the input will be Stdout.|
|--no-sanitize-hostnames|Do not sanitize host names.|
|--no-sanitize-queries|Do not replace queries by their fingerprints.|