HXSecurity / DongTai

Dongtai IAST is an open-source Interactive Application Security Testing (IAST) tool that enables real-time detection of common vulnerabilities in Java applications and third-party components through passive instrumentation. It is particularly suitable for use in the testing phase of the development pipeline.
https://dongtai.io
Apache License 2.0
1.24k stars 145 forks source link

[Bug]: Health Status error when agent is offline #358

Closed luzhongyang closed 2 years ago

luzhongyang commented 2 years ago

Preflight Checklist

Version

1.1.2

Installation Type

Official SaaS Service

Service Name

DongTai-WebAPI

Describe the details of the bug and the steps to reproduce it

In file views/setting/AgentManage.vue, healthy status is calculated from "row.running_status", when running_status is "未运行", healthy status will show offline.

      <el-table-column
        :label="$t('views.agentManage.healthy')"
        prop="running_status"
        width="130px"
      >
        <template slot-scope="{ row }">
          <div>
            {{
              row.running_status == '未运行'
                ? $t('views.agentManage.offline')
                : $t('views.agentManage.normal')
            }}
          </div>
        </template>
      </el-table-column>

But "running_status" in api "https://iast.io/api/v1/agents?page=1&pageSize=10&state=0&token=" is null, when agnt is not runing.

{
  "status": 201,
  "msg": "success",
  "data": [
    {
      "id": 6201,
      "token": "Mac OS X-owefsad.local-v1.1.1-b9d0a2f146934520aeff6f804d2fcf22",
      "server": "localhost:8080",
      "running_status": "",
      "system_load": "{\"rate\":20}",
      "owner": "owefsad",
      "latest_time": 1637813214,
      "project_name": "webgoat",
      "is_core_running": 0,
      "language": "JAVA",
      "flow": 1186,
      "is_control": 0,
      "report_queue": 0,
      "method_queue": 4,
      "replay_queue": 0,
      "alias": "Mac OS X-owefsad.local-v1.1.1-b9d0a2f146934520aeff6f804d2fcf22",
      "register_time": 1637809965,
      "startup_time": 3926
    }
  ],
  "page": {
    "alltotal": 4726,
    "num_pages": 473,
    "page_size": 10
  }
}

middle_img_v2_6c2ca104-312d-4dd1-b78b-b7b1fc98187g

Additional Information

No response

Logs

No response

Bidaya0 commented 2 years ago

@exexute