AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/sos/report/plugins/__pycache__/foreman.cpython-310.pyc
o

���bJ8�@s�ddlmZmZmZmZmZmZddlmZddl	m
Z
ddlmZGdd�de�Z
Gdd�de
ee�ZGd	d
�d
e
ee�ZdS)�)�Plugin�RedHatPlugin�	SCLPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�quote)�match)�
is_executablec@sfeZdZdZdZdZdZdZedddd	�ed
ddd	�ed
ddd	�gZ	dZ
dd�Zddd�Zdd�Z
dS)�Foremanz$Foreman/Satellite systems management�foremani)�sysmgmt)r�months�z#number of months for dynflow output)�default�desc�
proxyfeaturesFz!collect features of smart proxies�puma-gczcollect Puma GC statsz/pumactl %s -S /usr/share/foreman/tmp/puma.statecCs�d}d|_d|_zAtd�����D]6}|r|ddkrq|�d�r$d}q|r2td	|�r2|��d
|_|r@td|�r@|��d
|_|�d�sGd}qWn	tyRYnw|j�d
�r_|j�	d
�sk|j�d�rs|j�	d�rs|jd
d�|_d|ji|_
|�dddd��|�ddg�|�
d�d}|��}|�
d�d}|��}|jdd�|j�gdd�|�ddddd d!d"d#d$d%d&d'd(d)d*�|j�d+�|j�d,�|j�d-�|j�d.�|j�d/�|j�g�|�d0d1d2d3d4d5d6d7d8|d8|d9g�|jd:d;d<�|jd=d>d<�|jd?d@�|�dA��r|j|jdBdCd<�|j|jdDdEd<�|�dF�|�dG�}|j|dH|j
dI�dJ|�dK�}dL}dM}dNt|�}	dOt|�}
dPt|�}dQ}||dRdSdT|dUdV�}
dW|	|
|dX�}|
D]}|�|
|�}|j||dYdZ|j
d[��qd|�d\�}|D]$}d]}|d^k�r�|�r�d_}|j||d|d`�}|j||dYdZ|j
d[��q�|�da��r�|jdbddc�}|j
||j
dd�}|dedk�r�|d��d
d�D]}|�df�}dg|d
}|j||ddhdidj��q�|�dkdlg�dS)mNF�	localhost�z/etc/foreman/database.ymlr�#zproduction:Tz\s+host:\s+\S+rz\s+password:\s+\S+� �"�'����
PGPASSWORD�foreman_production_log�foreman_tasks_config)z!/var/log/foreman/production.log.*z/etc/sysconfig/foreman-tasks�/etc/sysconfig/dynflowdz/etc/foreman/*key.pemz/etc/foreman/encryption_key.rb�hostname�outputzhostname -fz/var/log/foreman/production.logz"/var/log/{}*/foreman-ssl_*_ssl.log)�	sizelimitz
/etc/foreman/z/etc/sysconfig/foremanrz/etc/default/foremanz&/var/log/foreman/dynflow_executor*log*z*/var/log/foreman/dynflow_executor*.output*z#/var/log/foreman/apipie_cache*.log*z/var/log/foreman/cron*.log*z /var/log/foreman/db_migrate*log*z/var/log/foreman/db_seed*log*z$/var/log/foreman/production.log[.-]*z$/var/log/foreman-selinux-install.logz&/var/log/foreman-proxy-certs-generate*z/usr/share/foreman/Gemfile*z/var/log/{}*/foreman*z2/var/log/{}*/katello-reverse-proxy_access_ssl.log*z1/var/log/{}*/katello-reverse-proxy_error_ssl.log*z/var/log/{}*/error_log*z/etc/{}*/conf/z/etc/{}*/conf.d/zhammer pingzforeman-selinux-relabel -nvzpassenger-status --show poolz passenger-status --show requestsz"passenger-status --show backtraceszpassenger-memory-statszls -lanR /root/ssl-buildz(ls -lanR /usr/share/foreman/config/hookszping -c1 -W1 %szping -c1 -W1 localhostzsystemctl list-units dynflow*�
dynflow_units��suggest_filenamez!"system-dynflow\x2dsidekiq.slice"�dynflow_sidekiq_statuszdynflow-sidekiq@*)�unitsrzgc-statszpumactl_gc-stats�stats�
pumactl_statsz/usr/sbin/foreman-puma-statusa[SELECT table_name, pg_size_pretty(total_bytes) AS total, pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS toast, pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME, c.reltuples AS row_estimate, pg_total_relation_size(c.oid) AS total_bytes, pg_indexes_size(c.oid) AS index_bytes, pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r') a) a order by total_bytes DESC�foreman_db_tables_sizes)r$�envz	%s monthsrzRselect id,name,value from settings where name not similar to '%(pass|key|secret)%'z]select type,name,host,port,account,base_dn,attr_login,onthefly_register,tls from auth_sourcesz�select dynflow_execution_plans.* from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�select dynflow_actions.* from foreman_tasks_tasks join dynflow_actions on (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�select dynflow_steps.* from foreman_tasks_tasks join dynflow_steps on (foreman_tasks_tasks.external_id = dynflow_steps.execution_plan_uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�WITH prefix_counts AS (SELECT split_part(name,'::',1) FROM fact_names) SELECT COUNT(*), split_part AS "fact_name_prefix" FROM prefix_counts GROUP BY split_part ORDER BY count DESC LIMIT 100z!select * from dynflow_schema_infozselect count(*) from auditszselect count(*) from logsz2select name,url,download_policy from smart_proxies)�foreman_settings_table�foreman_auth_table�dynflow_schema_info�audits_table_count�logs_table_count�fact_names_prefixes�
smart_proxiesz!select * from foreman_tasks_tasks)�foreman_tasks_tasks�dynflow_execution_plans�dynflow_actions�
dynflow_stepsiX�d)r$�timeoutr!r*z
dynflow-utils�psqlr2z /usr/libexec/psql-msgpack-decode)�csv�binaryrz"select name,url from smart_proxies)r9)r*�status�,z\curl -s --key /etc/foreman/client_key.pem --cert /etc/foreman/client_cert.pem %s/v2/features�smart_proxies_features�
)r$�subdirr7�
http_proxy�https_proxy)�dbhost�dbpasswd�open�read�
splitlines�
startswithr	�split�IOError�endswithr*�
add_file_tags�add_forbidden_path�exec_cmd�strip�
add_copy_spec�format�	apachepkg�add_cmd_output�add_service_status�add_journal�
get_option�pumactl�build_query_cmdr�is_installed�add_env_var)�self�production_scope�line�	_hostname�_host_f�_cmdr�scmd�authcmd�dyncmd�
dactioncmd�	dstepscmd�factnamescmd�	foremandb�
foremancsv�table�dynutils�dynr:�proxies�proxy�rm�</usr/lib/python3/dist-packages/sos/report/plugins/foreman.py�setup%sV

���
�
���
��
��


������
��������	�����

�
�

��
�
�z
Foreman.setupr8cCs$|rd|}d}|||jt|�fS)aI
        Builds the command needed to invoke the pgsql query as the postgres
        user.
        The query requires significant quoting work to satisfy both the
        shell and postgres parsing requirements. Note that this will generate
        a large amount of quoting in sos logs referencing the command being run
        z>COPY (%s) TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)z:%s --no-password -h %s -p 5432 -U foreman -d foreman -c %s)rBr)rZ�queryr9r:�_dbcmdrmrmrnrWs�zForeman.build_query_cmdcCs4|�d|jdd�|�ddd�|�ddd�dS)	Nz(/var/log/%s*/foreman-ssl_access_ssl.log*z7(.*\?(passw|cred|token|secret|key).*=)(.*) (HTTP.*(.*))z
\1******** \4z/etc/foreman/(.*)((conf)(.*)?)z5((\:|\s*)(passw|cred|token|secret|key).*(\:\s|=))(.*)z
\1********z"/etc/foreman/(.*)((yaml|yml)(.*)?)z\1"********")�do_path_regex_subrQ�rZrmrmrn�postproc's���zForeman.postprocN)Fr8)�__name__�
__module__�__qualname__�
short_desc�plugin_name�plugin_timeout�profiles�packagesr�option_listrVrorWrtrmrmrmrnrs*����
urcs eZdZdZ�fdd�Z�ZS)�
RedHatForeman�httpdcsR|�ddi�|j��dkrtd�rd|j|_tt|���|jdddd	�dS)
Nz"/usr/share/foreman/.ssh/ssh_config�ssh_foreman_config��sclzscl enable tfm '%s'�tfmzgem listzscl enable tfm gem listr#)	rK�policy�dist_versionr
rV�superr~ro�add_cmd_output_sclrs��	__class__rmrnro>s�
�zRedHatForeman.setup)rurvrwrQro�
__classcell__rmrmr�rnr~:sr~c@seZdZdZdS)�
DebianForeman�apache2N)rurvrwrQrmrmrmrnr�Msr�N)�sos.report.pluginsrrrrrr�pipesr�rer	�
sos.utilitiesr
rr~r�rmrmrmrn�<module>s )

Anon7 - 2022
AnonSec Team