def __init__(self):
        self.input_dir = None
        self.output_dir = None
        self.ssg_shared = ""

        self.script_dict = {
            "sysctl_values.csv":                SysctlGenerator(),
            "services_disabled.csv":            ServiceDisabledGenerator(),
            "services_enabled.csv":             ServiceEnabledGenerator(),
            "packages_installed.csv":           PackageInstalledGenerator(),
            "packages_removed.csv":             PackageRemovedGenerator(),
            "kernel_modules_disabled.csv":      KernelModulesDisabledGenerator(),
            "file_dir_permissions.csv":         PermissionGenerator(),
            "accounts_password.csv":            AccountsPasswordGenerator(),
            "mounts.csv":                       MountsGenerator(),
            "mount_options.csv":                MountOptionsGenerator(),
            "selinux_booleans.csv":             SEBoolGenerator(),
            "audit_rules_dac_modification.csv": AuditRulesDacModificationGenerator(),
            "audit_rules_unsuccessful_file_modification.csv":   AuditRulesUnsuccessfulFileModificationGenerator(),
            "audit_rules_file_deletion_events.csv":  AuditRulesFileDeletionEventsGenerator(),
            "audit_rules_login_events.csv":  AuditRulesLoginEventsGenerator(),
            "audit_rules_privileged_commands.csv":  AuditRulesPrivilegedCommandsGenerator(),
            "audit_rules_usergroup_modification.csv":  AuditRulesUserGroupModificationGenerator(),
            "audit_rules_execution.csv":        AuditRulesExecutionGenerator(),
            "file_groupowner.csv":              FileGroupOwnerGenerator(),
            "file_owner.csv":                   FileOwnerGenerator(),
            "file_permissions.csv":             FilePermissionsGenerator(),
        }
        self.langs = ["bash", "ansible", "oval", "anaconda", "puppet"]
        utils_dir = os.path.dirname(os.path.realpath(__file__))
        root_dir = os.path.join(utils_dir, "..", "..")
        self.shared_templates_dir = \
            os.path.join(root_dir, "shared", "templates")
Exemple #2
0
    def __init__(self, env_yaml):
        self.input_dir = None
        self.template_dir = None
        self.csv_dir = None
        self.output_dir = None
        self.ssg_shared = ""
        self.env_yaml = env_yaml

        self.script_dict = {
            "sysctl_values.csv":
            SysctlGenerator(),
            "services_disabled.csv":
            ServiceDisabledGenerator(),
            "services_enabled.csv":
            ServiceEnabledGenerator(),
            "packages_installed.csv":
            PackageInstalledGenerator(),
            "packages_removed.csv":
            PackageRemovedGenerator(),
            "kernel_modules_disabled.csv":
            KernelModulesDisabledGenerator(),
            "file_dir_permissions.csv":
            PermissionGenerator(),
            "accounts_password.csv":
            AccountsPasswordGenerator(),
            "mounts.csv":
            MountsGenerator(),
            "mount_options.csv":
            MountOptionsGenerator(),
            "selinux_booleans.csv":
            SEBoolGenerator(),
            "audit_rules_dac_modification.csv":
            AuditRulesDacModificationGenerator(),
            "audit_rules_unsuccessful_file_modification.csv":
            AuditRulesUnsuccessfulFileModificationGenerator(),
            "audit_rules_unsuccessful_file_modification_detailed.csv":
            ARUFMDetailedGenerator(),
            "audit_rules_file_deletion_events.csv":
            AuditRulesFileDeletionEventsGenerator(),
            "audit_rules_login_events.csv":
            AuditRulesLoginEventsGenerator(),
            "audit_rules_privileged_commands.csv":
            AuditRulesPrivilegedCommandsGenerator(),
            "audit_rules_usergroup_modification.csv":
            AuditRulesUserGroupModificationGenerator(),
            "audit_rules_usergroup_modification.csv":
            AuditRulesUserGroupModificationGenerator(),
            "audit_rules_execution.csv":
            AuditRulesExecutionGenerator(),
            "audit_rules_path_syscall.csv":
            AuditRulesPathSyscallGenerator(),
        }
        self.langs = TEMPLATED_LANGUAGES
        utils_dir = os.path.dirname(os.path.realpath(__file__))
        root_dir = os.path.join(utils_dir, "..", "..")
        self.shared_templates_dir = \
            os.path.join(root_dir, "shared", "templates")