將 Atlassian Confluence Server 與 Google SecOps 整合

本文說明如何將 Atlassian Confluence Server 與 Google Security Operations (Google SecOps) 整合。

必要條件

如要向 Confluence Server 進行驗證,請選擇下列任一選項:

  • 專屬帳戶的使用者名稱和密碼。
  • 個人存取權杖 (PAT)。

如果整合功能同時提供這兩種驗證選項,PAT 的優先順序會高於使用者名稱和密碼。

如要根據使用者名稱和密碼進行驗證,您必須建立用於整合的專用帳戶。
如要根據存取權杖進行驗證,必須設定帳戶權限。建立後,新的 PAT 會對應到帳戶目前的權限層級。

如要建立權杖,請按照下列步驟操作:

  1. 在 Confluence 中,依序前往「Account」>「Account settings」>「Personal access tokens」。
  2. 選取「建立權杖」。
  3. 為要建立的權杖命名。
  4. (選用) 為了提高安全性,您可以設定權杖在指定天數後自動失效。
  5. 點選「建立」。

整合參數

整合時需要下列參數:

參數名稱 類型 預設值 為必填 說明
API 根 字串 https://ip_address 是 指定要連線的 Confluence Server API 根目錄。
使用者名稱 字串 不適用 否 指定連線要使用的使用者名稱。整合功能支援使用使用者名稱 + 密碼或個人存取權杖進行驗證。
密碼 密碼 不適用 否 指定連線要使用的密碼。整合功能支援使用使用者名稱 + 密碼或個人存取權杖進行驗證。
個人存取權杖 密碼 不適用 否 指定要用於連線的權杖。整合功能支援使用使用者名稱 + 密碼或個人存取權杖進行驗證。
驗證 SSL 核取方塊 已勾選核取方塊 否 如果啟用,系統會驗證為 API 根目錄設定的憑證。

如要瞭解如何在 Google SecOps 中設定整合功能,請參閱「設定整合功能」。

如有需要,您可以在後續階段進行變更。設定整合執行個體後,即可在應對手冊中使用。如要進一步瞭解如何設定及支援多個執行個體,請參閱「支援多個執行個體」。

動作

如要進一步瞭解動作,請參閱「 在工作區回應待處理動作」和「在案件中執行手動動作」。

乒乓

測試連線。

參數

不適用

執行日期

系統未對實體執行這項動作。

動作結果

指令碼執行結果
指令碼結果名稱 值選項 範例
is_success True/False is_success:False

如果動作成功 (回應中有 JSON,且伺服器回應為 200),is_success 應設為 True。否則,False。

案件總覽
結果類型 值/說明 類型 (實體/一般)
輸出訊息* 動作不應失敗,也不應停止應對手冊執行作業:
  • 如果成功:
    列印「已成功使用提供的連線參數連線至 Atlassian Confluence Server 執行個體!」
  • 如果同時提供使用者名稱、密碼和 PAT:
    「同時提供使用者名稱、密碼和個人存取權杖,系統將使用個人存取權杖連線至」

動作應失敗並停止執行應對手冊:
  • If both (username+password) and PAT are not provided:
    print "Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!"
  • 如果發生重大錯誤,例如憑證錯誤或連線中斷:
    print "Failed to connect to the Atlassian Confluence Server instance! 錯誤為 {0}".format(exception.stacktrace)
一般

清單頁面

根據提供的條件,列出 Atlassian Confluence Server 執行個體中的可用頁面。

參數

參數名稱 類型 預設值 為必填 說明
篩選鍵 DDL 選取一個

DDL 可能的值:
  • 標題
  • 聊天室名稱
  • 狀態
否 指定要用來篩選網頁的鍵。
篩選邏輯 DDL 未指定

DDL 可能的值:
  • 未指定
  • 等於
  • 包含
否 指定要套用的篩選器邏輯。篩選邏輯會根據 Filter Key 參數中提供的值運作。
篩選器值 字串 不適用 否 指定篩選條件應使用的值。
如果選取 Equal,動作會嘗試在結果中尋找完全相符的項目。
如果選取 Contains,動作會嘗試尋找包含該子字串的結果。
如果未在這個參數中提供任何內容,系統就不會套用篩選器。
篩選邏輯會根據 Filter Key 參數中提供的值運作。
要傳回的記錄數量上限 整數值 50 否 指定要傳回的記錄數量。
如未提供任何值,動作會傳回 50 筆記錄。

