404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@13.59.88.8: ~ $
3

�~�f�$�@s�UdZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZeje�Zdd	d
ddgd
�Zdddddgd
�dddddgd
�dddddgd
�d�Zxd:D]Zedee<q�Wxd;D]Zedee<q�WdZddd d!d"ddddddddd#gZd$d%d&eeeed'�gd(d)gd*�Ze
ee�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Ze ee	e!dd7�d8d9�Z"dS)<zCA Certs: Add ca certificates.�N)�dedent)�subp�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEz!/usr/local/share/ca-certificates/z#cloud-init-ca-cert-{cert_index}.crtz/etc/ca-certificates.confzupdate-ca-certificates)�ca_cert_path�ca_cert_local_path�ca_cert_filename�ca_cert_config�ca_cert_update_cmdz/etc/pki/ca-trust/z/usr/share/pki/ca-trust-source/z+anchors/cloud-init-ca-cert-{cert_index}.crtzupdate-ca-trustz/etc/pki/trust/z/usr/share/pki/trust/)�fedora�rhel�opensuse�opensuse-microos�opensuse-tumbleweed�
opensuse-leap�sle_hpc�	sle-micro�slesr�	almalinux�
cloudlinuxra/This module adds CA certificates to the system's CA store and updates any
related files using the appropriate OS-specific utility. The default CA
certificates can be disabled/deleted from use by 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::
    Alpine Linux requires the ca-certificates package to be installed in
    order to provide the ``update-ca-certificates`` command.
�alpine�debianr�ubuntuZcc_ca_certszCA CertificateszAdd ca certificatesa            ca_certs:
              remove_defaults: true
              trusted:
                - single_line_cert
                - |
                  -----BEGIN CERTIFICATE-----
                  YOUR-ORGS-TRUSTED-CA-CERT-HERE
                  -----END CERTIFICATE-----
            �ca_certszca-certs)�id�name�title�description�distrosZ	frequencyZexamplesZactivate_by_schema_keyscCs*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_configs|s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.
    rF)ZcaptureN)r)�
distro_cfgr,r,r-�update_ca_certs�sr0cCsL|sdSx>t|d�D]0\}}t|�}|dj|d�}tj||dd�qWdS)a-
    Adds certificates to the system. To actually apply the new certificates
    you must also call the appropriate distro-specific utility such as
    L{update_ca_certs}.

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    @param certs: A list of certificate strings.
    N�r#)�
cert_indexi�)�mode)�	enumerate�str�formatr�
write_file)r/Zcertsr2�cZcert_file_contentsZcert_file_namer,r,r-�add_ca_certs�s	r9cCs@|dkrt|�n*|dkr<t|�|dkr<d
}tjd|d	�d
S)a.
    Disables all default trusted CA certificates. For Alpine, Debian and
    Ubuntu to actually apply the changes 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.
    rrrrz/ca-certificates ca-certificates/trust_new_crts z	select no�debconf-set-selections�-)�dataN)rrr)rrz8ca-certificates ca-certificates/trust_new_crts select no)r:r;)�remove_default_ca_certs�disable_system_ca_certsr)r*r/Zdebconf_selr,r,r-�disable_default_ca_certs�s	
r?cCs�|d}|stjj|�r dSd}d}tj|�jr�tj|�}g}xh|j�D]\}||krhd}|j|�qL|dks||dd
kr�|j|�qL|s�|j|�d}|jd	|�qLWtj	|d
j
|�d
dd�dS)z�
    For every entry in the CA_CERT_CONFIG file prefix the entry with a "!"
    in order to disable it.

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    r
Nz;# Modified by cloud-init to deselect certs due to user-dataFT�r�#�!�
�wb)Zomode)rArB)r'r(�exists�stat�st_sizerZ	load_file�
splitlines�appendr7r))r/Zca_cert_cfg_fnZheader_commentZadded_headerZorigZ	out_lines�liner,r,r-r>�s(

r>cCs:|ddkrdStjd�tj|d�tj|d�dS)z�
    Removes all default trusted CA certificates from the system.

    @param distro_cfg: A hash providing _distro_ca_certs_configs function.
    r
