示例#1
0
def harden_ssh(args):
    '''
    Harden SSH server.

    The root account will not be able to login through SSH after the server
    is harden. This is separated in it's own command to give the admin
    a chance to add new users before locking down root.

    '''
    app.print_verbose("Harden host version: %d" % SCRIPT_VERSION)

    version_obj = version.Version("hardeningSSH", SCRIPT_VERSION)
    version_obj.check_executed()

    setup_ssh()

    version_obj.mark_executed()
示例#2
0
文件: __init__.py 项目: Nemie/syco
def harden_ssh(args):
    '''
    Harden SSH server.

    The root account will not be able to login through SSH after the server
    is harden. This is separated in it's own command to give the admin
    a chance to add new users before locking down root.

    '''
    app.print_verbose("Harden host version: %d" % SCRIPT_VERSION)

    version_obj = version.Version("hardeningSSH", SCRIPT_VERSION)
    version_obj.check_executed()

    setup_ssh()

    version_obj.mark_executed()
示例#3
0
def cleanup_installation(args):
    """
    Clean up a host installation. Disable external repos (so user needs to explicitly update external packages).
    Harden SSH. Remove temp files.

    """
    # Should only be run once!
    app.print_verbose("Cleanup version: %d" % SCRIPT_VERSION)
    version_obj = version.Version("cleanup", SCRIPT_VERSION)
    version_obj.check_executed()

    # Disable external repos
    app.print_verbose("Disabling external yum repos")
    disable_external_repos()

    # Harden SSH
    app.print_verbose("Hardening SSH")
    setup_ssh()

    # Mark as successfully executed
    version_obj.mark_executed()
示例#4
0
def cleanup_installation(args):
    '''
    Clean up a host installation. Disabe external repos (so user needds to explicitly update external packages).
    Harden SSH. Remove temp files. 

    '''
    # Should only be run once!
    app.print_verbose("Cleanup version: %d" % SCRIPT_VERSION)
    version_obj = version.Version("cleanup", SCRIPT_VERSION)
    version_obj.check_executed()

    # Disable external repos
    app.print_verbose("Disabling external yum repos")
    disable_external_repos()

    # Harden SSH
    app.print_verbose("Hardening SSH")
    setup_ssh()

    # Mark as successfully executed
    version_obj.mark_executed()