Skip to content

syntaxflow: new typical grammar for config recursiving #4197

syntaxflow: new typical grammar for config recursiving

syntaxflow: new typical grammar for config recursiving #4197

Workflow file for this run

name: Essential Tests
on:
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]
paths:
- "common/**"
- ".github/workflows/essential-tests.yml"
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- name: Cache YakLang Project
uses: actions/cache@v3
id: cache-project
with:
path: |
~/yakit-projects
${{ github.workspace }}
key: go-${{ github.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: Dependence
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpcap-dev
version: 1.9.1-3
- name: Init Module
run: |
go mod tidy
- name: Init Project
if: steps.cache-project.outputs.cache-hit != 'true'
run: |
go build common/yak/cmd/yak.go
./yak --help
test:
name: ${{ matrix.name }}
needs: setup
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- name: Test JSONExtractor / Codec / Cartesian / JsonPath / Domain Extractor / TLS / CVE / SCA / OpenAPI / YAKURL
run: |
# these tests are very quick
go test -timeout 20s ./common/jsonextractor
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 20s ./common/utils/tlsutils/...
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 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 -run TestHTTPTrigger ./common/cybertunnel/...
- name: Test NetX
run: |
go test -timeout 20s ./common/netx/mustpass
go test -timeout 20s -run TestPingAutoConfig ./common/utils/pingutil
- name: Test FuzzTag
run: |
go test -timeout 20s ./common/mutate_tests ./common/fuzztag
go test -timeout 20s ./common/fuzztagx
go test -timeout 10s -run TestFuzzNucleiVar ./common/mutate
go test -timeout 20s -run 'Test(New)?FuzzHTTPRequest' ./common/mutate
- name: Test SSA / SSARule / StaticAnalyze
run: |
# SSA
go test -timeout 20s ./common/yak/ssaapi/...
# SSA plugin rule/option
go test -timeout 20s ./common/yak/static_analyzer/test/...
# StaticAnalyze
go test -timeout 20s -run TestAnalyzeMustPASS* ./common/coreplugin
# SSA UTIL
go test -timeout 20s ./common/yak/ssa/...
# yak ssa
go test -timeout 20s ./common/yak/yak2ssa/test/...
- name: Test (Java/PHP/JS/Go) Frontend Language
run: |
# Test Java Syntax
go test -timeout 10s ./common/yak/java/...
# Test php syntax
go test -timeout 10s ./common/yak/php/...
go test -timeout 60s ./common/yak/JS2ssa/...
- name: Test lowhttp / DNSX
run: |
# lowhttp
go test -timeout 1m ./common/utils/lowhttp
# DNSX
go test -timeout 20s -skip "TestNewDNSServer|TestPortListener" ./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: go test -timeout 5m -run TestGRPCMUSTPASS_MITM_* ./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 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 Other
run: go test -timeout 5m -skip "^(TestGRPCMUSTPASS_HTTP_|TestGRPCMUSTPASS_MITM_|TestGRPCMUSTPASS_HTTPFuzzer|TestGRPCMUSTPASS_LANGUAGE|TestGRPCMUSTPASS_COMMON|TestLARGEGRPCMUSTPASS)" ./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
- name: Test Vulinbox(XSS/Shiro/SSTI/SMUGGLE/CSRF/OPEN_REDIRECT)
run: |
go test -timeout 5m -run "^(TestGRPCMUSTPASS_XSS|TestGRPCMUSTPASS_Shiro|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_ICMP ./common/pcapx
go test -timeout 20s -run TestSmoking_TCP ./common/pcapx
go test -timeout 20s -run TestSmoking_UDP ./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
- name: Test BinParser
run: |
# binary parser
go test --timeout 1m ./common/bin-parser/...
steps:
- name: Cache YakLang Project
uses: actions/cache/restore@v3
id: cache-project
with:
path: |
~/yakit-projects
${{ github.workspace }}
key: go-${{ github.sha }}
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version-file: "./go.mod"
id: go
- name: Dependence
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpcap-dev
version: 1.9.1-3
- name: GRPC
run: |
nohup ./yak grpc &
sleep 1
- name: ${{ matrix.name }}
run: |
${{ matrix.run }}