Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add credential import/export commands #2

Closed
JustinAzoff opened this issue Jan 30, 2018 · 1 comment
Closed

Add credential import/export commands #2

JustinAzoff opened this issue Jan 30, 2018 · 1 comment

Comments

@JustinAzoff
Copy link
Contributor

addcredential works for one at a time, but should support importing a list from a CSV or TSV file.

@JustinAzoff
Copy link
Contributor Author

Done, implemented TSV and JSON importing under the cred subcommand

addcredential is now cred add, along with

Available Commands:
  add         add a new credential pair
  list        list credentials
  import      load credentials from TSV or JSON
$ cat /tmp/creds.tsv 
root	root	14
test	test	30
$ cat /tmp/creds.json 
{"User":"root","Password":"root","ScanInterval":14}
{"User":"test","Password":"test","ScanInterval":14}
{"User":"ubnt","Password":"ubnt","ScanInterval":14}
{"User":"guest","Password":"guest","ScanInterval":2}
$ ./ssh-auditor cred import tsv < /tmp/creds.tsv 
INFO[02-25|15:37:51] added credential                         user=root password=root interval=14
INFO[02-25|15:37:51] added credential                         user=test password=test interval=30
$ ./ssh-auditor cred import json < /tmp/creds.json 
INFO[02-25|15:38:01] updated credential                       user=root password=root interval=14
INFO[02-25|15:38:01] updated credential                       user=test password=test interval=14
INFO[02-25|15:38:01] added credential                         user=ubnt password=ubnt interval=14
INFO[02-25|15:38:01] added credential                         user=guest password=guest interval=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant