Skip to content

Commit

Permalink
Merge pull request #3 from jx-sec/jxwaf4
Browse files Browse the repository at this point in the history
Jxwaf4 Release
  • Loading branch information
jx-sec authored May 19, 2024
2 parents 78e1540 + 416ac36 commit d1a9053
Show file tree
Hide file tree
Showing 2,278 changed files with 8,385 additions and 17,207 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM python:2.7-stretch

WORKDIR /app
COPY . .

RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r requirements.txt


EXPOSE 8000

ENV HTTP=0.0.0.0:8000 \
CHDIR=/app \
WSGI_FILE=jxwaf_base_server/wsgi.py \
STATIC_MAP=/static=/app/static \
PROCESSES=4 \
THREADS=2

ENTRYPOINT uwsgi \
--http $HTTP \
--chdir $CHDIR \
--wsgi-file $WSGI_FILE \
--static-map $STATIC_MAP \
--processes $PROCESSES \
--threads $THREADS \
--logto /app/app.log \
--log-format '%(addr) - %(user) [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) %(micros)ms' \
--enable-threads \
--thunder-lock \
--die-on-term \
--log-5xx \
--log-4xx \
--log-master
339 changes: 0 additions & 339 deletions LICENSE

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
文档: https://github.com/jx-sec/jxwaf

# jxwaf_base_server
Binary file added cc_js.zip
Binary file not shown.
Binary file added db.sqlite3
Binary file not shown.
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
yum install -y epel-release gcc make mysql mysql-devel python-devel
yum install -y python-pip
pip install setuptools==30.1.0
yum install -y epel-release
yum install -y python-pip
pip install -r requirements.txt
12 changes: 0 additions & 12 deletions install_jxwaf_server.sh

This file was deleted.

File renamed without changes.
26 changes: 14 additions & 12 deletions jxwaf_min_server/settings.py → jxwaf_base_server/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for jxwaf_min_server project.
Django settings for jxwaf_base_server project.
Generated by 'django-admin startproject' using Django 1.9.2.
Expand All @@ -15,21 +15,22 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'yi538!me3^x)^n#v1l6^mim+hp=m$5wd89d-p!(-23ge65=ry%'
SECRET_KEY = 't=6$=($epu4_hu+%h-d_0pduds_7))!2kq#)jp)$bs7n29dbdb'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False

ALLOWED_HOSTS = ['*']

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
#'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
Expand All @@ -42,14 +43,15 @@
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
#'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'jxwaf_min_server.urls'
ROOT_URLCONF = 'jxwaf_base_server.urls'


TEMPLATES = [
{
Expand All @@ -68,7 +70,8 @@
},
]

WSGI_APPLICATION = 'jxwaf_min_server.wsgi.application'
WSGI_APPLICATION = 'jxwaf_base_server.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
Expand All @@ -81,7 +84,6 @@
}



# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

Expand All @@ -100,6 +102,7 @@
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

Expand All @@ -109,10 +112,9 @@

TIME_ZONE = 'Asia/Shanghai'


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_ROOT = "static/"
STATIC_URL = '/static/'