執行日期

系統未對實體執行這項動作。

動作結果

指令碼執行結果
指令碼結果名稱 值選項 範例
is_success True/False is_success:False

如果動作執行成功 (未傳回錯誤,伺服器回應為 200 OK),is_success 應設為 True。

JSON 結果
{
   "results": [
       {
           "id": "PAGE_ID",
           "type": "page",
           "status": "current",
           "title": "Tell people what you think in a comment (step 8 of 9)",
           "space": {
               "id": 131073,
               "key": "ds",
               "name": "Demonstration Space",
               "type": "global",
               "_links": {
                   "webui": "/display/ds",
                   "self": "http://192.0.2.45:8090/rest/api/space/ds"
               },
               "_expandable": {
                   "metadata": "",
                   "icon": "",
                   "description": "",
                   "retentionPolicy": "",
                   "homepage": "/rest/api/content/PAGE_ID"
               }
           },
           "extensions": {
               "position": 7
           },
           "_links": {
               "webui": "/pages/viewpage.action?pageId=PAGE_ID",
               "edit": "/pages/resumedraft.action?draftId=DRAFT_ID",
               "tinyui": "/x/AYAB",
               "self": "http://192.0.2.45:8090/rest/api/content/PAGE_ID"
           },
           "_expandable": {
               "container": "/rest/api/space/ds",
               "metadata": "",
               "operations": "",
               "children": "/rest/api/content/PAGE_ID/child",
               "restrictions": "/rest/api/content/PAGE_ID/restriction/byOperation",
               "history": "/rest/api/content/PAGE_ID/history",
               "ancestors": "",
               "body": "",
               "version": "",
               "descendants": "/rest/api/content/PAGE_ID/descendant"
           }
       },
       ...
   ],
   "start": 0,
   "limit": 5,
   "size": 5,
   "_links": {
       "self": "http://192.0.2.45:8090/rest/api/content?expand=space",
       "next": "/rest/api/content?expand=space&limit=5&start=5",
       "base": "http://192.0.2.45:8090",
       "context": ""
   }
}
案件總覽
結果類型 值/說明 類型 (實體/一般)
輸出訊息* 動作不應失敗,也不應停止執行應對手冊:

  • 如果資料可用(is_success = true):
print "Successfully found pages for the provided criteria in Atlassian Confluence Server".

  • 如果無法取得資料 (is_success=false)
print "No pages were found for the provided criteria in Atlassian Confluence Server"

  • 如果「篩選器值」為空白 (is_success=true):
「篩選器值」參數的值空白,因此未套用篩選器。

動作應失敗並停止執行應對手冊:

  • 如果篩選條件鍵 ==「選取一項」,且篩選條件邏輯為「等於」或「包含」:
執行動作「{action name}」時發生錯誤。原因:您必須從 Filter Key 參數中選取欄位。

  • 如果為「Max Records to Return」(要傳回的記錄數量上限) 提供無效值:
執行動作「{action name}」時發生錯誤。原因:「『Max Records to Return』的值無效:<提供的值>。請提供正數」。

  • 如果發生嚴重錯誤,例如憑證錯誤、無法連線至伺服器等:
「執行動作『{action name}』時發生錯誤。Reason: {0}''.format(error.Stacktrace)

  • 如果未提供使用者名稱 + 密碼和 PAT:
print "Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!"
一般
案件總覽表格 名稱:Available Confluence Pages
資料欄:
  • ID
  • 標題
  • 空格鍵
  • 狀態
  • 建立時間
一般

依 ID 取得頁面

依 ID 取得 Atlassian Confluence Server 頁面。

參數

參數名稱 類型 預設值 為必填 說明
網頁 ID 字串 不適用 是 指定要傳回的頁面 ID。
展開 CSV body.storage 否 指定展開參數,傳回網頁的其他資訊。參數接受多個值,以逗號分隔的清單。
根據預設,系統會使用 body.storage 擷取網頁內容。

執行日期

系統未對實體執行這項動作。

動作結果

指令碼執行結果
指令碼結果名稱 值選項 範例
is_success True/False is_success:False

