将 Atlassian Confluence Server 与 Google SecOps 集成

本文档介绍了如何将 Atlassian Confluence Server 与 Google Security Operations (Google SecOps) 集成。

集成版本:3.0

前提条件

如需向 Confluence 服务器进行身份验证,请选择以下任一选项:

  • 专用账号的用户名和密码。
  • 个人访问令牌 (PAT)。

如果为集成提供了这两种身份验证选项,则 PAT 的优先级高于用户名和密码。

基于用户名和密码的身份验证需要创建一个将用于集成的专用账号。
基于访问令牌的身份验证需要配置账号权限。新创建的 PAT 将对应于账号的当前权限级别。

如需创建令牌,请按以下步骤操作:

  1. 在 Confluence 中,依次前往账号 > 账号设置 > 个人访问令牌
  2. 选择 Create token
  3. 为要创建的令牌命名。
  4. (可选)为了提高安全性,您可以将令牌配置为在设定的天数后自动过期。
  5. 点击创建

集成参数

集成需要以下参数:

参数名称 类型 默认值 为必需参数 说明
API 根 字符串 https://ip_address 正确 指定要连接的 Confluence Server API 根。
用户名 字符串 不适用 错误 指定要用于连接的用户名。集成支持使用用户名 + 密码或个人访问令牌进行身份验证。
密码 密码 不适用 错误 指定要用于连接的密码。集成支持使用用户名 + 密码或个人访问令牌进行身份验证。
个人访问令牌 密码 不适用 错误 指定要用于连接的令牌。集成支持使用用户名 + 密码或个人访问令牌进行身份验证。
验证 SSL 复选框 复选框已勾选 错误 如果启用,则验证为 API 根配置的证书。

如需了解如何在 Google SecOps 中配置集成,请参阅配置集成

如有需要,您可以在稍后阶段进行更改。配置集成实例后,您可以在剧本中使用该实例。如需详细了解如何配置和支持多个实例,请参阅支持多个实例

操作

如需详细了解操作,请参阅 在工作台页面中处理待处理的操作执行手动操作

Ping

测试连接。

参数

不适用

运行于

操作未在实体上运行。

操作结果

脚本结果
脚本结果名称 值选项 示例
is_success True/False is_success:False

如果操作成功(响应中包含 JSON 且服务器响应为 200),则应将 is_success 设置为 True。否则,False

案例墙
结果类型 值/说明 类型(实体/常规)
输出消息* 操作不应失败,也不应停止 playbook 执行
  • 如果成功
    输出“Successfully connected to the Atlassian Confluence Server instance with the provided connection parameters!”
  • 如果同时提供了用户名和密码以及 PAT
    “已为集成提供用户名和密码以及个人访问令牌,将使用个人访问令牌进行连接”

操作应失败并停止 playbook 执行
  • 如果未提供(用户名 + 密码)和 PAT:
    打印“Failed to connect to Atlassian Confluence Server, expecting either username and password, or personal access token to connect with!”
  • 如果出现严重错误,例如凭据错误或连接丢失
    打印“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": ""
   }
}
案例墙
结果类型 值/说明 类型(实体/常规)
输出消息* 操作不应失败,也不应停止 playbook 执行

  • 如果数据可用(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)
由于参数“Filter Value”的值为空,因此未应用过滤条件。

操作应失败并停止 playbook 执行

  • 如果过滤键为“Select One”,且过滤逻辑为“Equal”或“Contains”
执行操作“{action name}”时出错。原因:您需要从 Filter Key 参数中选择一个字段。

  • 如果为“要返回的最大记录数”提供的值无效:
执行操作“{action name}”时出错。原因:“为‘要返回的最大记录数’提供的值无效:<提供的值>。应提供正数”。

  • 如果出现致命错误(例如凭据错误、无法连接到服务器、其他错误):
"执行操作“{action name}”时出错。原因:{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!"
常规
“案例墙”表格 名称:可用的 Confluence 页面

  • ID
  • 标题
  • 空格
  • 状态
  • 创建时间
常规

按 ID 获取网页

按 ID 获取 Atlassian Confluence Server 页面。

参数

参数名称 类型 默认值 为必需参数 说明
页面 ID 字符串 不适用 正确 指定要返回的网页 ID。
展开 CSV body.storage 错误 指定 expand 参数以返回有关网页的其他信息。参数接受多个值,这些值以英文逗号分隔。
默认情况下,网页内容是通过 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"
   }
}
案例墙
结果类型 值/说明 类型(实体/常规)
输出消息* 操作不应失败,也不应停止 playbook 执行

  • 如果找到网页(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>"

该操作应失败并停止 playbook 执行

  • 如果出现致命错误(例如凭据错误、无法连接到服务器、其他错误):
"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": ""
   }
}
案例墙
结果类型 值/说明 类型(实体/常规)
输出消息* 操作不应失败,也不应停止 playbook 执行

如果数据可用 (is_success = true)
打印“Successfully found child pages for the provided Atlassian Confluence Server page id: <page_id>”(已成功找到提供的 Atlassian Confluence Server 网页 ID<page_id> 的子网页)。

如果数据不可用 (is_success=false)
打印“No child pages were found for the provided Atlassian Confluence Server page id <page_id >”(未找到提供的 Atlassian Confluence Server 网页 ID<page_id> 的子网页)。

操作应失败并停止 playbook 执行

  • 如果为“要返回的最大记录数”提供的值无效:
执行操作“{action name}”时出错。原因:“为‘要返回的最大记录数’提供的值无效:<提供的值>。应提供正数”。

  • 如果出现致命错误(例如凭据错误、无法连接到服务器、其他错误):
"执行操作“{action name}”时出错。原因:{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 错误 指定 expand 参数以返回有关网页的其他信息。参数接受多个值,这些值以英文逗号分隔。
默认情况下,网页内容是通过 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": ""
   }
}
案例墙
结果类型 值/说明 类型(实体/常规)
输出消息* 操作不应失败,也不应停止 playbook 执行

  • 如果数据可用(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>"

The action should fail and stop a playbook execution:

  • 如果为“要返回的最大记录数”提供的值无效:
执行操作“{action name}”时出错。原因:“为‘要返回的最大记录数’提供的值无效:<提供的值>。应提供正数”。

  • 如果出现致命错误(例如凭据错误、无法连接到服务器、其他错误):
"执行操作“{action name}”时出错。原因:{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 专业人士那里获得解答。