當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。