啟用「應用程式安全管理 REST API」互動式架構

內建的 REST API 介面可讓您將 RESTful Web 服務視覺化,這些 Web 服務可用來建立及更新應用程式、設定使用者的應用程式存取權,以及新增或更新問題。使用架構,可以與 API 互動,並清楚瞭解 API 如何回應參數和選項。

開始之前

註:
  1. 如果要讓使用者能夠使用架構的 URL,則「產品管理員」必須修改 <install-dir>\AppScan Enterprise\Liberty\usr\servers\ase\config\asc.properties 檔,其作法是新增下列程式碼行:ase.rest.doc.enabled=true。否則,當使用者嘗試存取 URL 時,會看到 404 錯誤頁面。建立 asc.properties 檔之後,請重新啟動 HCL AppScan Enterprise Server 服務。
  2. 如果要存取互動式 REST API 架構,則必須將實例名稱命名為 'ase'(例如,https://<domain>:9443/ase/api/pages/apidocs.html)。
  3. 此頁面具有少數一些 API 的範例。如需所有 API 的相關資訊,請參閱 https://%3Cdomain%3E:9443/ase/api/pages/apidocs.html

執行這項作業的原因和時機

遵循這個範例,使用 /application REST API 來建立應用程式,以瞭解如何使用互動式架構。

程序

  1. 登入 AppScan Enterprise。
  2. 移至 https://<domain>:9443/ase/api/pages/apidocs.html。建立 URL 書籤,以供日後參考。
  3. 按一下應用程式來展開說明與資訊。
    建立應用程式
  4. 按一下建立應用程式來展開作業詳細資料。
    建立應用程式
  5. 參數區段中,按一下模型綱目
    參數中的模型綱目
  6. 按一下模型綱目編輯框中的文字,將文字當成 JSON 物件要求複製到Parameter Value方框中。
    JSON 物件要求
  7. 變更 JSON 元素的值。
    比方說,將

    {
      "attributeCollection": {
        "attributeArray": [
          {
            "name": ""
          }     ]   },   "id": 0,   "name": "",   "description": "",   "dateCreated": "Timestamp",   "lastUpdated": "Timestamp" }

    取代為

    {
      "attributeCollection": null,
      "id": 1,
      "name": "app1",
      "description": "template",
      "dateCreated": null,
      "lastUpdated": null
    }

  8. 執行要求並檢視回應。
    執行要求並檢視回應