/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations
import asyncio import pathlib import shutil from defence360agent.subsys.panels import hosting_panel from defence360agent.utils import importer panel_users = importer.get( module="imav.malwarelib.utils.user_list", name="panel_users", default=None ) def migrate(migrator, database, fake=False, **kwargs): if fake: return loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) users = loop.run_until_complete(panel_users()) for user in users: path_obj = pathlib.Path(user["home"]) old_path = str(path_obj.parent / ".rapid-scan-db" / path_obj.name) try: new_path = hosting_panel.HostingPanel().get_rapid_scan_db_dir( user["home"] ) except OSError: continue if new_path is None or old_path == new_path: continue try: shutil.move(old_path, new_path) except OSError: pass def rollback(migrator, database, fake=False, **kwargs): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) users = loop.run_until_complete(panel_users()) for user in users: path_obj = pathlib.Path(user["home"]) old_path = str(path_obj.parent / ".rapid-scan-db" / path_obj.name) try: new_path = hosting_panel.HostingPanel().get_rapid_scan_db_dir( user["home"] ) except OSError: continue if new_path is None or old_path == new_path: continue try: shutil.move(new_path, old_path) except OSError: pass
.
Edit
..
Edit
001_initial.py
Edit
002_infected_domain_list.py
Edit
003_import_from_list.py
Edit
004_add_username_to_infected_domain_list.py
Edit
005_timeout_in_iplist.py
Edit
006_comment_in_plist.py
Edit
007_add_country_code_fields.py
Edit
008_fill_countries.py
Edit
009_drop_blocklist_history.py
Edit
010_drop_country_entities.py
Edit
011_create_new_country_entities.py
Edit
012_fill_countries_and_subnets.py
Edit
013_add_indexes_to_iplist.py
Edit
014_add_malware_hits.py
Edit
015_add_iplist_expiration_index.py
Edit
016_fix_autowhitelist_expiration.py
Edit
017_remove_sensor_prefix.py
Edit
018_license_info.py
Edit
019_purge_old_configs.py
Edit
020_malware_scan_types.py
Edit
021_add_testing_repo.py
Edit
022_mod_security_vendors_migrations.py
Edit
023_add_default_rule_in_modsec_custom_conf.py
Edit
024_ignore_from_graylist.py
Edit
025_malware_config_realtime.py
Edit
026_remove_old_temporary_file.py
Edit
027_disable_comdo_fp_rules.py
Edit
028_set_permanent_ttl_for_blacklist.py
Edit
029_custom_quarantine.py
Edit
030_rename_max_incident_repetition.py
Edit
031_add_mode_field.py
Edit
031_modsec_config_for_plesk_include.py
Edit
032_chmod_quarantine.py
Edit
033_disable_cphulk.py
Edit
034_hits_extras.py
Edit
035_add_dos_expiration_field.py
Edit
036_add_block_port.py
Edit
037_disabled_rules.py
Edit
038_disabled_rules_import.py
Edit
039_fix_malware_hits.py
Edit
040_ignore_mod_sec_rule_214920.py
Edit
041_fix_invalid_ignore_filed.py
Edit
042_rebuildinstalledssldb.py
Edit
043_disable_dos_scan_by_default.py
Edit
044_ignore_virtfs_on_cpanel.py
Edit
045_ignore_vdserver_dir_in_csf.py
Edit
046_foreign_key_fix.py
Edit
047_license_in_file.py
Edit
048_malware_hits_vendor_field.py
Edit
049_add_auto_added_field_to_iplist.py
Edit
050_fill_auto_whitelisted.py
Edit
051_cleanup_vd_license.py
Edit
052_whitelisted_crawlers.py
Edit
053_populate_whitelisted_crawlers.py
Edit
054_add_malicious_and_added_date_fileds.py
Edit
055_migrate_move_to_quar_option.py
Edit
056_populate_malicious_with_quarantined.py
Edit
057_filename_is_blob.py
Edit
058_convert_license_last_attempt.py
Edit
059_scans_error_field.py
Edit
061_migrate_backup_system_conf.py
Edit
062_drop_malware_extra_data.py
Edit
062_fix_null_expiration.py
Edit
063_fix_graylist_doslist_expiration_discrepancy.py
Edit
064_chmod_i360deploy_log.py
Edit
065_remove_capture_csf_lock_from_config.py
Edit
066_eula_table.py
Edit
067_drop_fields_from_modsec_conf.py
Edit
068_remove_rules_check_interval_from_config.py
Edit
069_incidents_domain_field.py
Edit
070_modsec_incident_names.py
Edit
071_malware_hits_hash_size_fields.py
Edit
072_add_malware_history_table.py
Edit
072_captcha_stat.py
Edit
072_extend_last_synclist.py
Edit
073_drop_dos_expiration.py
Edit
074_ip_as_int.py
Edit
075_ips_as_int.py
Edit
076_hash_model.py
Edit
077_alter_malware_scan.py
Edit
078_fix_signatures_permissions.py
Edit
079_add_uid_gid_fields.py
Edit
080_populate_uid_gid_size_hash_fields.py
Edit
081_fix_clamscan_broken_symlink.py
Edit
082_add_cl_on_premise_backup_option.py
Edit
082_add_manual_flag.py
Edit
083_drop_no_captcha_field.py
Edit
084_country_subnets_fields.py
Edit
085_country_subnets_fields.py
Edit
086_ignored_by_port_fields.py
Edit
087_ignored_by_port_fields.py
Edit
088_add_malware_i360_clamd_scan_option.py
Edit
089_proactive_tables.py
Edit
090_safe_user_config.py
Edit
091_compress_old_logs.py
Edit
092_ignore_proc_sys_dirs.py
Edit
092_remove_old_disabled_rules.py
Edit
093_make_quarantined_files_immutable.py
Edit
094_ignore_cagefs_proc.py
Edit
095_add_total_malicious_field.py
Edit
096_populate_total_malicious_field.py
Edit
097_remove_uid_and_gid.py
Edit
098_remote_proxy_tables.py
Edit
099_remove_old_disabled_rules.py
Edit
100_remove_captcha_ports_from_csf.py
Edit
101_remove_unneeded_acronis_ports_from_csf.py
Edit
102_proactive_ignore_list.py
Edit
102_replace_comodo.py
Edit
103_remove_vd_license.py
Edit
104_add_feature_management_permissions.py
Edit
105_populate_default_feature_management_permissions.py
Edit
106_add_malware_cleanup_in_config.py
Edit
106_malware_hit_status_field_add.py
Edit
107_add_bruteforce_rule_33339.py
Edit
107_malware_hit_status_field_populate.py
Edit
108_feature_management_cleanup_add.py
Edit
108_validate_config.py
Edit
109_dos_detector.py
Edit
110_ignore_list_ip_as_int.py
Edit
111_ignore_list_ip_as_int.py
Edit
112_hardened_php.py
Edit
113_move_quarantined_files.py
Edit
114_disable_auto-quarantine.py
Edit
115_feature_management_fields.py
Edit
116_feature_management_fields.py
Edit
117_remove_incorrect_fields.py
Edit
118_add_malware_user_infected.py
Edit
118_remove_country_subnets.py
Edit
119_populate_malware_user_infected.py
Edit
120_scheduled_scan.py
Edit
121_drop_captcha_stat.py
Edit
122_cagefs_unmount.py
Edit
123_add_last_user_scan.py
Edit
123_disable_scheduled_scan.py
Edit
123_rename_plesk_vendor.py
Edit
124_add_hook_management_functionality.py
Edit
124_add_infected_domains_vendor.py
Edit
125_rescan_scan_type.py
Edit
126_add_malware_scan_modified_files_option.py
Edit
126_move_malware_hits_list.py
Edit
127_remove_malware_hit_mode.py
Edit
128_move_cleanup_storage_files.py
Edit
129_fixed_cagefs_unmount.py
Edit
130_add_messages_to_send.py
Edit
131_incident_timestamp_index.py
Edit
132_add_timestamp_field.py
Edit
133_add_scope_field_to_iplist.py
Edit
134_change_default_of_intensity_ram.py
Edit
135_export_proactive.py
Edit
135_make_completed_nullable.py
Edit
136_drop_proactive.py
Edit
137_swap_initiator_and_cause.py
Edit
138_move_rapid_scan_dir.py
Edit
139_generic_modsec_config.py
Edit
140_cast_malware_hit_orig_file_as_blob.py
Edit
141_drop_last_user_scans.py
Edit
143_malware_hit_cascade_delete.py
Edit
144_remove_clamav_config_options.py
Edit
144_remove_hash_table.py
Edit
145_move_quarantine.py
Edit
146_malware_user_infected_cascade_delete.py
Edit
147_remove_vendor_field.py
Edit
147_user_scan_type.py
Edit
148_reconstruct_pickled_scan_queue.py
Edit
148_remove_malware_user_infected.py
Edit
149_add_captcha_passed_field_to_iplist.py
Edit
149_make_config_inactive.py
Edit
150_update_captcha_passed_field_for_iplist_entries.py
Edit
151_change_constraint_for_iplist.py
Edit
152_add_listname_to_primary_key.py
Edit
153_migrate_config_default_action.py
Edit
153_update_incident_name.py
Edit
154_migrate_config_user_override_malware_actions.py
Edit
155_migrate_config_user_override_proactive_defense.py
Edit
156_remove_default_values_from_config.py
Edit
157_move_i360_modsec_disable_conf.py
Edit
158_move_i360_modsec_disable_conf_symlink.py
Edit
159_remove_defaults_from_local_config.py
Edit
160_remove_quarantine.py
Edit
160_unmount_sigs_v1.py
Edit
161_remove_ea4_main_local_conf.py
Edit
162_add_resource_type.py
Edit
163_drop_malware_scanned_stat.py
Edit
164_add_resource_type_to_ignore.py
Edit
165_add_db_fields_to_malware_history.py
Edit
166_add_id_field_to_malware_ignore_path.py
Edit
167_remote_iplist.py
Edit
168_add_icontact_throttle.py
Edit
169_add_record_to_throttle_scan_not_schedule_events.py
Edit
170_add_db_fields_to_malware_history.py
Edit
180_move_captcha_configs.py
Edit
182_remove_constraints_from_icontact_throttle.py
Edit
183_add_user_field_to_malware_scans.py
Edit
184_create_a_table_for_secure_site_permissions.py
Edit
185_delete_all_secure_site_id.py
Edit
186_add_user_field_to_icontact_throttle.py
Edit
187_fix_scan_unserialization.py
Edit
188_add_protection_status_field_myimunify.py
Edit
189_add_messages_to_send_nr.py
Edit
190_add_analyst_cleanup_request_table.py
Edit
191_create_wordpress_incident_table.py
Edit
192_add_wordpress_incident_unique_index.py
Edit
193_remove_sent_to_server_from_wordpress_incident.py
Edit
194_add_wp_disabled_rules.py
Edit
194_create_nonprivileged_config.py
Edit
195_create_wordpress_site.py
Edit
196_add_disabled_rules_sync_ts.py
Edit
197_add_wordpress_site_manually_deleted_at.py
Edit
198_add_wordpress_site_version.py
Edit
__init__.py
Edit
__pycache__
Edit
conf.py
Edit