NzDeleting system CA certificatesr)�LOG�debugrZdelete_dir_contents)r/r,r,r-r=�s

r=)rr+�cloud�args�returncCs�d|krtjdddd�nd|kr2tjd|�dSd|krLd|krLtjd	�|jd|jd��}t|jj�}d
|kr�tjdddd�|jd
|jd
d��r�tjd�t	|jj|�d|kr�tj
|d�}|r�tjdt|��t||�tjd�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-certszKey 'ca-certs'z22.1zUse 'ca_certs' instead.)Z
deprecatedZdeprecated_versionZ
extra_messagerz<Skipping module named %s, no 'ca_certs' key in configurationNzMFound both ca-certs (deprecated) and ca_certs config keys. Ignoring ca-certs.zremove-defaultszKey 'remove-defaults'zUse 'remove_defaults' instead.Zremove_defaultsFz'Disabling/removing default certificatesZtrustedzAdding %d certificateszUpdating certificates)rZ	deprecaterKrLZwarningr%r.�distrorr?Zget_cfg_option_list�lenr9r0)rr+rMrNZca_cert_cfgr/Z
trusted_certsr,r,r-�handle�s>




rR)rrrrrr)rr)#�__doc__Zloggingr'�textwraprZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.settingsr	Z	getLogger�__name__rKr&r$rPZMODULE_DESCRIPTIONr"�metar.r0r9r?r>r=r5�listrRr,r,r,r-�<module>s�



	'

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 128 B 0644
__init__.cpython-36.pyc File 128 B 0644
cc_ansible.cpython-36.opt-1.pyc File 8.63 KB 0644
cc_ansible.cpython-36.pyc File 8.63 KB 0644
cc_apk_configure.cpython-36.opt-1.pyc File 4.51 KB 0644
cc_apk_configure.cpython-36.pyc File 4.51 KB 0644
cc_apt_configure.cpython-36.opt-1.pyc File 30.42 KB 0644
cc_apt_configure.cpython-36.pyc File 30.42 KB 0644
cc_apt_pipelining.cpython-36.opt-1.pyc File 2.44 KB 0644
cc_apt_pipelining.cpython-36.pyc File 2.44 KB 0644
cc_bootcmd.cpython-36.opt-1.pyc File 2.51 KB 0644
cc_bootcmd.cpython-36.pyc File 2.51 KB 0644
cc_byobu.cpython-36.opt-1.pyc File 3.04 KB 0644
cc_byobu.cpython-36.pyc File 3.04 KB 0644
cc_ca_certs.cpython-36.opt-1.pyc File 7.05 KB 0644
cc_ca_certs.cpython-36.pyc File 7.05 KB 0644
cc_chef.cpython-36.opt-1.pyc File 9.13 KB 0644
cc_chef.cpython-36.pyc File 9.13 KB 0644
cc_disable_ec2_metadata.cpython-36.opt-1.pyc File 1.72 KB 0644
cc_disable_ec2_metadata.cpython-36.pyc File 1.72 KB 0644
cc_disk_setup.cpython-36.opt-1.pyc File 23.1 KB 0644
cc_disk_setup.cpython-36.pyc File 23.1 KB 0644
cc_fan.cpython-36.opt-1.pyc File 2.74 KB 0644
cc_fan.cpython-36.pyc File 2.74 KB 0644
cc_final_message.cpython-36.opt-1.pyc File 3.07 KB 0644
cc_final_message.cpython-36.pyc File 3.07 KB 0644
cc_growpart.cpython-36.opt-1.pyc File 15.91 KB 0644
cc_growpart.cpython-36.pyc File 15.91 KB 0644
cc_grub_dpkg.cpython-36.opt-1.pyc File 4.92 KB 0644
cc_grub_dpkg.cpython-36.pyc File 4.92 KB 0644
cc_install_hotplug.cpython-36.opt-1.pyc File 3.25 KB 0644
cc_install_hotplug.cpython-36.pyc File 3.25 KB 0644
cc_keyboard.cpython-36.opt-1.pyc File 1.98 KB 0644
cc_keyboard.cpython-36.pyc File 1.98 KB 0644
cc_keys_to_console.cpython-36.opt-1.pyc File 3.11 KB 0644
cc_keys_to_console.cpython-36.pyc File 3.11 KB 0644
cc_landscape.cpython-36.opt-1.pyc File 4.71 KB 0644
cc_landscape.cpython-36.pyc File 4.71 KB 0644
cc_locale.cpython-36.opt-1.pyc File 1.58 KB 0644
cc_locale.cpython-36.pyc File 1.58 KB 0644
cc_lxd.cpython-36.opt-1.pyc File 13.04 KB 0644
cc_lxd.cpython-36.pyc File 13.04 KB 0644
cc_mcollective.cpython-36.opt-1.pyc File 4.24 KB 0644
cc_mcollective.cpython-36.pyc File 4.24 KB 0644
cc_migrator.cpython-36.opt-1.pyc File 2.92 KB 0644
cc_migrator.cpython-36.pyc File 2.92 KB 0644
cc_mounts.cpython-36.opt-1.pyc File 14.08 KB 0644
cc_mounts.cpython-36.pyc File 14.08 KB 0644
cc_ntp.cpython-36.opt-1.pyc File 13.15 KB 0644
cc_ntp.cpython-36.pyc File 13.15 KB 0644
cc_package_update_upgrade_install.cpython-36.opt-1.pyc File 3.78 KB 0644
cc_package_update_upgrade_install.cpython-36.pyc File 3.78 KB 0644
cc_phone_home.cpython-36.opt-1.pyc File 4.1 KB 0644
cc_phone_home.cpython-36.pyc File 4.1 KB 0644
cc_power_state_change.cpython-36.opt-1.pyc File 6.24 KB 0644
cc_power_state_change.cpython-36.pyc File 6.24 KB 0644
cc_puppet.cpython-36.opt-1.pyc File 9.46 KB 0644
cc_puppet.cpython-36.pyc File 9.46 KB 0644
cc_reset_rmc.cpython-36.opt-1.pyc File 3.59 KB 0644
cc_reset_rmc.cpython-36.pyc File 3.59 KB 0644
cc_resizefs.cpython-36.opt-1.pyc File 7.02 KB 0644
cc_resizefs.cpython-36.pyc File 7.02 KB 0644
cc_resolv_conf.cpython-36.opt-1.pyc File 4.27 KB 0644
cc_resolv_conf.cpython-36.pyc File 4.27 KB 0644
cc_rh_subscription.cpython-36.opt-1.pyc File 12.06 KB 0644
cc_rh_subscription.cpython-36.pyc File 12.06 KB 0644
cc_rightscale_userdata.cpython-36.opt-1.pyc File 2.77 KB 0644
cc_rightscale_userdata.cpython-36.pyc File 2.77 KB 0644
cc_rsyslog.cpython-36.opt-1.pyc File 10.34 KB 0644
cc_rsyslog.cpython-36.pyc File 10.34 KB 0644
cc_runcmd.cpython-36.opt-1.pyc File 2.43 KB 0644
cc_runcmd.cpython-36.pyc File 2.43 KB 0644
cc_salt_minion.cpython-36.opt-1.pyc File 4.36 KB 0644
cc_salt_minion.cpython-36.pyc File 4.36 KB 0644
cc_scripts_per_boot.cpython-36.opt-1.pyc File 1.4 KB 0644
cc_scripts_per_boot.cpython-36.pyc File 1.4 KB 0644
cc_scripts_per_instance.cpython-36.opt-1.pyc File 1.57 KB 0644
cc_scripts_per_instance.cpython-36.pyc File 1.57 KB 0644
cc_scripts_per_once.cpython-36.opt-1.pyc File 1.51 KB 0644
cc_scripts_per_once.cpython-36.pyc File 1.51 KB 0644
cc_scripts_user.cpython-36.opt-1.pyc File 1.58 KB 0644
cc_scripts_user.cpython-36.pyc File 1.58 KB 0644
cc_scripts_vendor.cpython-36.opt-1.pyc File 2.04 KB 0644
cc_scripts_vendor.cpython-36.pyc File 2.04 KB 0644
cc_seed_random.cpython-36.opt-1.pyc File 4.07 KB 0644
cc_seed_random.cpython-36.pyc File 4.07 KB 0644
cc_set_hostname.cpython-36.opt-1.pyc File 4 KB 0644
cc_set_hostname.cpython-36.pyc File 4 KB 0644
cc_set_passwords.cpython-36.opt-1.pyc File 8.4 KB 0644
cc_set_passwords.cpython-36.pyc File 8.4 KB 0644
cc_snap.cpython-36.opt-1.pyc File 5.94 KB 0644
cc_snap.cpython-36.pyc File 5.94 KB 0644
cc_spacewalk.cpython-36.opt-1.pyc File 2.87 KB 0644
cc_spacewalk.cpython-36.pyc File 2.87 KB 0644
cc_ssh.cpython-36.opt-1.pyc File 11.02 KB 0644
cc_ssh.cpython-36.pyc File 11.02 KB 0644
cc_ssh_authkey_fingerprints.cpython-36.opt-1.pyc File 3.54 KB 0644
cc_ssh_authkey_fingerprints.cpython-36.pyc File 3.54 KB 0644
cc_ssh_import_id.cpython-36.opt-1.pyc File 3.85 KB 0644
cc_ssh_import_id.cpython-36.pyc File 3.85 KB 0644
cc_timezone.cpython-36.opt-1.pyc File 1.24 KB 0644
cc_timezone.cpython-36.pyc File 1.24 KB 0644
cc_ubuntu_advantage.cpython-36.opt-1.pyc File 12.42 KB 0644
cc_ubuntu_advantage.cpython-36.pyc File 12.42 KB 0644
cc_ubuntu_autoinstall.cpython-36.opt-1.pyc File 3.89 KB 0644
cc_ubuntu_autoinstall.cpython-36.pyc File 3.89 KB 0644
cc_ubuntu_drivers.cpython-36.opt-1.pyc File 3.63 KB 0644
cc_ubuntu_drivers.cpython-36.pyc File 3.63 KB 0644
cc_update_etc_hosts.cpython-36.opt-1.pyc File 4.3 KB 0644
cc_update_etc_hosts.cpython-36.pyc File 4.3 KB 0644
cc_update_hostname.cpython-36.opt-1.pyc File 3.01 KB 0644
cc_update_hostname.cpython-36.pyc File 3.01 KB 0644
cc_users_groups.cpython-36.opt-1.pyc File 7.58 KB 0644
cc_users_groups.cpython-36.pyc File 7.58 KB 0644
cc_wireguard.cpython-36.opt-1.pyc File 8.39 KB 0644
cc_wireguard.cpython-36.pyc File 8.39 KB 0644
cc_write_files.cpython-36.opt-1.pyc File 5.61 KB 0644
cc_write_files.cpython-36.pyc File 5.61 KB 0644
cc_write_files_deferred.cpython-36.opt-1.pyc File 1.73 KB 0644
cc_write_files_deferred.cpython-36.pyc File 1.73 KB 0644
cc_yum_add_repo.cpython-36.opt-1.pyc File 6.03 KB 0644
cc_yum_add_repo.cpython-36.pyc File 6.03 KB 0644
cc_zypper_add_repo.cpython-36.opt-1.pyc File 5.66 KB 0644
cc_zypper_add_repo.cpython-36.pyc File 5.66 KB 0644
modules.cpython-36.opt-1.pyc File 7.31 KB 0644
modules.cpython-36.pyc File 7.31 KB 0644
schema.cpython-36.opt-1.pyc File 39.45 KB 0644
schema.cpython-36.pyc File 39.45 KB 0644