Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
qiuqunfeng
waf-console
Commits
8cf2af3e
Commit
8cf2af3e
authored
Jun 17, 2025
by
qunfeng qiu
Browse files
debug
parent
9c859945
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
README.md
README.md
+3
-1
build/Dockerfilex
build/Dockerfilex
+19
-0
internal/service/log_consumer.go
internal/service/log_consumer.go
+7
-7
No files found.
README.md
View file @
8cf2af3e
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 .
build/Dockerfilex
0 → 100644
View file @
8cf2af3e
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"]
internal/service/log_consumer.go
View file @
8cf2af3e
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment