当前位置: 首页>>代码示例>>Python>>正文


Python host.TEMPLATES_DIR属性代码示例

本文整理汇总了Python中charmhelpers.contrib.hardening.host.TEMPLATES_DIR属性的典型用法代码示例。如果您正苦于以下问题:Python host.TEMPLATES_DIR属性的具体用法?Python host.TEMPLATES_DIR怎么用?Python host.TEMPLATES_DIR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在charmhelpers.contrib.hardening.host的用法示例。


在下文中一共展示了host.TEMPLATES_DIR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_audits

# 需要导入模块: from charmhelpers.contrib.hardening import host [as 别名]
# 或者: from charmhelpers.contrib.hardening.host import TEMPLATES_DIR [as 别名]
def get_audits():
    """Get OS hardening profile audits.

    :returns:  dictionary of audits
    """
    audits = []

    settings = utils.get_settings('os')
    # If core dumps are not enabled, then don't allow core dumps to be
    # created as they may contain sensitive information.
    if not settings['security']['kernel_enable_core_dump']:
        audits.append(TemplatedFile('/etc/profile.d/pinerolo_profile.sh',
                                    ProfileContext(),
                                    template_dir=TEMPLATES_DIR,
                                    mode=0o0755, user='root', group='root'))
    if settings['security']['ssh_tmout']:
        audits.append(TemplatedFile('/etc/profile.d/99-hardening.sh',
                                    ProfileContext(),
                                    template_dir=TEMPLATES_DIR,
                                    mode=0o0644, user='root', group='root'))
    return audits 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:23,代码来源:profile.py

示例2: get_audits

# 需要导入模块: from charmhelpers.contrib.hardening import host [as 别名]
# 或者: from charmhelpers.contrib.hardening.host import TEMPLATES_DIR [as 别名]
def get_audits():
    """Get OS hardening security limits audits.

    :returns:  dictionary of audits
    """
    audits = []
    settings = utils.get_settings('os')

    # Ensure that the /etc/security/limits.d directory is only writable
    # by the root user, but others can execute and read.
    audits.append(DirectoryPermissionAudit('/etc/security/limits.d',
                                           user='root', group='root',
                                           mode=0o755))

    # If core dumps are not enabled, then don't allow core dumps to be
    # created as they may contain sensitive information.
    if not settings['security']['kernel_enable_core_dump']:
        audits.append(TemplatedFile('/etc/security/limits.d/10.hardcore.conf',
                                    SecurityLimitsContext(),
                                    template_dir=TEMPLATES_DIR,
                                    user='root', group='root', mode=0o0440))
    return audits 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:24,代码来源:limits.py


注:本文中的charmhelpers.contrib.hardening.host.TEMPLATES_DIR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。