JXWAF_SYS_VERSION = '20220831'
193 changes: 193 additions & 0 deletions jxwaf_base_server/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
"""jxwaf_base_server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from server.waf_update import *
from server.jxwaf_user import *
from server.waf_name_list import *
from server.waf_name_list_item import *
from server.waf_base_component import *
from server.waf_analysis_component import *
from server.waf_domain import *
from server.waf_protection import *
from server.waf_web_engine_protection import *
from server.waf_web_rule_protection import *
from server.waf_web_white_rule import *
from server.waf_flow_engine_protection import *
from server.waf_flow_rule_protection import *
from server.waf_flow_white_rule import *
from server.waf_flow_ip_region_block import *
from server.waf_ssl_manage import *
from server.waf_node_monitor import *
from server.sys_conf import *
from server.soc_log_query import *
from server.soc_web_report import *
from server.soc_flow_report import *
from server.soc_attack_event import *
from server.soc_request_statistics import *

urlpatterns = [
# url(r'^admin/', admin.site.urls),
url(r'^$', index),
url(r'^waf_update$', waf_update),
url(r'^waf_monitor$', waf_monitor),
url(r'^ip_check$', ip_check),
url(r'^waf_name_list_item_update$', waf_name_list_item_update),
url(r'^index\.html$', index),
url(r'^login\.html$', login_html),
url(r'^account_regist$', account_regist),
url(r'^login$', login),
url(r'^captcha$', captcha),
url(r'^logout$', logout),
url(r'^account_init_check$', account_init_check),
url(r'^waf_sys_conf_log_and_report_init$', waf_sys_conf_log_and_report_init),
url(r'^waf/waf_get_domain_list$', waf_get_domain_list),
url(r'^waf/waf_del_domain$', waf_del_domain),
url(r'^waf/waf_create_domain$', waf_create_domain),
url(r'^waf/waf_edit_domain$', waf_edit_domain),
url(r'^waf/waf_get_domain$', waf_get_domain),
url(r'^waf/waf_get_domain_search_list$', waf_get_domain_search_list),
url(r'^waf/waf_get_ssl_manage_list$', waf_get_ssl_manage_list),
url(r'^waf/waf_get_ssl_manage$', waf_get_ssl_manage),
url(r'^waf/waf_del_ssl_manage$', waf_del_ssl_manage),
url(r'^waf/waf_edit_ssl_manage$', waf_edit_ssl_manage),
url(r'^waf/waf_create_ssl_manage$', waf_create_ssl_manage),
url(r'^waf/waf_edit_protection$', waf_edit_protection),
url(r'^waf/waf_get_protection$', waf_get_protection),
url(r'^waf/waf_edit_web_engine_protection$', waf_edit_web_engine_protection),
url(r'^waf/waf_get_web_engine_protection$', waf_get_web_engine_protection),

url(r'^waf/waf_get_web_rule_protection_list$', waf_get_web_rule_protection_list),
url(r'^waf/waf_del_web_rule_protection$', waf_del_web_rule_protection),
url(r'^waf/waf_edit_web_rule_protection_status$', waf_edit_web_rule_protection_status),
url(r'^waf/waf_edit_web_rule_protection$', waf_edit_web_rule_protection),
url(r'^waf/waf_get_web_rule_protection$', waf_get_web_rule_protection),
url(r'^waf/waf_create_web_rule_protection$', waf_create_web_rule_protection),
url(r'^waf/waf_exchange_web_rule_protection_priority$', waf_exchange_web_rule_protection_priority),
url(r'^waf/waf_load_web_rule_protection$', waf_load_web_rule_protection),
url(r'^waf/waf_backup_web_rule_protection$', waf_backup_web_rule_protection),

url(r'^waf/waf_get_web_white_rule_list$', waf_get_web_white_rule_list),
url(r'^waf/waf_del_web_white_rule$', waf_del_web_white_rule),
url(r'^waf/waf_edit_web_white_rule_status$', waf_edit_web_white_rule_status),
url(r'^waf/waf_edit_web_white_rule$', waf_edit_web_white_rule),
url(r'^waf/waf_get_web_white_rule$', waf_get_web_white_rule),
url(r'^waf/waf_create_web_white_rule$', waf_create_web_white_rule),
url(r'^waf/waf_exchange_web_white_rule_priority$', waf_exchange_web_white_rule_priority),
url(r'^waf/waf_load_web_white_rule$', waf_load_web_white_rule),
url(r'^waf/waf_backup_web_white_rule$', waf_backup_web_white_rule),

url(r'^waf/waf_edit_flow_engine_protection$', waf_edit_flow_engine_protection),
url(r'^waf/waf_get_flow_engine_protection$', waf_get_flow_engine_protection),

url(r'^waf/waf_get_flow_rule_protection_list$', waf_get_flow_rule_protection_list),
url(r'^waf/waf_del_flow_rule_protection$', waf_del_flow_rule_protection),
url(r'^waf/waf_edit_flow_rule_protection_status$', waf_edit_flow_rule_protection_status),
url(r'^waf/waf_edit_flow_rule_protection$', waf_edit_flow_rule_protection),
url(r'^waf/waf_get_flow_rule_protection$', waf_get_flow_rule_protection),
url(r'^waf/waf_create_flow_rule_protection$', waf_create_flow_rule_protection),
url(r'^waf/waf_exchange_flow_rule_protection_priority$', waf_exchange_flow_rule_protection_priority),
url(r'^waf/waf_load_flow_rule_protection$', waf_load_flow_rule_protection),
url(r'^waf/waf_backup_flow_rule_protection$', waf_backup_flow_rule_protection),

url(r'^waf/waf_get_flow_white_rule_list$', waf_get_flow_white_rule_list),
url(r'^waf/waf_del_flow_white_rule$', waf_del_flow_white_rule),
url(r'^waf/waf_edit_flow_white_rule_status$', waf_edit_flow_white_rule_status),
url(r'^waf/waf_edit_flow_white_rule$', waf_edit_flow_white_rule),
url(r'^waf/waf_get_flow_white_rule$', waf_get_flow_white_rule),
url(r'^waf/waf_create_flow_white_rule$', waf_create_flow_white_rule),
url(r'^waf/waf_exchange_flow_white_rule_priority$', waf_exchange_flow_white_rule_priority),
url(r'^waf/waf_load_flow_white_rule$', waf_load_flow_white_rule),
url(r'^waf/waf_backup_flow_white_rule$', waf_backup_flow_white_rule),

url(r'^waf/waf_edit_flow_ip_region_block$', waf_edit_flow_ip_region_block),
url(r'^waf/waf_get_flow_ip_region_block$', waf_get_flow_ip_region_block),

url(r'^waf/waf_get_name_list_list$', waf_get_name_list_list),
url(r'^waf/waf_get_name_list$', waf_get_name_list),
url(r'^waf/waf_del_name_list$', waf_del_name_list),
url(r'^waf/waf_edit_name_list$', waf_edit_name_list),
url(r'^waf/waf_edit_name_list_status$', waf_edit_name_list_status),
url(r'^waf/waf_create_name_list$', waf_create_name_list),
url(r'^waf/waf_exchange_name_list_priority$', waf_exchange_name_list_priority),

url(r'^waf/waf_get_name_list_item_list$', waf_get_name_list_item_list),
url(r'^waf/waf_del_name_list_item$', waf_del_name_list_item),
url(r'^waf/waf_create_name_list_item$', waf_create_name_list_item),
url(r'^waf/waf_search_name_list_item$', waf_search_name_list_item),

url(r'^waf/waf_get_base_component_list$', waf_get_base_component_list),
url(r'^waf/waf_get_base_component$', waf_get_base_component),
url(r'^waf/waf_del_base_component$', waf_del_base_component),
url(r'^waf/waf_edit_base_component$', waf_edit_base_component),
url(r'^waf/waf_edit_base_component_status$', waf_edit_base_component_status),
url(r'^waf/waf_create_base_component$', waf_create_base_component),
url(r'^waf/waf_exchange_base_component_priority$', waf_exchange_base_component_priority),

url(r'^waf/waf_get_analysis_component_list$', waf_get_analysis_component_list),
url(r'^waf/waf_get_analysis_component$', waf_get_analysis_component),
url(r'^waf/waf_del_analysis_component$', waf_del_analysis_component),
url(r'^waf/waf_edit_analysis_component$', waf_edit_analysis_component),
url(r'^waf/waf_edit_analysis_component_status$', waf_edit_analysis_component_status),
url(r'^waf/waf_create_analysis_component$', waf_create_analysis_component),
url(r'^waf/waf_exchange_analysis_component_priority$', waf_exchange_analysis_component_priority),

url(r'^waf/waf_get_node_monitor_list$', waf_get_node_monitor_list),
url(r'^waf/waf_del_node_monitor$', waf_del_node_monitor),

url(r'^waf/waf_edit_sys_log_conf$', waf_edit_sys_log_conf),
url(r'^waf/waf_get_sys_log_conf$', waf_get_sys_log_conf),
url(r'^waf/waf_edit_sys_report_conf_conf$', waf_edit_sys_report_conf_conf),
url(r'^waf/waf_get_sys_report_conf_conf$', waf_get_sys_report_conf_conf),
url(r'^waf/waf_edit_sys_custom_deny_page_conf$', waf_edit_sys_custom_deny_page_conf),
url(r'^waf/waf_get_sys_custom_deny_page_conf$', waf_get_sys_custom_deny_page_conf),
url(r'^waf/waf_get_waf_auth$', waf_get_waf_auth),
url(r'^waf/waf_edit_waf_auth$', waf_edit_waf_auth),
url(r'^waf/waf_conf_backup$', waf_conf_backup),
url(r'^waf/waf_conf_load$', waf_conf_load),

url(r'^soc/soc_query_log$', soc_query_log),
url(r'^soc/soc_query_log_all$', soc_query_log_all),
url(r'^soc/soc_web_report_attack_count_total$', soc_web_report_attack_count_total),
url(r'^soc/soc_web_report_attack_api_count_total$', soc_web_report_attack_api_count_total),
url(r'^soc/soc_web_report_attack_ip_count_total$', soc_web_report_attack_ip_count_total),
url(r'^soc/soc_web_report_attack_isocode_count_total$', soc_web_report_attack_isocode_count_total),
url(r'^soc/soc_web_report_attack_geoip$', soc_web_report_attack_geoip),
url(r'^soc/soc_web_report_attack_count_trend$', soc_web_report_attack_count_trend),
url(r'^soc/soc_web_report_attack_api_top$', soc_web_report_attack_api_top),
url(r'^soc/soc_web_report_attack_type_top$', soc_web_report_attack_type_top),
url(r'^soc/soc_web_report_attack_ip_top$', soc_web_report_attack_ip_top),
url(r'^soc/soc_web_report_attack_isocode_top$', soc_web_report_attack_isocode_top),

url(r'^soc/soc_flow_report_attack_count_total$', soc_flow_report_attack_count_total),
url(r'^soc/soc_flow_report_attack_api_count_total$', soc_flow_report_attack_api_count_total),
url(r'^soc/soc_flow_report_attack_ip_count_total$', soc_flow_report_attack_ip_count_total),
url(r'^soc/soc_flow_report_attack_isocode_count_total$', soc_flow_report_attack_isocode_count_total),
url(r'^soc/soc_flow_report_attack_geoip$', soc_flow_report_attack_geoip),
url(r'^soc/soc_flow_report_attack_count_trend$', soc_flow_report_attack_count_trend),
url(r'^soc/soc_flow_report_attack_api_top$', soc_flow_report_attack_api_top),
url(r'^soc/soc_flow_report_attack_type_top$', soc_flow_report_attack_type_top),
url(r'^soc/soc_flow_report_attack_ip_top$', soc_flow_report_attack_ip_top),
url(r'^soc/soc_flow_report_attack_isocode_top$', soc_flow_report_attack_isocode_top),

url(r'^soc/soc_attack_event_get_list$', soc_attack_event_get_list),
url(r'^soc/soc_attack_event_get_behave_track$', soc_attack_event_get_behave_track),
url(r'^soc/soc_attack_event_get_all_log_list$', soc_attack_event_get_all_log_list),
url(r'^soc/soc_attack_event_get_all_log_behave_track$', soc_attack_event_get_all_log_behave_track),

url(r'^soc/soc_query_request_statistics$', soc_query_request_statistics),
url(r'^soc/soc_query_request_statistics_detail$', soc_query_request_statistics_detail),
url(r'^demo_env_init$', demo_env_init),
]
16 changes: 16 additions & 0 deletions jxwaf_base_server/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for jxwaf_base_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jxwaf_base_server.settings")

application = get_wsgi_application()
Binary file removed jxwaf_min_server/__init__.pyc
Binary file not shown.
Binary file removed jxwaf_min_server/settings.pyc
Binary file not shown.
Loading

0 comments on commit d1a9053

Please sign in to comment.