Пример #1
0
    def __init__(self):
        usage = _('usage: %prog fact hash')
        shortdesc = _('hash facts within a report created by rho')
        desc = _('hash sensitive facts within a report created by rho.')

        CliCommand.__init__(self, 'fact hash', usage, shortdesc, desc)

        self.parser.add_option("--reportfile",
                               dest="report_path",
                               metavar="REPORTFILE",
                               help=_("Report file path - REQUIRED"))

        self.parser.add_option("--facts",
                               dest="facts",
                               metavar="FACTS",
                               action="callback",
                               callback=multi_arg,
                               default=[],
                               help=SUPPRESS_HELP)

        self.parser.add_option("--outputfile",
                               dest="hashed_path",
                               metavar="HASHEDPATH",
                               help=_("Location for the hashed file"),
                               default=None)

        self.facts_to_hash = None
Пример #2
0
    def __init__(self):
        usage = _("usage: %prog auth add [options]")
        shortdesc = _("add auth credentials to config")
        desc = _("adds the authorization credentials to the config")

        CliCommand.__init__(self, "auth add", usage, shortdesc, desc)

        self.parser.add_option("--name",
                               dest="name",
                               metavar="NAME",
                               help=_("auth credential name - REQUIRED"))
        self.parser.add_option("--sshkeyfile",
                               dest="filename",
                               metavar="FILENAME",
                               help=_("file containing SSH key"))
        self.parser.add_option("--username",
                               dest="username",
                               metavar="USERNAME",
                               help=_("user name for authenticating"
                                      " against target machine - REQUIRED"))
        self.parser.add_option("--password",
                               dest="password",
                               action="store_true",
                               help=_("password for authenticating against"
                                      " target machine"))
        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #3
0
    def __init__(self):
        usage = _("usage: %prog auth edit [options]")
        shortdesc = _("edits a given auth")
        desc = _("edit a given auth")

        CliCommand.__init__(self, "auth edit", usage, shortdesc, desc)

        self.parser.add_option("--name", dest="name", metavar="NAME",
                               help=_("NAME of the auth - REQUIRED"))
        self.parser.add_option("--username", dest="username",
                               metavar="USERNAME",
                               help=_("user name for authenticating "
                                      "against target machine"
                                      " - REQUIRED"))
        self.parser.add_option("--password", dest="password",
                               action="store_true",
                               help=_("password for authenticating"
                                      " against target machine"))
        self.parser.add_option("--sudo-password", dest="sudo_password",
                               action="store_true",
                               help=_("password for running sudo"))
        self.parser.add_option("--sshkeyfile", dest="filename",
                               metavar="FILENAME",
                               help=_("file containing SSH key"))
        self.parser.add_option("--vault", dest="vaultfile", metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))

        self.parser.set_defaults(password=False)
        self.parser.set_defaults(sudo_password=False)
Пример #4
0
    def __init__(self):
        usage = _("usage: %prog profile edit [options]")
        shortdesc = _("edits a given profile")
        desc = _("edit a given profile")

        CliCommand.__init__(self, "profile edit", usage, shortdesc, desc)

        self.parser.add_option("--name", dest="name", metavar="NAME",
                               help=_("NAME of the profile - REQUIRED"))
        self.parser.add_option("--hosts", dest="hosts", action="callback",
                               callback=multi_arg,
                               metavar="RANGE", default=[],
                               help=_("IP range to scan. See "
                                      "'man rho' for supported formats."))
        self.parser.add_option("--sshport", dest="sshport", metavar="SSHPORT",
                               help=_("SSHPORT for connection; default=22"))
        # can only replace auth
        self.parser.add_option("--auth", dest="auth", metavar="AUTH",
                               action="callback", callback=multi_arg,
                               default=[], help=_("auth"
                                                  " class"
                                                  " to associate"
                                                  " with profile"))
        self.parser.add_option("--vault", dest="vaultfile", metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #5
0
    def __init__(self):
        usage = _("usage: %prog scan [options] PROFILE")
        shortdesc = _("scan given host profile")
        desc = _("scans the host profile")

        CliCommand.__init__(self, "scan", usage, shortdesc, desc)

        self.parser.add_option("--cache",
                               dest="cache",
                               action="store_true",
                               metavar="RESET",
                               default=False,
                               help=_("Use if profiles/auths previously "
                                      "discovered should be reused"))

        self.parser.add_option("--profile",
                               dest="profile",
                               metavar="PROFILE",
                               help=_("NAME of the profile - REQUIRED"))

        self.parser.add_option("--reportfile",
                               dest="report_path",
                               metavar="REPORTFILE",
                               help=_("Report file path - REQUIRED"))

        self.parser.add_option("--facts",
                               dest="facts",
                               metavar="FACTS",
                               action="callback",
                               callback=multi_arg,
                               default=[],
                               help=_("'default', list or file"))

        self.parser.add_option("--scan-dirs",
                               dest="scan_dirs",
                               metavar="SCANDIRS",
                               action="callback",
                               callback=multi_arg,
                               default=[],
                               help=_("list of remote directories to scan"))

        self.parser.add_option("--ansible-forks",
                               dest="ansible_forks",
                               metavar="FORKS",
                               help=_("number of ansible forks"))

        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))

        self.parser.add_option("--logfile",
                               dest="logfile",
                               metavar="LOGFILE",
                               help=_("file to log scan output to"))

        self.facts_to_collect = None