如果動作成功執行 (傳回網頁,伺服器回應為 200 OK),is_success 應設為 True。

JSON 結果
{
   "id": "PAGE_ID",
   "type": "page",
   "status": "current",
   "title": "title",
   "body": {
       "storage": {
           "value": "<p>test page</p><p>11</p><p>aa</p><p>aa</p><p>aa</p><p><br /></p><p><br /></p>",
           "representation": "storage",
           "_expandable": {
               "content": "/rest/api/content/PAGE_ID"
           }
       },
       "_expandable": {
           "editor": "",
           "view": "",
           "export_view": "",
           "styled_view": "",
           "anonymous_export_view": ""
       }
   },
   "extensions": {
       "position": "none"
   },
   "_links": {
       "webui": "/display/SIEM/111",
       "edit": "/pages/resumedraft.action?draftId=PAGE_ID&draftShareId=cf8b3a21-8e36-4a83-a696-51fcb4428d1c",
       "tinyui": "/x/TIAB",
       "collection": "/rest/api/content",
       "base": "http://192.0.2.45:8090",
       "context": "",
       "self": "http://192.0.2.45:8090/rest/api/content/PAGE_ID"
   },
   "_expandable": {
       "container": "/rest/api/space/SIEM",
       "metadata": "",
       "operations": "",
       "children": "/rest/api/content/PAGE_ID/child",
       "restrictions": "/rest/api/content/PAGE_ID/restriction/byOperation",
       "history": "/rest/api/content/PAGE_ID/history",
       "ancestors": "",
       "version": "",
       "descendants": "/rest/api/content/PAGE_ID/descendant",
       "space": "/rest/api/space/SIEM"
   }
}
案件總覽
結果類型 值/說明 類型 (實體/一般)
輸出訊息* 動作不應失敗,也不應停止執行應對手冊:

  • 如果找到網頁 (is_success = true):
print "Successfully fetched page information with id: <id>"

  • 如果無法取得資料 (is_success=false):
print "The following page id was not found in the Atlassian Confluence Server: <page id>"

動作應失敗並停止執行應對手冊:

  • 如果發生嚴重錯誤,例如憑證錯誤、無法連線至伺服器等:
"Error executing action "<Action name>". Reason: {0}''.format(error.Stacktrace)

  • 如果未提供使用者名稱 + 密碼和 PAT:
print "Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!"
一般

取得子頁面

取得 Atlassian Confluence Server 頁面的子頁面。

參數

參數名稱 類型 預設值 為必填 說明
網頁 ID 字串 不適用 是 指定要傳回的頁面 ID。
要傳回的記錄數量上限 整數值 10 是 指定要傳回的子頁面數量上限。

執行日期

系統未對實體執行這項動作。

動作結果

指令碼執行結果
指令碼結果名稱 值選項 範例
is_success True/False is_success:False

如果動作成功執行 (傳回網頁,伺服器回應為 200 OK),is_success 應設為 True。

JSON 結果
{
   "results": [
       {
           "id": "PAGE_ID",
           "type": "page",
           "status": "current",
           "title": "test child page!",
           "extensions": {
               "position": "none"
           },
           "_links": {
               "webui": "/pages/viewpage.action?pageId=PAGE_ID",
               "edit": "/pages/resumedraft.action?draftId=PAGE_ID&draftShareId=799fd068-5053-4889-9120-c1a3c970fdbd",
               "tinyui": "/x/T4AB",
               "self": "http://192.0.2.45:8090/rest/api/content/PAGE_ID"
           },
           "_expandable": {
               "container": "/rest/api/space/SIEM",
               "metadata": "",
               "operations": "",
               "children": "/rest/api/content/PAGE_ID/child",
               "restrictions": "/rest/api/content/PAGE_ID/restriction/byOperation",
               "history": "/rest/api/content/PAGE_ID/history",
               "ancestors": "",
               "body": "",
               "version": "",
               "descendants": "/rest/api/content/PAGE_ID/descendant",
               "space": "/rest/api/space/SIEM"
           }
       }
   ],
   "start": 0,
   "limit": 1,
   "size": 1,
   "_links": {
       "self": "http://192.0.2.45:8090/rest/api/content/PAGE_ID/child/page",
       "base": "http://192.0.2.45:8090",
       "context": ""
   }
}
案件總覽
結果類型 值/說明 類型 (實體/一般)
輸出訊息* 動作不應失敗,也不應停止執行自動化動作:

