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

Update db_connect help text #11068

Merged
merged 2 commits into from Dec 7, 2018

Conversation

Projects
None yet
4 participants
@jbarnett-r7
Contributor

jbarnett-r7 commented Dec 5, 2018

There was confusion expressed on multiple accounts about the new usage of the db_connect command to support HTTP data services. This PR updates the db_connect -h text to hopefully make the usage more clear.

I'm thinking of this as a rough draft and would really appreciate input from others on how we should best implement this. These initial changes addressed specific feedback from the last conversation we had on the subject. Please offer any suggestions, even if it's a complete re-write/re-format.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • Run db_connect -h and verify the content is correct and easy to understand

@jbarnett-r7 jbarnett-r7 added the msf5 label Dec 5, 2018

@asoto-r7

This comment has been minimized.

Contributor

asoto-r7 commented Dec 5, 2018

To make it a little easier to read:

$ git checkout upstream/pr/11068
$ msfconsole -qx 'db_connect -h'
   USAGE:
      * Postgres Data Service:
          db_connect <user:[pass]>@<host:[port]>/<database>
        Examples:
          db_connect user@metasploit3
          db_connect user:pass@192.168.0.2/metasploit3
          db_connect user:pass@192.168.0.2:1500/metasploit3
          db_connect -y [path/to/database.yml]
 
      * HTTP Data Service:
          db_connect [options] <http|https>://<host:port>
        Examples:
          db_connect http://localhost:8080
          db_connect -c ~/cert.pem -t 6a7a74c1a5003802c955ead1bbddd4ab1b05a7f2940b4732d34bfc555bc6e1c5d7611a497b29e8f0 https://localhost:8080
        NOTE: You must be connected to a Postgres data service in order to successfully connect to a HTTP data service.
 
      Persisting Connections:
        db_connect --name <name to save connection as> [options] <address>
      Examples:
        Saving:     db_connect --name LA-server http://123.123.123.45:1234
        Connecting: db_connect LA-server
 
   OPTIONS:
       -l,--list-services List the available data services that have been previously saved.
       -y,--yaml          Connect to the data service specified in the provided database.yml file.
       -n,--name          Name used to store the connection. Providing an existing name will overwrite the settings for that connection.
       -c,--cert          Certificate file matching the remote data server's certificate. Needed when using self-signed SSL cert.
       -t,--token         The API token used to authenticate to the remote data service.
       --skip-verify      Skip validating authenticity of server's certificate (NOT RECOMMENDED).
print_line(" db_connect -y [path/to/database.yml]")
print_line(" ")
print_line(" * HTTP Data Service:")
print_line(" db_connect [options] <http|https>://<host:port>")

This comment has been minimized.

@jmartin-r7

jmartin-r7 Dec 5, 2018

Contributor

Should port here be optional and default when to 80/443 based on http/https? This would also suggest another example.

db_connect https://my-super-msf-data.service.com

@busterb busterb self-assigned this Dec 7, 2018

@busterb

This comment has been minimized.

Contributor

busterb commented Dec 7, 2018

LGTM, thanks!

@busterb busterb merged commit e36e27d into rapid7:master Dec 7, 2018

3 checks passed

Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

busterb added a commit that referenced this pull request Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment