Commit 8cf2af3e authored by qunfeng qiu's avatar qunfeng qiu
Browse files

debug

parent 9c859945
ai-soc gateway
waf-console
docker buildx build --platform linux/amd64,linux/arm64 -t escoffier/waf-console:v0.0.2 -o type=registry -f build/Dockerfilex .
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
ARG TARGETARCH
WORKDIR /app
COPY ./ ./
RUN go env -w GOPROXY='https://goproxy.cn,direct' && GOOS=linux GOARCH=$TARGETARCH go build -a -o ./dist/waf-console ./cmd/
FROM ubuntu:22.04
#FROM alpine
# ARG MIRROR_SOURCE=mirrors.aliyun.com
WORKDIR /
# ADD dist/waf-console /
COPY config/waf_detection_index_template.json /
COPY --from=builder /app/dist/waf-console /waf-console
RUN ls -l /waf-console
CMD ["./waf-console"]
......@@ -249,14 +249,14 @@ func (s *LogConsumerService) Handle(ctx context.Context, message []byte) error {
// WafDetections[i].WafDetectionAttackedLog = WafDetectionMessage.AttackedLog[i]
// WafDetections[i].WafDetectionAttackedLog.ID = id.Str()
// WafDetections[i].CreatedAt = WafDetectionMessage.CreatedAt
wafDetection, err := s.genWafDetection(WafDetectionMessage, WafDetectionMessage.AttackedLog[i])
if err != nil {
log.Err(err).Str("message.Value", string(message)).Msg("gen waf detection fails")
continue
}
// wafDetection, err := s.genWafDetection(WafDetectionMessage, WafDetectionMessage.AttackedLog[i])
// if err != nil {
// log.Err(err).Str("message.Value", string(message)).Msg("gen waf detection fails")
// continue
// }
bulkIndexSignal := es.NewBulkIndexRequest().Index(EsIndexWafDetectionsAlias)
bulkableRequests = append(bulkableRequests, bulkIndexSignal.Id(wafDetection.WafDetectionAttackedLog.ID).Doc(wafDetection))
// bulkIndexSignal := es.NewBulkIndexRequest().Index(EsIndexWafDetectionsAlias)
// bulkableRequests = append(bulkableRequests, bulkIndexSignal.Id(wafDetection.WafDetectionAttackedLog.ID).Doc(wafDetection))
event, err := s.genWafDetectionEvent(WafDetectionMessage, WafDetectionMessage.AttackedLog[i])
if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment