8000 rebase fix · yaklang/yaklang@783cd0c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rookie/feat/fingerprint group #9473

Rookie/feat/fingerprint group

Rookie/feat/fingerprint group #9473

Workflow file for this run

name: Essential Tests
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
paths:
- "common/**"
- ".github/workflows/essential-tests.yml"
- "go.mod"
jobs:
setup:
runs-on: ubuntu-22.04
steps:
- name: Cache YakLang Project
uses: actions/cache@v3
id: cache-project
with:
path: |
~/yakit-projects
${{ github.workspace }}
key: go-${{ github.event.pull_request.head.sha }}
- name: Check out code into the Go module directory
if: steps.cache-project.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
id: go
- name: Init Module
run: |
go mod tidy && go work vendor
cp -r $(go env GOPATH)/pkg/mod/$(go list -m github.com/yaklang/pcap | sed 's/ /@/')/libpcap ./vendor/github.com/yaklang/pcap/
tree ./vendor
- name: Init Project
if: steps.cache-project.outputs.cache-hit != 'true'
run: |
go build -x common/yak/cmd/yak.go
./yak --help
test:
name: ${{ matrix.name }}
needs: setup
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: "Test in 2min"
run: |
# these tests are very quick
go test -timeout 20s ./common/jsonextractor
go test -timeout 20s ./common/markdownextractor
go test -timeout 30s ./common/ai/aid/...
go test -timeout 20s ./common/yak/yaklib/codec
go test -timeout 20s ./common/yak/cartesian
go test -timeout 20s ./common/jsonpath
go test -timeout 20s ./common/domainextractor
go test -timeout 1m ./common/utils
go test -timeout 10s ./common/utils/xml2
go test -timeout 20s ./common/utils/tlsutils/...
go test -timeout 10s ./common/utils/linktable/...
go test -timeout 20s ./common/utils/pprofutils/...
go test -timeout 20s -run TestQueryCVEWithFixName ./common/cve
go test -timeout 20s ./common/sca/...
go test -timeout 20s -run TestMUSTPASS_YakitLog ./common/yak/yaklib
go test -timeout 20s -run TestMUSTPASS_Common ./common/yak/yaklib
go test -timeout 1m -run TestMUSTPASS_Fp ./common/yak/yaklib/tools
go test -timeout 30s ./common/openapi/...
go test -timeout 10s ./common/utils/dot/... ./common/utils/filesys/...
go test -timeout 15s ./common/utils/bruteutils/.
go test -timeout 15s ./common/utils/memedit/.
go test -timeout 15s ./common/pcapx/pcaputil/...
go test -timeout 15s ./common/yak/yakurl/...
# yso
go test -timeout 20s ./common/yso/...
go test -timeout 20s ./common/yserx
# totp
go test -timeout 20s ./common/twofa/...
# cybertunnel http trigger
go test ./common/cybertunnel/...
# YAK GIT
go test ./common/utils/yakgit/...
# YAK suspect tools
go test ./common/utils/suspect
go test ./common/javaclassparser/jarwar/...
go test --timeout 1m ./common/bin-parser/...
go test --timeout 1m ./common/yak/antlr4nasl/tests/...
go test --timeout 30s ./common/fp/...
go test --timeout 30s ./common/utils/gzip_embed/test/...
go test --timeout 30s ./common/fp/...
go test --timeout 30s ./common/yak/cmd/...
go test --timeout 30s ./common/javaclassparser/tests/...
- name: Test NetX
run: |
go test -timeout 20s ./common/netx/mustpass
go test -timeout 20s -run TestPingAutoConfig ./common/utils/pingutil
- name: Test Fuzz
run: |
go test -timeout 20s ./common/mutate_tests ./common/fuzztag
go test -timeout 20s ./common/fuzztagx
go test -timeout 30s ./common/mutate
go test -timeout 30s ./common/fuzzx
- name: Test SSA / SSAAPI
run: |
# SSA
go test -timeout 20s ./common/yak/ssa/...
# SSAAPI
go test -timeout 1m ./common/yak/ssaapi
go test -timeout 1m ./common/yak/ssaapi/ssareducer
go test -timeout 1m ./common/yak/ssaapi/test/ssatest
- name: Test StaticAnalyze / BuildIn SyntaxFlow Rule
run: |
# SSA plugin rule/option
go test -timeout 20s ./common/yak/static_analyzer/test/...
# StaticAnalyze
go test -timeout 20s -run TestAnalyzeMustPASS* ./common/coreplugin
# BuildIn SyntaxFlow Rule
go test -timeout 2m ./common/syntaxflow/sfbuildin/...
go test -timeout 1m ./common/yak/ssaapi/test/syntaxflow
- name: Test SSA Frontend Yak / JavaScript
run: |
# yak ssa
go test -timeout 20s ./common/yak/yak2ssa/test/...
go test -timeout 1m ./common/yak/ssaapi/test/yak
# Test js
go test -timeout 60s ./common/yak/JS2ssa/...
go test -timeout 1m ./common/yak/ssaapi/test/javascript
- name: Test SSA Frontend TypeScript
run: |
go test -timeout 1m ./common/yak/typescript/frontend/tests/...
go test -timeout 1m ./common/yak/typescript/js2ssa/tests/...
- name: Test SSA Frontend Java
run: |
go test -timeout 5m ./common/yak/java/...
go test -timeout 3m ./common/yak/ssaapi/test/java
- name: Test SSA Frontend PHP
run: |
go test -timeout 60s ./common/yak/php/...
go test -timeout 2m ./common/yak/ssaapi/test/php
- name: Test SSA Frontend Golang
run: |
go test -timeout 30s ./common/yak/go2ssa/...
go test -timeout 30s ./common/yak/antlr4go/...
go test -timeout 2m ./common/yak/ssaapi/test/golang
- name: Test SyntaxFlow Web Server
run: |
go test -timeout 1m ./common/sfweb/...
- name: Test lowhttp / DNSX
run: |
# lowhttp
go test -timeout 1m -skip "TestComputeDigestResponseFromRequest|TestComputeDigestResponseFromRequestEx|TestLowhttpResponse2" ./common/utils/lowhttp
# DNSX
go test -timeout 20s ./common/facades/...
- name: Test HttpTpl(YakTemplate)
run: go test -timeout 1m ./common/yak/httptpl
- name: Test MustPass - full yak scripts
run: go test -timeout 3m ./common/yak/yaktest/mustpass
- name: Test gRPC MUSTPASS HTTP
run: go test -timeout 5m -run TestGRPCMUSTPASS_HTTP_* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS MITM
run: |
# Test gRPC MUSTPASS MITM
go test -timeout 5m -run TestGRPCMUSTPASS_MITM_* ./common/yakgrpc/...
# Test gRPC MUSTPASS MITM V2
go test -timeout 5m -run TestGRPCMUSTPASS_MITMV2_* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS Fuzzer
run: go test -timeout 5m -run TestGRPCMUSTPASS_HTTPFuzzer* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS Language
run: go test -timeout 5m -run TestGRPCMUSTPASS_LANGUAGE* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS SyntaxFlow
run: go test -timeout 5m -run TestGRPCMUSTPASS_SyntaxFlow* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS COMMON
run: go test -timeout 5m -run TestGRPCMUSTPASS_COMMON* ./common/yakgrpc/...
- name: Test gRPC(LARGE)MUSTPASS
run: go test -timeout 2m -run TestLARGEGRPCMUSTPASS* ./common/yakgrpc/...
- name: Test gRPC MUSTPASS HTTPFlow Analyzer
run: go test -timeout 2m -run TestGRPCMUSTPASS_AnalyzeHTTPFlow* ./common/yakgrpc/...
- name: Test AI Task
run: go test -timeout 1m -run TestAITaskWith ./common/yakgrpc/...
- name: Test gRPC Other
run: go test -v -timeout 6m -skip "^(TestGRPC_Ai_List_Model|TestGRPCMUSTPASS_HTTP_*|TestAITaskWith*|TestGRPCMUSTPASS_MITM_*|TestGRPCMUSTPASS_HTTPFuzzer*|TestGRPCMUSTPASS_LANGUAGE*|TestGRPCMUSTPASS_COMMON*|TestLARGEGRPCMUSTPASS*|TestGRPCMUSTPASS_SyntaxFlow*)" ./common/yakgrpc/...
- name: Test Vulinbox SQL Injection
run: go test -timeout 5m -run TestGRPCMUSTPASS_SQL ./common/coreplugin
- name: Test Integration MITM / SyntaxFlow
run: |
# integration MITM
go test -timeout 2m -run TestGRPCMUSTPASS_MITM ./common/coreplugin
# SyntaxFlow
go test -timeout 20s ./common/syntaxflow/tests
go test -timeout 20s -skip "TestEmbedRuleVersion" ./common/syntaxflow/sfdb/...
go test -timeout 20s ./common/syntaxflow/sfvm/...
- name: Test Vulinbox(XSS/Shiro/SSRF/SSTI/SMUGGLE/CSRF/OPEN_REDIRECT)
run: |
go test -timeout 5m -run "^(TestGRPCMUSTPASS_XSS|TestGRPCMUSTPASS_Shiro|TestGRPCMUSTPASS_SSRF|TestGRPCMUSTPASS_SSTI|TestGRPCMUSTPASS_Smuggle|TestGRPCMUSTPASS_CSRF|TestGRPCMUSTPASS_OPEN_REDIRECT)$" ./common/coreplugin
- name: Test gRPC MUSTPASS-PLUGIN-Fastjson
run: go test -timeout 3m -run TestGRPCMUSTPASS_Fastjson ./common/coreplugin
- name: Test Vulinbox agent client / yso
run: |
# vulinbox agent client
go test -timeout 1m -run TestMUSTPASS* ./common/vulinboxagentclient
- name: Test Suricata Generate && Match / pcapx
run: |
# suricate generate && match
go test -timeout 20s -run TestMUSTPASS* ./common/suricata/...
go test -timeout 20s -run TestMUSTPASS* ./common/chaosmaker
# pcapx
go test -timeout 20s -run TestSmoking_* ./common/pcapx
- name: Test Crawler / Crawlerx (chromium based crawler)
run: |
# crawlerx
go test --timeout 5m ./common/crawlerx/...
# crawler
go test -timeout 20s -run TestMUSTPASS ./common/crawler
- name: Test Other
run: |
# cli
go test --timeout 1m ./common/utils/cli
# mcp
go test --timeout 1m ./common/mcp/yakcliconvert
# doc
go test --timeout 3m ./common/yak/yakdoc/...
# jwt
go test --timeout 1m ./common/authhack/...
steps:
- name: Cache YakLang Project
uses: actions/cache/restore@v3
id: cache-project
with:
path: |
~/yakit-projects
${{ github.workspace }}
key: go-${{ github.event.pull_request.head.sha }}
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
id: go
- name: GRPC
run: |
nohup ./yak grpc > /tmp/grpc.log 2>&1 < /dev/null &
sleep 1
- name: ${{ matrix.name }}
run: |
${{ matrix.run }}
- name: Upload failure grpc log
if: failure()
uses: actions/upload-artifact@v4
with:
name: grpc.log
path: /tmp/grpc.log
0