~junaidali/charms/trusty/plumgrid-director/pg-restart

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/hardening/ssh/checks/__init__.py

  • Committer: Junaid Ali
  • Date: 2016-05-01 02:16:59 UTC
  • Revision ID: junaidali@plumgrid.com-20160501021659-niy7zqw0iy1celyy
update sleep time in restart_pg, changes for make sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2016 Canonical Limited.
2
 
#
3
 
# This file is part of charm-helpers.
4
 
#
5
 
# charm-helpers is free software: you can redistribute it and/or modify
6
 
# it under the terms of the GNU Lesser General Public License version 3 as
7
 
# published by the Free Software Foundation.
8
 
#
9
 
# charm-helpers is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
# GNU Lesser General Public License for more details.
13
 
#
14
 
# You should have received a copy of the GNU Lesser General Public License
15
 
# along with charm-helpers.  If not, see <http://www.gnu.org/licenses/>.
16
 
 
17
 
from charmhelpers.core.hookenv import (
18
 
    log,
19
 
    DEBUG,
20
 
)
21
 
from charmhelpers.contrib.hardening.ssh.checks import config
22
 
 
23
 
 
24
 
def run_ssh_checks():
25
 
    log("Starting SSH hardening checks.", level=DEBUG)
26
 
    checks = config.get_audits()
27
 
    for check in checks:
28
 
        log("Running '%s' check" % (check.__class__.__name__), level=DEBUG)
29
 
        check.ensure_compliance()
30
 
 
31
 
    log("SSH hardening checks complete.", level=DEBUG)