~junaidali/charms/trusty/plumgrid-director/mgmt_val

« back to all changes in this revision

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

  • Committer: bbaqar at plumgrid
  • Date: 2016-05-18 09:48:39 UTC
  • mfrom: (31.1.8 plumgrid-director)
  • Revision ID: bbaqar@plumgrid.com-20160518094839-gfvrpxkwh3u08z0y
Merge - Mitaka changes
- Created new relation with neutron-api-plumgrid 
- getting pg creds in config 
- nginx conf changes for middleware

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.host.checks import (
22
 
    apt,
23
 
    limits,
24
 
    login,
25
 
    minimize_access,
26
 
    pam,
27
 
    profile,
28
 
    securetty,
29
 
    suid_sgid,
30
 
    sysctl
31
 
)
32
 
 
33
 
 
34
 
def run_os_checks():
35
 
    log("Starting OS hardening checks.", level=DEBUG)
36
 
    checks = apt.get_audits()
37
 
    checks.extend(limits.get_audits())
38
 
    checks.extend(login.get_audits())
39
 
    checks.extend(minimize_access.get_audits())
40
 
    checks.extend(pam.get_audits())
41
 
    checks.extend(profile.get_audits())
42
 
    checks.extend(securetty.get_audits())
43
 
    checks.extend(suid_sgid.get_audits())
44
 
    checks.extend(sysctl.get_audits())
45
 
 
46
 
    for check in checks:
47
 
        log("Running '%s' check" % (check.__class__.__name__), level=DEBUG)
48
 
        check.ensure_compliance()
49
 
 
50
 
    log("OS hardening checks complete.", level=DEBUG)