Skip to content

Commit a479103

Browse files
committed
Remove CSF support as it's being discontinued on August 31, 2025
- Remove CSF menu item from sidebar navigation - Disable CSF-related URL endpoints in firewall module - Update upgrade process to automatically remove CSF and restore firewalld - Archive CSF template and configuration files - Clean up CSF references in settings and upgrade scripts CSF (ConfigServer Security & Firewall) is shutting down on August 31, 2025. This commit removes CSF integration and ensures firewalld is restored as the default firewall solution during upgrades. Fixes #1473
1 parent d64ccc3 commit a479103

File tree

7 files changed

+25
-94
lines changed

7 files changed

+25
-94
lines changed

.idea/workspace.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CyberCP/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,5 @@
193193
MEDIA_ROOT = MEDIA_URL
194194
DATA_UPLOAD_MAX_MEMORY_SIZE = 2147483648
195195

196-
# Security settings for CSF compliance
196+
# Security settings
197197
X_FRAME_OPTIONS = 'SAMEORIGIN'

baseTemplate/templates/baseTemplate/index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,6 @@
16381638
<a href="{% url 'modSecRulesPacks' %}" class="menu-item">
16391639
<span>ModSecurity Rules Packs</span>
16401640
</a>
1641-
<a href="{% url 'csf' %}" class="menu-item">
1642-
<span>CSF</span>
1643-
</a>
16441641
<a href="{% url 'imunify' %}" class="menu-item">
16451642
<span>Imunify 360</span>
16461643
</a>

firewall/urls.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
path('getRulesFiles', views.getRulesFiles, name='getRulesFiles'),
3636
path('enableDisableRuleFile', views.enableDisableRuleFile, name='enableDisableRuleFile'),
3737

38-
# CSF
39-
path('csf', views.csf, name='csf'),
40-
path('installCSF', views.installCSF, name='installCSF'),
41-
path('installStatusCSF', views.installStatusCSF, name='installStatusCSF'),
42-
path('removeCSF', views.removeCSF, name='removeCSF'),
43-
path('fetchCSFSettings', views.fetchCSFSettings, name='fetchCSFSettings'),
44-
path('changeStatus', views.changeStatus, name='changeStatus'),
45-
path('modifyPorts', views.modifyPorts, name='modifyPorts'),
46-
path('modifyIPs', views.modifyIPs, name='modifyIPs'),
38+
# CSF - Discontinued on August 31, 2025
39+
# path('csf', views.csf, name='csf'),
40+
# path('installCSF', views.installCSF, name='installCSF'),
41+
# path('installStatusCSF', views.installStatusCSF, name='installStatusCSF'),
42+
# path('removeCSF', views.removeCSF, name='removeCSF'),
43+
# path('fetchCSFSettings', views.fetchCSFSettings, name='fetchCSFSettings'),
44+
# path('changeStatus', views.changeStatus, name='changeStatus'),
45+
# path('modifyPorts', views.modifyPorts, name='modifyPorts'),
46+
# path('modifyIPs', views.modifyIPs, name='modifyIPs'),
4747

4848
# Imunify
4949
path('imunify', views.imunify, name='imunify'),

plogical/upgrade.py

Lines changed: 10 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,91 +3895,24 @@ def upgrade(branch):
38953895
except:
38963896
pass
38973897