Пример #6
0
    def __init__(self):
        usage = _("usage: %prog profile list [options]")
        shortdesc = _("list the network profiles")
        desc = _("list the network profiles")

        CliCommand.__init__(self, "profile list", usage, shortdesc, desc)
        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #7
0
    def __init__(self):
        usage = _("usage: %prog auth list [options]")
        shortdesc = _("list auth credentials")
        desc = _("list authentication credentials")

        CliCommand.__init__(self, "auth list", usage, shortdesc, desc)
        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #8
0
    def __init__(self):
        usage = _("usage: %prog auth show [options]")
        shortdesc = _("show auth credential")
        desc = _("show authentication credential")

        CliCommand.__init__(self, "auth show", usage, shortdesc, desc)

        self.parser.add_option("--name", dest="name", metavar="NAME",
                               help=_("auth credential name - REQUIRED"))
        self.parser.add_option("--vault", dest="vaultfile", metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #9
0
    def __init__(self):
        usage = _('usage: %prog fact list')
        shortdesc = _('list facts that rho can detect')
        desc = _('list facts that rho can detect. Filter fact names with '
                 '--filter <regex>')

        CliCommand.__init__(self, 'fact list', usage, shortdesc, desc)

        self.parser.add_option('--filter',
                               dest='filter',
                               metavar='filter',
                               help=_('regexp to filter facts - optional'))
Пример #10
0
    def __init__(self):
        usage = _("usage: %prog scan [options] PROFILE")
        shortdesc = _("scan given host profile")
        desc = _("scans the host profile")

        CliCommand.__init__(self, "scan", usage, shortdesc, desc)

        self.parser.add_option("--reset",
                               dest="reset",
                               action="store_true",
                               metavar="RESET",
                               default=False,
                               help=_("Use if profiles/auths have been "
                                      "changed"))

        self.parser.add_option("--profile",
                               dest="profile",
                               metavar="PROFILE",
                               help=_("NAME of the profile - REQUIRED"))

        self.parser.add_option("--reportfile",
                               dest="report_path",
                               metavar="REPORTFILE",
                               help=_("Report file path - REQUIRED"))

        self.parser.add_option("--facts",
                               dest="facts",
                               metavar="FACTS",
                               action="callback",
                               callback=multi_arg,
                               default=[],
                               help=_("'default' or list " + " - REQUIRED"))

        self.parser.add_option("--ansible_forks",
                               dest="ansible_forks",
                               metavar="FORKS",
                               help=_("number of ansible forks"))

        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #11
0
    def __init__(self):
        usage = _("usage: %prog auth clear")
        shortdesc = _("clears out the credentials")
        desc = _("clears out the crendentials")

        CliCommand.__init__(self, "auth clear", usage, shortdesc, desc)

        self.parser.add_option("--name",
                               dest="name",
                               metavar="NAME",
                               help=_("NAME of the auth "
                                      "credential to be removed"))
        self.parser.add_option("--all",
                               dest="all",
                               action="store_true",
                               help=_("remove ALL auth credentials"))
        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #12
0
    def __init__(self):
        usage = _("usage: %prog profile clear [--name | --all] [options]")
        shortdesc = _("removes 1 or all profiles from list")
        desc = _("removes profiles")

        CliCommand.__init__(self, "profile clear", usage, shortdesc, desc)

        self.parser.add_option("--name",
                               dest="name",
                               metavar="NAME",
                               help=_("NAME of the profile to be removed"))
        self.parser.add_option("--all",
                               dest="all",
                               action="store_true",
                               help=_("remove ALL profiles"))

        self.parser.set_defaults(all=False)
        self.parser.add_option("--vault",
                               dest="vaultfile",
                               metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))
Пример #13
0
    def __init__(self):
        usage = _("usage: %prog profile add [options]")
        shortdesc = _("add a network profile")
        desc = _("add a network profile")

        CliCommand.__init__(self, "profile add", usage, shortdesc, desc)

        self.parser.add_option("--name", dest="name", metavar="NAME",
                               help=_("NAME of the profile - REQUIRED"))
        self.parser.add_option("--hosts", dest="hosts", action="callback",
                               callback=multi_arg,
                               metavar="HOSTS", default=[],
                               help=_("IP range to scan."
                                      " See 'man rho' for supported formats."))
        self.parser.add_option("--sshport", dest="sshport", metavar="SSHPORT",
                               help=_("SSHPORT for connection; default=22"))
        self.parser.add_option("--auth", dest="auth", metavar="AUTH",
                               action="callback", callback=multi_arg,
                               default=[], help=_("auth class to "
                                                  "associate with profile"))
        self.parser.add_option("--vault", dest="vaultfile", metavar="VAULT",
                               help=_("file containing vault password for"
                                      " scripting"))