Replies: 1 comment
-
Hi @jumppppp, take a look at the details of SecAuditLogParts. Based on your code I see that you are using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
这是我的代码:
(this is my code)
`package main
import (
"fmt"
"log"
"net/http"
)
func main() {
}
这是我的规则: (this is my rules)
SecRuleEngine OnSecRequestBodyAccess On
SecResponseBodyAccess On
SecAuditEngine On
SecAuditLogParts ABIJDEFHZ
SecAuditLogFormat JSON
SecAuditLog ./audit.json
添加规则,匹配所有请求并记录审计日志
SecRule REQUEST_METHOD "@Streq POST"
"id:1001,phase:1,log,auditlog,msg:'POST request detected',tag:'POST-Request-RuleSet'"
我是用curl 进行测试访问,如下
C:\Users\28177>curl -v -X POST http://127.0.0.1:5050/ -d "key1=value1&key2=value2"Note: Unnecessary use of -X or --request, POST is already inferred.
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Sun, 14 Jul 2024 04:51:30 GMT
< Content-Length: 14
<
Hello, World!
最后audit记录的内容为:
(The content recorded in the final audit is:)
{"transaction":{"timestamp":"2024/07/14 12:51:30","unix_timestamp":1720932690441861500,"id":"MSUmuRhwfytUyCVFVRy","client_ip":"127.0.0.1:35335","client_port":0,"host_ip":"127.0.0.1:5050","host_port":0,"server_id":"127.0.0.1:5050","request":{"method":"POST","protocol":"HTTP/1.1","uri":"/","http_version":"","headers":{"accept":["*/*"],"content-length":["23"],"content-type":["application/x-www-form-urlencoded"],"user-agent":["curl/8.7.1"]},"body":"","files":null},"response":{"protocol":"","status":200,"headers":{"content-type":["text/plain"]},"body":""},"producer":{"connector":"","version":"","server":"","rule_engine":"On","stopwatch":"1720932690441861500 2256200; combined=1747500, p1=1747500, p2=0, p3=0, p4=0, p5=0","rulesets":null}}}
问题:为什么我在代码和规则中都启用的body记录,但是body字段确实空的,哪位神仙可以帮助一下
(Question: Why do I enable the body record in both the code and rules, but the body field is indeed empty? Which immortal can help)
Beta Was this translation helpful? Give feedback.
All reactions