Archived
v1.4.1
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/counters"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
// CCCheckpoint ${cc.arg}
|
||||
|
||||
@@ -4,14 +4,15 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/counters"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
wafutils "github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// CC2Checkpoint 新的CC
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
func TestCCCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
type Checkpoint struct {
|
||||
|
||||
@@ -2,13 +2,14 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"io"
|
||||
"net/http"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
func TestRequestAllCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestArgParam_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -2,12 +2,13 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
func TestRequestBodyCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RequestCookiesCheckpoint struct {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// RequestFormArgCheckpoint ${requestForm.arg}
|
||||
|
||||
@@ -2,11 +2,12 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestFormArgCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RequestHeaderCheckpoint struct {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RequestHeaderNamesCheckpoint struct {
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
package checkpoints_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/checkpoints"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/checkpoints"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestHeaderNamesCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type RequestHeadersCheckpoint struct {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestHostCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -2,11 +2,12 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
wafutils "github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// RequestJSONArgCheckpoint ${requestJSON.arg}
|
||||
|
||||
@@ -2,10 +2,11 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"io"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestJSONArgCheckpoint_RequestValue_Map(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestPathCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"net"
|
||||
)
|
||||
|
||||
type RequestRawRemoteAddrCheckpoint struct {
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// RequestRefererBlockCheckpoint 防盗链
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package checkpoints_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/checkpoints"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/checkpoints"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestRefererOriginCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"net"
|
||||
)
|
||||
|
||||
type RequestRemotePortCheckpoint struct {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestSchemeCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -2,17 +2,18 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"io"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
var multipartHeaderRegexp = regexp.MustCompile(`(?i)(?:^|\r\n)--+\w+\r\n((([\w-]+: .+)\r\n)+)`)
|
||||
|
||||
@@ -2,11 +2,12 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestRequestUploadCheckpoint_RequestValue(t *testing.T) {
|
||||
|
||||
@@ -2,10 +2,11 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/utils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"io"
|
||||
)
|
||||
|
||||
// ResponseBodyCheckpoint ${responseBody}
|
||||
|
||||
@@ -2,10 +2,11 @@ package checkpoints
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"io"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestResponseBodyCheckpoint_ResponseValue(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestResponseHeaderCheckpoint_ResponseValue(t *testing.T) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
func TestResponseStatusCheckpoint_ResponseValue(t *testing.T) {
|
||||
|
||||
@@ -149,7 +149,7 @@ var AllCheckpoints = []*CheckpointDefinition{
|
||||
{
|
||||
Name: "CNAME",
|
||||
Prefix: "cname",
|
||||
Description: "当前网站服务CNAME,比如38b48e4f.goedge.cn",
|
||||
Description: "当前网站服务CNAME,比如38b48e4f.goedge.cloud",
|
||||
HasParams: false,
|
||||
Instance: new(RequestCNAMECheckpoint),
|
||||
Priority: 100,
|
||||
|
||||
Reference in New Issue
Block a user