rnwolfe / fmc-tools

A collection of tools for common tasks needed on the Cisco Firepower Management Center using a fork of the fireREST library.
39 stars 13 forks source link

Not very secure, try this instead #8

Closed Westy-87 closed 2 years ago

Westy-87 commented 2 years ago

I don't have this script automated, and prefer not to leave the username and password written in the code. So I modified it to input at time of running.

import getpass
print ("Enter username with API access")
username = input("Username: ")
password = getpass.getpass()
rnwolfe commented 2 years ago

Yes, you're right. I wrote this a while ago and wasn't very concerned about that for the use case.

It could pretty easily be adapted to use getpass as you did here, or to let it be passed it as a command line argument which has become my standard approach for new things I'm coding nowadays (e.g. https://github.com/ironbow/webex-teams-bulk-add).