Skip to content

Commit

Permalink
1.2.9 add WAF export and import merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyale committed Apr 3, 2022
2 parents d629473 + a3c141e commit 6a58e41
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
// IsPrimary i.e. Is Primary Node
IsPrimary bool
// Version of JANUSEC
Version = "1.2.8"
Version = "1.2.9"
// NodeKey share with all nodes
NodeKey []byte
)
Expand Down
7 changes: 1 addition & 6 deletions firewall/cc.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,10 @@ func GetCCPolicyRespByAppID(appID int64) (*models.CCPolicy, error) {

// IsCCAttack to judge a request is CC attack, return IsCC, CCPolicy, ClientID, NeedLog
func IsCCAttack(r *http.Request, app *models.Application, srcIP string) (bool, *models.CCPolicy, string, bool) {
isCC := false
ccPolicy := GetCCPolicyByAppID(app.ID)
if !ccPolicy.IsEnabled {
if !ccPolicy.IsEnabled || ccPolicy.Action == models.Action_Pass_400 {
return false, nil, "", false
}
if isCC {
clientID := data.SHA256Hash(srcIP)
return isCC, ccPolicy, clientID, false
}
ccAppID := app.ID
if ccPolicy.AppID == 0 {
ccAppID = 0 // Important: stat within general policy
Expand Down
2 changes: 1 addition & 1 deletion firewall/group_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func InitGroupPolicy() {
}

// GetGroupPolicies ...
func GetGroupPolicies(appID int64) ([]*models.GroupPolicy, error) {
func GetGroupPolicies() ([]*models.GroupPolicy, error) {
return groupPolicies, nil
}

Expand Down
6 changes: 2 additions & 4 deletions gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ func AdminAPIHandlerFunc(w http.ResponseWriter, r *http.Request) {
obj = nil
err = firewall.UpdateCCPolicy(param, clientIP, authUser)
case "get_group_policies":
appID := int64(param["id"].(float64))
obj, err = firewall.GetGroupPolicies(appID)
obj, err = firewall.GetGroupPolicies()
case "get_group_policy":
id := int64(param["id"].(float64))
obj, err = firewall.GetGroupPolicyByID(id)
Expand Down Expand Up @@ -296,8 +295,7 @@ func ReplicaAPIHandlerFunc(w http.ResponseWriter, r *http.Request) {
case "get_cc_policies":
obj, err = firewall.GetCCPolicies()
case "get_group_policies":
appID := int64(param["id"].(float64))
obj, err = firewall.GetGroupPolicies(appID)
obj, err = firewall.GetGroupPolicies()
case "get_ip_policies":
obj, err = firewall.GetIPPolicies()
case "get_vuln_types":
Expand Down
2 changes: 2 additions & 0 deletions gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func ReverseHandlerFunc(w http.ResponseWriter, r *http.Request) {
captchaURL := CaptchaEntrance + "?id=" + hitInfo.ClientID
http.Redirect(w, r, captchaURL, http.StatusFound)
return
default:
// models.Action_Pass_400 do nothing
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion release_batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ printf "Creating installation package\n"
printf "Checklist:\n"
printf "* Angular Admin Version Check. \n"
printf "* Janusec Version Check. \n"
version="1.2.8"
version="1.2.9"
printf "Version: ${version} \n"

read -r -p "Are You Sure? [Y/n] " option
Expand Down
2 changes: 1 addition & 1 deletion static/janusec-admin/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ zone.js
MIT
The MIT License

Copyright (c) 2010-2019 Google LLC. http://angular.io/license
Copyright (c) 2010-2020 Google LLC. http://angular.io/license

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion static/janusec-admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<link rel="stylesheet" href="/janusec-admin/styles.50eb2ccb7b9839eeeaea.css"></head>
<body>
<app-root></app-root>
<script src="/janusec-admin/runtime-es2015.871528d607deca2f7955.js" type="module"></script><script src="/janusec-admin/runtime-es5.871528d607deca2f7955.js" nomodule defer></script><script src="/janusec-admin/polyfills-es5.03b1d40a72dcdd5e459a.js" nomodule defer></script><script src="/janusec-admin/polyfills-es2015.7eb699264b8bb7fe3b46.js" type="module"></script><script src="/janusec-admin/main-es2015.33d3acb63a31942dbc62.js" type="module"></script><script src="/janusec-admin/main-es5.33d3acb63a31942dbc62.js" nomodule defer></script></body>
<script src="/janusec-admin/runtime-es2015.871528d607deca2f7955.js" type="module"></script><script src="/janusec-admin/runtime-es5.871528d607deca2f7955.js" nomodule defer></script><script src="/janusec-admin/polyfills-es5.debc6be9caecaca97982.js" nomodule defer></script><script src="/janusec-admin/polyfills-es2015.bd842007a68ebff28848.js" type="module"></script><script src="/janusec-admin/main-es2015.e9234abd6e9465c3c98f.js" type="module"></script><script src="/janusec-admin/main-es5.e9234abd6e9465c3c98f.js" nomodule defer></script></body>
</html>

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion static/janusec-admin/main-es5.33d3acb63a31942dbc62.js

This file was deleted.

1 change: 1 addition & 0 deletions static/janusec-admin/main-es5.e9234abd6e9465c3c98f.js

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 6a58e41

Please sign in to comment.