mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-05 11:50:50 +01:00
396 lines
22 KiB
HTML
Executable File
396 lines
22 KiB
HTML
Executable File
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "ModSecurity - CyberPanel" %}{% endblock %}
|
|
{% block content %}
|
|
|
|
{% load static %}
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
|
|
|
{% if OLS %}
|
|
|
|
<div class="container">
|
|
<div id="page-title">
|
|
<h2>{% trans "ModSecurity Configurations!" %} - <a target="_blank"
|
|
href="https://community.cyberpanel.net/t/2-mod-security-configurations/135"
|
|
style="height: 23px;line-height: 21px;"
|
|
class="btn btn-border btn-alt border-red btn-link font-red"
|
|
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
|
</h2>
|
|
<p>{% trans "On this page you can configure ModSecurity settings." %}</p>
|
|
</div>
|
|
|
|
<div ng-controller="modSec" class="example-box-wrapper">
|
|
<div class="panel panel-body">
|
|
<h3 class="content-box-header">
|
|
{% trans "ModSecurity" %} <img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
|
</h3>
|
|
<div class="content-box-wrapper">
|
|
<div class="row">
|
|
{% if modSecInstalled == 0 %}
|
|
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
|
|
<h4 class="mb-10">{% trans "ModSecurity is not installed " %}
|
|
</h4>
|
|
<button ng-click="installModSec()" class="btn btn-alt btn-hover btn-blue-alt">
|
|
<span>{% trans "Install Now." %}</span>
|
|
<i class="glyph-icon icon-arrow-right"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<!------ ModeSec Install Log box ----------------->
|
|
|
|
<div ng-hide="modSecNotifyBox" class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-6">
|
|
|
|
<div ng-hide="failedToStartInallation" class="alert alert-danger">
|
|
<p>{% trans "Failed to start installation, Error message: " %} {$
|
|
errorMessage
|
|
$}</p>
|
|
</div>
|
|
|
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
|
</div>
|
|
|
|
<div ng-hide="installationFailed" class="alert alert-danger">
|
|
<p>{% trans "Installation failed." %} {$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-hide="modSecSuccessfullyInstalled" class="alert alert-success">
|
|
<p>{% trans "ModSecurity successfully installed, refreshing page in 3 seconds.." %}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div ng-hide="modeSecInstallBox" class="col-md-12">
|
|
|
|
<form action="/" id="" class="form-horizontal bordered-row">
|
|
<div class="form-group">
|
|
<div class="col-sm-12 text-center">
|
|
<h3><img
|
|
src="{% static 'firewall/icons/firewall.png' %}"> {% trans "Winter is coming, but so is ModSecurity." %}
|
|
<img ng-hide="modsecLoading" src="/static/images/loading.gif"></h3>
|
|
</div>
|
|
<div style="margin-top: 2%;" class="col-sm-12">
|
|
<textarea ng-model="requestData" rows="15"
|
|
class="form-control">{{ requestData }}</textarea>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<!----- ModeSec Install Log box ----------------->
|
|
{% else %}
|
|
|
|
<div style="padding: 2%" class="col-md-12">
|
|
<form action="/" id="createPackages" class="form-horizontal bordered-row">
|
|
|
|
<div ng-hide="phpDetailsBox" class="form-group">
|
|
<label class="col-sm-4 control-label">ModSecurity Status</label>
|
|
<div class="col-sm-6">
|
|
<input type="checkbox" id="modsecurity_status" data-toggle="toggle">
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-hide="phpDetailsBox" class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditEngine</label>
|
|
<div class="col-sm-6">
|
|
<input type="checkbox" id="SecAuditEngine" data-toggle="toggle">
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-hide="phpDetailsBox" class="form-group">
|
|
<label class="col-sm-4 control-label">SecRuleEngine</label>
|
|
<div class="col-sm-6">
|
|
<input type="checkbox" id="SecRuleEngine" data-toggle="toggle">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecDebugLogLevel</label>
|
|
<div class="col-sm-6">
|
|
<div class="selector" style="width: 79px;"><span
|
|
style="width: 57px; -moz-user-select: none;">{$ SecDebugLogLevel $}</span><select
|
|
ng-model="SecDebugLogLevel" class="custom-select">
|
|
<option>0</option>
|
|
<option>1</option>
|
|
<option>2</option>
|
|
<option>3</option>
|
|
<option>4</option>
|
|
<option>5</option>
|
|
<option>6</option>
|
|
<option>7</option>
|
|
<option>8</option>
|
|
<option>9</option>
|
|
</select><i class="glyph-icon icon-caret-down"></i></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogParts</label>
|
|
<div class="col-sm-6">
|
|
<input placeholder="ABIJDEFHZ" type="text" class="form-control"
|
|
ng-model="SecAuditLogParts" required>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogRelevantStatus</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control"
|
|
ng-model="SecAuditLogRelevantStatus"
|
|
required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogType</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control" ng-model="SecAuditLogType"
|
|
required>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-4">
|
|
<button type="button" ng-click="saveModSecConfigurations()"
|
|
class="btn btn-primary btn-lg btn-block">{% trans "Save changes." %}</button>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-4">
|
|
|
|
<div ng-hide="failedToSave" class="alert alert-danger">
|
|
<p>{% trans "Failed to save ModSecurity configurations. Error message: " %}
|
|
{$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-hide="successfullySaved" class="alert alert-success">
|
|
<p>{% trans "ModSecurity configurations successfully saved." %}</p>
|
|
</div>
|
|
|
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="container">
|
|
<div id="page-title">
|
|
<h2>{% trans "ModSecurity Configurations!" %} - <a target="_blank"
|
|
href="https://community.cyberpanel.net/t/4-mod-security-rules-packages/133"
|
|
style="height: 23px;line-height: 21px;"
|
|
class="btn btn-border btn-alt border-red btn-link font-red"
|
|
title=""><span>{% trans "ModSec Docs" %}</span></a>
|
|
</h2>
|
|
<p>{% trans "On this page you can configure ModSecurity settings." %}</p>
|
|
</div>
|
|
|
|
<div ng-controller="modSec" class="example-box-wrapper">
|
|
<div style="border-radius: 25px;border-color:#3498db" class="content-box">
|
|
<h3 class="content-box-header bg-blue">
|
|
{% trans "ModSecurity" %} <img ng-hide="modsecLoading" src="/static/images/loading.gif">
|
|
</h3>
|
|
|
|
<div class="content-box-wrapper">
|
|
<div class="row">
|
|
|
|
{% if modSecInstalled == 0 %}
|
|
|
|
<div class="col-md-12 text-center" style="margin-bottom: 2%;">
|
|
<h3>{% trans "ModSecurity is not installed " %}
|
|
<button ng-click="installModSec()" class="btn btn-alt btn-hover btn-blue-alt">
|
|
<span>{% trans "Install Now." %}</span>
|
|
<i class="glyph-icon icon-arrow-right"></i>
|
|
</button>
|
|
</h3>
|
|
</div>
|
|
|
|
<!------ ModeSec Install Log box ----------------->
|
|
|
|
<div ng-hide="modSecNotifyBox" class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-6">
|
|
|
|
<div ng-hide="failedToStartInallation" class="alert alert-danger">
|
|
<p>{% trans "Failed to start installation, Error message: " %} {$
|
|
errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
|
</div>
|
|
|
|
<div ng-hide="installationFailed" class="alert alert-danger">
|
|
<p>{% trans "Installation failed." %} {$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-hide="modSecSuccessfullyInstalled" class="alert alert-success">
|
|
<p>{% trans "ModSecurity successfully installed, refreshing page in 3 seconds.." %}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div ng-hide="modeSecInstallBox" class="col-md-12">
|
|
|
|
<form action="/" id="" class="form-horizontal bordered-row">
|
|
<div class="form-group">
|
|
<div class="col-sm-12 text-center">
|
|
<h3><img
|
|
src="{% static 'firewall/icons/firewall.png' %}"> {% trans "Winter is coming, but so is ModSecurity." %}
|
|
<img ng-hide="modsecLoading" src="/static/images/loading.gif"></h3>
|
|
</div>
|
|
<div style="margin-top: 2%;" class="col-sm-12">
|
|
<textarea ng-model="requestData" rows="15"
|
|
class="form-control">{{ requestData }}</textarea>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<!----- ModeSec Install Log box ----------------->
|
|
{% else %}
|
|
|
|
<div style="padding: 2%" class="col-md-12">
|
|
<form action="/" id="createPackages" class="form-horizontal bordered-row">
|
|
|
|
<div ng-hide="phpDetailsBox" class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditEngine</label>
|
|
<div class="col-sm-6">
|
|
<input type="checkbox" id="SecAuditEngine" data-toggle="toggle">
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-hide="phpDetailsBox" class="form-group">
|
|
<label class="col-sm-4 control-label">SecRuleEngine</label>
|
|
<div class="col-sm-6">
|
|
<input type="checkbox" id="SecRuleEngine" data-toggle="toggle">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecDebugLogLevel</label>
|
|
<div class="col-sm-6">
|
|
<div class="selector" style="width: 79px;"><span
|
|
style="width: 57px; -moz-user-select: none;">{$ SecDebugLogLevel $}</span><select
|
|
ng-model="SecDebugLogLevel" class="custom-select">
|
|
<option>0</option>
|
|
<option>1</option>
|
|
<option>2</option>
|
|
<option>3</option>
|
|
<option>4</option>
|
|
<option>5</option>
|
|
<option>6</option>
|
|
<option>7</option>
|
|
<option>8</option>
|
|
<option>9</option>
|
|
</select><i class="glyph-icon icon-caret-down"></i></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogParts</label>
|
|
<div class="col-sm-6">
|
|
<input placeholder="ABIJDEFHZ" type="text" class="form-control"
|
|
ng-model="SecAuditLogParts" required>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogRelevantStatus</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control"
|
|
ng-model="SecAuditLogRelevantStatus" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">SecAuditLogType</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control" ng-model="SecAuditLogType"
|
|
required>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-4">
|
|
<button type="button" ng-click="saveModSecConfigurations()"
|
|
class="btn btn-primary btn-lg btn-block">{% trans "Save changes." %}</button>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label"></label>
|
|
<div class="col-sm-4">
|
|
|
|
<div ng-hide="failedToSave" class="alert alert-danger">
|
|
<p>{% trans "Failed to save ModSecurity configurations. Error message: " %}
|
|
{$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<div ng-hide="successfullySaved" class="alert alert-success">
|
|
<p>{% trans "ModSecurity configurations successfully saved." %}</p>
|
|
</div>
|
|
|
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
<p>{% trans "Could not connect. Please refresh this page." %} </p>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
{% endblock %}
|