3898-
#command = 'csf -uf'
3899-
#Upgrade.executioner(command, 'fix csf if there', 0)
3900-
3898+
# Remove CSF if installed and restore firewalld (CSF is being discontinued on August 31, 2025)
39013899
if os.path.exists('/etc/csf'):
3902-
##### Function to backup custom csf files and restore
3903-
3904-
from datetime import datetime
3905-
3906-
# List of files to backup
3907-
FILES = [
3908-
"/etc/csf/csf.allow",
3909-
"/etc/csf/csf.deny",
3910-
"/etc/csf/csf.conf",
3911-
"/etc/csf/csf.ignore",
3912-
"/etc/csf/csf.rignore",
3913-
"/etc/csf/csf.blocklists",
3914-
"/etc/csf/csf.dyndns"
3915-
]
3916-
3917-
# Directory for backups
3918-
BACKUP_DIR = f"/home/cyberpanel/csf_backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
3919-
3920-
# Backup function
3921-
def backup_files():
3922-
os.makedirs(BACKUP_DIR, exist_ok=True)
3923-
for file in FILES:
3924-
if os.path.exists(file):
3925-
shutil.copy(file, BACKUP_DIR)
3926-
print(f"Backed up: {file}")
3927-
else:
3928-
print(f"File not found, skipping: {file}")
3929-
3930-
# Restore function
3931-
def restore_files():
3932-
for file in FILES:
3933-
backup_file = os.path.join(BACKUP_DIR, os.path.basename(file))
3934-
if os.path.exists(backup_file):
3935-
try:
3936-
shutil.copy(backup_file, file)
3937-
print(f"Restored: {file}")
3938-
except Exception as e:
3939-
print(f"Failed to restore {file}: {str(e)}")
3940-
else:
3941-
print(f"Backup not found for: {file}")
3942-
3943-
# Backup the files
3944-
print("Backing up files...")
3945-
backup_files()
3946-
3900+
print("CSF detected - removing CSF and restoring firewalld...")
3901+
print("Note: ConfigServer Firewall (CSF) is being discontinued on August 31, 2025")
3902+
3903+
# Remove CSF and restore firewalld
39473904
execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py"
39483905
execPath = execPath + " removeCSF"
3949-
Upgrade.executioner(execPath, 'Remove CSF before reinstall', 0)
3950-
3951-
execPath = "sudo /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/csf.py"
3952-
execPath = execPath + " installCSF"
3953-
Upgrade.executioner(execPath, 'Install CSF', 0)
3954-
3955-
# Restore the files AFTER installation
3956-
print("Restoring CSF configuration files...")
3957-
restore_files()
3906+
Upgrade.executioner(execPath, 'Remove CSF and restore firewalld', 0)
39583907

3959-
# Restart CSF to apply restored configuration
3960-
command = 'csf -r'
3961-
Upgrade.executioner(command, 'Restart CSF with restored config', 0)
3908+
print("CSF has been removed and firewalld has been restored.")
39623909

39633910

39643911

3912+
# Remove configservercsf directory if it exists
39653913
if os.path.exists('/usr/local/CyberCP/configservercsf'):
3966-
command = 'rm -f /usr/local/CyberCP/configservercsf/signals.py'
3967-
Upgrade.executioner(command, 'remove /usr/local/CyberCP/configservercsf/signals.py', 1)
3968-
3969-
sed_commands = [
3970-
'sed -i "s/url(r\'^configservercsf/path(\'configservercsf/g" /usr/local/CyberCP/CyberCP/urls.py',
3971-
'sed -i "s/from django.conf.urls import url/from django.urls import path/g" /usr/local/CyberCP/configservercsf/urls.py',
3972-
'sed -i "s/import signals/from . import signals/g" /usr/local/CyberCP/configservercsf/apps.py',
3973-
'sed -i "s/url(r\'^$\'/path(\'\'/g" /usr/local/CyberCP/configservercsf/urls.py',
3974-
'sed -i "s|url(r\'^iframe/$\'|path(\'iframe/\'|g" /usr/local/CyberCP/configservercsf/urls.py',
3975-
'sed -i -E "s/from.*, response/from plogical.httpProc import httpProc/g" /usr/local/CyberCP/configservercsf/views.py',
3976-
'find /usr/local/CyberCP -name "*.pyc" -delete',
3977-
'find /usr/local/CyberCP -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true',
3978-
'killall lswsgi'
3979-
]
3980-
3981-
for cmd in sed_commands:
3982-
Upgrade.executioner(cmd, 'fix csf if there', 1)
3914+
command = 'rm -rf /usr/local/CyberCP/configservercsf'
3915+
Upgrade.executioner(command, 'Remove configservercsf directory', 1)
39833916

39843917

39853918

upgrade.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ fi
1616
cd /usr/local/CyberCP && /usr/local/CyberCP/bin/python manage.py collectstatic --no-input
1717
rm -rf /usr/local/CyberCP/public/static/*
1818
cp -R /usr/local/CyberCP/static/* /usr/local/CyberCP/public/static/
19-
mkdir /usr/local/CyberCP/public/static/csf/
19+
# CSF support removed - discontinued on August 31, 2025
20+
# mkdir /usr/local/CyberCP/public/static/csf/
2021
find /usr/local/CyberCP -type d -exec chmod 0755 {} \;
2122
find /usr/local/CyberCP -type f -exec chmod 0644 {} \;
2223
chmod -R 755 /usr/local/CyberCP/bin

0 commit comments

Comments
 (0)