使用 Azure DevOps 組織範圍內的個人存取權杖 (PAT),並配置 AppScan Presence 以連接到 Azure DevOps 儲存庫。
開始之前
- 確保您具有 Azure DevOps 組織的存取權,也有權存取您計劃要掃描的儲存庫。
- 確保您的 Azure DevOps 組織允許您建立具有所需範圍的 PAT。
- 在具有 Azure DevOps 存取權的私有網路上建立並安裝 AppScan Presence。
執行這項作業的原因和時機
Azure DevOps 伺服器不必開放公開存取。您必須具有伺服器的網路存取權和存取其儲存庫的權限。
程序
-
為您的 Azure DevOps 組織建立 PAT。
- 登入您的 Azure DevOps 組織。
- 開啟「使用者設定」並選取「個人存取權杖」。
- 選取「+ 新權杖」。
- 輸入名稱,選取包含儲存庫的組織,然後設定到期日。
- 在「程式碼」下,選取「讀取」。
- 選取「建立」並立即複製權杖。
安全地儲存權杖。Azure DevOps 不會再次顯示其值。如需詳細資訊,請參閱使用個人存取權杖。
-
開啟 AppScan Presence 安裝目錄中的 git_connect_settings.json。
-
在
GitConnectOptions 區段中,配置 Azure DevOps 連線。
| 參數 | 說明 | 範例 |
GitServerName | Azure DevOps 伺服器的名稱。 | Azure DevOps |
GitConnectUrl | 此 Presence 所顯示之 Web 應用程式的 HTTPS URL。 | https://my-presence-host-fqdn:443 |
GitPlatformDomain | Azure DevOps 伺服器的 URL。 | https://dev.azure.com |
GitPlatformType | 儲存庫提供者。 | AzureDevOps |
AccessToken | 為 Azure DevOps 組織建立的 PAT。 | personal-access-token |
OrganizationName | Azure DevOps 組織的名稱。 | organization-name |
Active | 啟用 Azure DevOps 連線。預設值是 false。 | true |
Proxy | 如果需要 Proxy 才能連線至 Azure DevOps,請取消此參數的註解並輸入 Proxy 詳細資料。 | 127.0.0.1:8888 |
-
在 git_connect_settings.json 的
Kestrel 區段中配置 HTTPS 端點。
-
儲存配置檔,然後啟動或重新啟動 Presence。
日誌會被寫入主控台和 Presence 安裝目錄中 logs 資料夾中的檔案。
下一步
若要使用 Presence 掃描儲存庫,先選取「Azure DevOps」作為提供者,再選取配置好的 Presence,然後選取「授權 Presence」。接著選取儲存庫和分支並完成掃描配置。
若要連接多個儲存庫,請參閱上線多個儲存庫以進行掃描。