如果資料可用 (is_success = true):
print "Successfully found child pages for the provided Atlassian Confluence Server page id: <page_id>".

如果資料不可用 (is_success=false):
print "No child pages were found for the provided Atlassian Confluence Server page id <page_id>"

動作應失敗,並停止執行自動化動作:

  • 如果為「Max Records to Return」(要傳回的記錄數量上限) 提供無效值:
執行動作「{action name}」時發生錯誤。原因:「『Max Records to Return』的值無效:<提供的值>。請提供正數」。

  • 如果發生嚴重錯誤,例如憑證錯誤、無法連線至伺服器等:
「執行動作『{action name}』時發生錯誤。Reason: {0}''.format(error.Stacktrace)
  • 如果未提供使用者名稱 + 密碼和 PAT:
print "Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!"
一般

取得頁面留言

取得 Atlassian Confluence Server 頁面的留言。

參數

參數名稱 類型 預設值 為必填 說明
網頁 ID 字串 不適用 是 指定要傳回的頁面 ID。
展開 CSV body.storage 否 指定展開參數,傳回網頁的其他資訊。參數接受多個值,以逗號分隔的清單。
根據預設,系統會使用 body.storage 擷取網頁內容。
要傳回的記錄數量上限 整數值 10 是 指定要傳回的子頁面數量上限。

執行日期

系統未對實體執行這項動作。

動作結果

指令碼執行結果
指令碼結果名稱 值選項 範例
is_success True/False is_success:False

如果動作成功執行 (傳回註解,伺服器回應為 200 OK),is_success 應設為 True。

JSON 結果
{
   "results": [
       {
           "id": "ID",
           "type": "comment",
           "status": "current",
           "title": "Re: 111",
           "body": {
               "storage": {
                   "value": "<p>comment1</p>",
                   "representation": "storage",
                   "_expandable": {
                       "content": "/rest/api/content/ID"
                   }
               },
               "_expandable": {
                   "editor": "",
                   "view": "",
                   "export_view": "",
                   "styled_view": "",
                   "anonymous_export_view": ""
               }
           },
           "extensions": {
               "location": "footer",
               "_expandable": {
                   "resolution": ""
               }
           },
           "_links": {
               "webui": "/display/SIEM/111?focusedCommentId=98387#comment-ID",
               "self": "http://203.0.113.1:8090/rest/api/content/ID"
           },
           "_expandable": {
               "container": "/rest/api/content/ID",
               "metadata": "",
               "operations": "",
               "children": "/rest/api/content/ID/child",
               "restrictions": "/rest/api/content/ID/restriction/byOperation",
               "history": "/rest/api/content/ID/history",
               "ancestors": "",
               "version": "",
               "descendants": "/rest/api/content/ID/descendant",
               "space": "/rest/api/space/SIEM"
           }
       },
       ...
   ],
   "start": 0,
   "limit": 10,
   "size": 2,
   "_links": {
       "self": "http://203.0.113.1:8090/rest/api/content/ID/child/comment?expand=body.storage",
       "base": "http://203.0.113.1:8090",
       "context": ""
   }
}
案件總覽
結果類型 值/說明 類型 (實體/一般)
輸出訊息* 動作不應失敗,也不應停止執行應對手冊:

  • 如果資料可用(is_success = true):
print "Successfully fetched page comments for the provided Atlassian Confluence Server page id: <page_id>".

  • 如果無法取得資料 (is_success=false)
print "No page comments were found for the provided Atlassian Confluence Server page id <page_id>"

動作應失敗並停止執行應對手冊:

  • 如果為「Max Records to Return」(要傳回的記錄數量上限) 提供無效值:
執行動作「{action name}」時發生錯誤。原因:「『Max Records to Return』的值無效:<提供的值>。請提供正數」。

  • 如果發生嚴重錯誤,例如憑證錯誤、無法連線至伺服器等:
「執行動作『{action name}』時發生錯誤。Reason: {0}''.format(error.Stacktrace)

  • 如果未提供使用者名稱 + 密碼和 PAT:
print "Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!"
一般

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。