0

在 kubernetes 环境中运行缺陷 dojo 实例并执行 curl 操作以导入 nessus 结果扫描并且失败并显示 400。我在不同的环境中运行 excat 相同的代码,并且使用相同的扫描文件导入工作正常。

curl -v -s -o $http_response -w "%{http_code}" -X POST  -H  "accept: */*" -H  "Content-Type: multipart/form-data" -F "file=@filename;type=text/xml" $DEFECTDOJO_API_URL/engagements/29/import-scan

curl跟踪的输出如下

3940: .</ReportItem>.</ReportHost>.</Report>.</NessusClientData_v2>.
=> Send data, 48 bytes (0x30)
0000:
0002: --------------------------b2766f621eee7af1--
<= Recv header, 26 bytes (0x1a)
0000: HTTP/1.1 400 Bad Request
<= Recv header, 20 bytes (0x14)
0000: content-length: 98
<= Recv header, 40 bytes (0x28)
0000: content-type: application/problem+json
<= Recv header, 37 bytes (0x25)
0000: date: Tue, 01 Feb 2022 14:17:36 GMT
<= Recv header, 21 bytes (0x15)
0000: server: istio-envoy
<= Recv header, 37 bytes (0x25)
0000: x-envoy-upstream-service-time: 5857
== Info: HTTP error before end of send, stop sending
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 98 bytes (0x62)
0000: {. "detail": "Bad Request",. "status": 400,. "title": "Bad Re
0040: quest",. "type": "about:blank".}.
== Info: Closing connection 0

无法找到此 400 错误的根本原因。我仔细检查了 nessus 报告文件并且是有效的 xml 文件

4

0 回答 0