예제 #1
0
    def fix_group_allow(self, element):

        if not files.contains(element['name'], '"domain admins"'):
            files.append(element['name'], '\n"domain admins"')

        if CONFIG.is_set('site','ldap_dev_team'):
            ldap_dev_team_val = '\n%s' % CONF_MAP('site','ldap_dev_team')
            if not files.contains(element['name'], ldap_dev_team_val):
                files.append(element['name'], ldap_dev_team_val)
예제 #2
0
    def fix_ssh(self, element):

        if not files.contains(element['name'], self.CHROOT_RULE):
            files.append(element['name'], "\n%s\n" % self.CHROOT_RULE)
            cmd_list = [
                "service ssh restart",
            ]
            completed, pinfo = core.exec_cmd_list(cmd_list)
            if not completed:
                raise Exception(t("Error in installation!"), element['name'])
예제 #3
0
    def fix_secure(self, element):

        if not files.contains(element['name'], '\nServerTokens Prod'):
            files.replace_in(element['name'],
                            'ServerTokens OS',
                            'ServerTokens Prod')

        if not files.contains(element['name'], '\nServerSignature Off'):
            files.replace_in(element['name'],
                            '#ServerSignature Off',
                            'ServerSignature Off')

        if not files.contains(element['name'], '\n#ServerSignature On'):
            files.replace_in(element['name'],
                            'ServerSignature On',
                            '#ServerSignature On')

        if not files.contains(element['name'], self.root_directive):
            files.append(element['name'], self.root_directive)
예제 #4
0
    def fix_ses_close(self, element):

        if not files.exists(element['name']):
            files.append(element['name'], "#! /bin/sh")
예제 #5
0
파일: site.py 프로젝트: pylanglois/uwsa
 def fix_centrify_allow(self):
     g_allow = '/etc/centrifydc/groups.allow'
     ldap_group = self.conf.get('access','ldap_group')
     if ldap_group and not files.contains(g_allow, ldap_group):
         files.append(g_allow, '\n%s' % ldap_group)
예제 #6
0
 def fix_acl_crontab(self, element):
     message = t("#Reapply ACL periodically to prevent wordpress like auto update errors.")
     if not files.contains('/etc/crontab', self.RESTORE_OWNERSHIP):
         files.append('/etc/crontab', "\n" + message + "\n" + self.RESTORE_OWNERSHIP + "\n")
예제 #7
0
 def fix_sudoers(self, element):
     if not files.contains(element['name'], '%domain\ admins ALL=(ALL) ALL'):
         files.append(element['name'], '%domain\ admins ALL=(ALL) ALL')
     files.chmod(element['name'], **element['perm'])