Admin APIs、application tunnels 與 custom email
三個進階功能:用 admin API 自動化 organization 管理、用 application tunnel 連到防火牆內的 Data Center、用公司網域寄通知。這一節考它們由誰設定、在哪裡設定,以及各自的限制。
官方考綱原文(這一節會考的範圍)
- Configure release tracks, sandboxes, IP allowlisting, admin APIs, and application tunnels(新版能力清單)設定 release tracks、sandboxes、IP allowlisting、admin APIs 與 application tunnels
- Understand that you can manage your Atlassian cloud organization via the admin APIs / Create an API key / Revoke an API key了解可以用 admin APIs 管理 organization;建立與撤銷 API key
- Understand what application tunnels are: Provide a secure pathway between a cloud organization and DC/Server instances that live on the company network了解 application tunnels:在 cloud organization 與公司網路內的 DC/Server 之間提供安全通道
- Used to integrate products through application links that would otherwise require allowing incoming connections to the company network用來透過 application link 整合產品,否則就得允許外部連入公司網路
- Allow integration of Atlassian products and exchange of data and functionalities in a secure way, without exposing the company network or allowlisting incoming connections or IPs安全地整合與交換資料,不必暴露公司網路,也不必把連入的連線或 IP 加進白名單
- Add custom email addresses for product notifications / Understand the purpose of adding a custom email address為產品通知加入自訂 email 地址,並了解目的(舊版 4.1)
用 API 管 organization、連到自建主機、用自己的網域寄通知
- Admin API keyOrganization settings → API keys 建立;用來呼叫 organization、user management、provisioning 等 admin API。值只顯示一次;有 scope 的 key 最長一年。
- With scopes 與 without scopes有 scope 的 key 只能做指定的動作,比較安全;沒有 scope 的 key 能呼叫所有 admin API。撤銷是永久的,最多 10 分鐘失效。
- Admin API key 與 user API token 不同Admin API key 由 org admin 在 Atlassian Administration 建立,用來管 organization;user API token 由使用者自己建立,用來呼叫 Jira、Confluence 的 API。
- Application tunnels在 cloud organization 與你網路裡的 Data Center 之間建安全通道,不必開放連入的防火牆或 IP;只有連入方向走 tunnel。
- Tunnel 的限制一個 Data Center instance 只能接一個 tunnel(一個 organization);一個 organization 最多 100 個 tunnel;tunneled application link 只能從 cloud 端建立。
- Custom emailOrganization settings → Emails:加 email 網域、把 DKIM、bounce、TXT 等 DNS record 加到網域商,Active 後加寄件地址(每個 site 最多 30 個),app admin 再挑來用。
資料來源(5)有疑慮時點開看官方原文
- Manage an organization with the admin APIs
API keys allow you to manage your organization through the admin APIs.
- Manage an organization with the admin APIs
An API key without scopes can access all Atlassian Admin APIs.
- What are application tunnels?
Application tunnels provide a secure pathway between your Atlassian cloud organization and Data Center instances that live in your network.
- Create an application tunnel to your Data Center instance
However, each self-managed instance can receive only one tunnel.
- Add email addresses for your domain
You can add a maximum of 30 email addresses to each site in your organization.
建立、使用、撤銷 API key
Admin API 讓你用程式自動化 Atlassian Administration:查 organization、管理 managed account、從 IdP provisioning、資料分類、建立 data security 與 IP allowlist 政策、撤銷 user API token 等。呼叫前要先由 org admin 建立 API key,呼叫時把它當 Bearer token 帶上。
| API key with scopes | API key without scopes | |
|---|---|---|
| 能做什麼 | 只能做你選的 scope | 能呼叫所有 admin API |
| 安全性 | 比較安全 | 官方提醒可能有安全風險 |
| 限制 | 只有部分 API 支援 scope;最長一年 | — |
- Key 的值只在建立時顯示一次,Atlassian 不保存;遺失就只能撤銷再建一把。
- 官方建議只把 key 分享給其他 org admin;有 org admin 離職時,撤銷他建立的 key。
- Revoke 是永久的,最多 10 分鐘後才完全失效。
- Organizations REST API 的網址開頭是 api.atlassian.com/admin/,後面接版本與資源,例如 GET /v1/orgs 會依 API key 列出你的 organization。
「Admin 想讓一支內部程式每天把離職員工的 managed account 停用。」答案是由 org admin 建立 admin API key,呼叫 user management API。不是使用者在 id.atlassian.com 建的 user API token,那是給 Jira、Confluence 等 app API 用的。
資料來源(6)有疑慮時點開看官方原文
- Manage an organization with the admin APIs
An API key with scopes is secure because it can only perform specific actions in your organization.
- Manage an organization with the admin APIs
This API key may present a security risk because it can access everything.
- Manage an organization with the admin APIs
When an organization admin leaves your organization, we recommend you revoke any API keys they created.
- Manage an organization with the admin APIs
It may take up to 10 minutes for a key you revoke to stop working.
- About cloud admin REST APIs
View, search and revoke API tokens of managed accounts.
- The Organizations REST API
Use the API Key as a Bearer access token to authenticate the script and manage your organization.
Cloud 與防火牆內的 Data Center 安全相連
公司若同時有 cloud 與放在內部網路的 Data Center(考綱寫 DC/Server),要用 application link 整合兩邊,傳統做法得開放外部連入公司網路。Application tunnels 改成在兩邊之間建一條安全通道:不必暴露網路、不必把任何連入的 IP 加進防火牆白名單。
- 1 安裝 tunnel client在 Data Center 安裝 Application tunnels 這個 Marketplace app(Confluence 9.4 與 9.2.6 LTS 起已內建)。
- 2 設定連線與 port允許連出 port 443 到 tunnel.services.atlassian.com 與 cloud app;新增只對 localhost 開放的 HTTP connector 與 upstream port。不用開任何連入。
- 3 建立 tunnelAtlassian Administration → Data management → Data sources → Application tunnels → Create tunnel,產生 security key,貼到 Data Center。
- 4 建立 tunneled application link到 cloud app 自己的設定(例如 Jira 的 Settings → Products → Application links)→ Create link → Tunneled application link。
| Cloud 端狀態 | 意思與處理 |
|---|---|
| Incomplete | Cloud 已建 tunnel,但 security key 還沒加到 Data Center |
| Misconfigured | Data Center 沒設好 connector 與 upstream port |
| Unavailable | 暫時連不上、key 錯誤或過期、或 Data Center 停機 |
| Error/Timed out | 多半是 Data Center 本身的問題或負載過高;查 log、重產 key 或重建 tunnel |
這張表最該記的:Incomplete 就是「key 還沒貼到 Data Center」。兩邊的 application link 都顯示 Config error 時,通常是 cloud 端 link 的 local authentication 沒設成 OAuth。支援的 cloud app 是 Jira、JSM、Confluence;Atlassian Government Cloud 不支援。
資料來源(6)有疑慮時點開看官方原文
- What are application tunnels?
This pathway can be used to integrate your instances through application links that would otherwise require allowing incoming connections to your network.
- What are application tunnels?
Only incoming connections to your network use the tunnel, the outgoing ones will reach your Atlassian cloud apps directly.
- Configure required connections and upstream ports
You don’t have to allow any incoming connections to your network or IP ranges.
- Create an application tunnel to your Data Center instance
In admin.atlassian.com, you can create up to 100 tunnels, each going to a different Data Center instance.
- Create a tunneled application link
You can create a tunneled application link only from your cloud app.
- Troubleshoot application tunnels
Set the Local authentication to OAuth for both outgoing and incoming communication.
用公司網域寄 Jira、Confluence 通知
預設情況下,Jira 與 Confluence 的通知從 Atlassian 的網域寄出(例如 jira@acme.atlassian.net)。若要改用 support@acme.com 這類公司地址,org admin 要先替該網域設定 DMARC,讓收件伺服器相信 Atlassian 有權代你寄信。DMARC 用 SPF 與 DKIM 驗證寄件來源與內容,可以防釣魚與網域偽冒,也提高通知不被當成垃圾信的機率。
| DNS record | 作用 |
|---|---|
| DKIM(兩筆 CNAME) | 授權 Atlassian 用你的網域簽署信件;兩筆是為了換 key 時不中斷 |
| Bounce(CNAME) | 收件端退信時寄回的地址;也用於 SPF 驗證 |
| TXT | 照畫面複製 name 與 value 加入(官方沒有逐筆說明 TXT 的用途) |
整組 DNS record 的目的,是讓 Atlassian 確認你擁有網域,並取得 DMARC 需要的設定參數;Atlassian Administration 會列出 5 或 6 筆 record。
- 這和「驗證網域來管理帳號」是兩件事:custom email 用多筆 DNS record,設定位置在 Organization settings → Emails,不是 Directory → Domains。
- 寄件地址建議用代表團隊的地址(例如 support@、help@),不要用個人帳號的 email。
- Remove email domain 會一併移除該網域的所有地址;Remove email address 或把 Available in app? 關掉,用到它的通知都會改回 app 預設地址。重新開啟 Available in app? 也不會自動加回原本的通知。
- Jira:space 設定 → Notifications → Internal notifications → Notification email,從下拉選 custom email 或預設的 Jira 地址。
「Project admin 在 Notification email 的下拉選單找不到 support@acme.com。」最可能是 org admin 還沒在 Organization settings → Emails 加這個地址、沒把它開放給這個 app,或把 Available in app? 關掉了。Project admin 自己不能新增寄件地址。
資料來源(7)有疑慮時點開看官方原文
- What are the steps for setting up custom email addresses?
As an organization admin, you can set up DMARC so that app admins can customize the sender email address of a Jira app or Confluence notification.
- What are the steps for setting up custom email addresses?
Add your email domain for app notifications. This is different from verifying your domain to manage accounts.
- What are the steps for setting up custom email addresses?
Provisioning can take up to 72 hours while we recognize the DNS record updates in your provider.
- What are the DNS records required for configuring DMARC?
We include two DKIM records in case one key needs to be rotated.
- Copy and add DNS records to your domain provider
Select See DNS records for the domain you want to manage. You’ll see 5 or 6 DNS records.
- Make an email address unavailable in an app
We won’t add the email address back to any notifications that were previously configured with the email address.
- Configure Jira Cloud to send emails on behalf of your domain
The list of custom email addresses you can use for the space must be added at admin.atlassian.com by your organization admins.
考題愛用的錯誤說法
資料來源(6)有疑慮時點開看官方原文
- Manage an organization with the admin APIs
You can't recover the API key later.
- Manage an organization with the admin APIs
This API key may present a security risk because it can access everything.
- Manage an organization with the admin APIs
A revoked API key is permanent.
- Configure required connections and upstream ports
Allow outgoing connections on port 443:
- What are application tunnels?
The application link must always be created on the cloud side.
- Add your email domain
Adding your email domain for app notifications is different from verifying your domain to manage accounts.
實作 Lab:建一把 admin API key、呼叫一次、再撤銷
第一次做 Lab?先看 Lab 環境準備:用測試站台、準備測試帳號。畫面名稱可能隨 Atlassian 更新而不同,以下以現行畫面為準。
目標:親手建立有 scope 的 admin API key、用 curl 呼叫一次 Organizations API,再撤銷它;順便看 application tunnels 與 custom email 的設定畫面。
Admin API key 在 Organization settings → API keys 建立,值只顯示一次、有 scope 的 key 最長一年;撤銷是永久的,最多 10 分鐘生效。Tunnel 在 Data management → Data sources;custom email 在 Organization settings → Emails。
準備
- 電腦上有 curl(macOS、Linux 內建;Windows 可用 PowerShell 的 curl.exe)。
步驟
- 你應該看到:要填 Name、選到期日(最長一年)、選 API scopes。
- 你應該看到:畫面顯示 key 的值,而且只顯示這一次。複製到暫存處。
- 你應該看到:通常會回傳 JSON,裡面有 Lab Org 的 id 與 name。若回 401 或 403,多半是所選 scope 不涵蓋這個 API,記下錯誤即可,不影響後面步驟。
- 你應該看到:Key 被撤銷,無法復原。
- 你應該看到:精靈要你填 Data Center instance 的資料,並產生 security key;沒有 Data Center 就不要完成(只看不做)。
- 你應該看到:沒有自己的網域就直接關掉。有網域的人輸入後會看到 DNS records 對話框,列出 5 或 6 筆 record(DKIM、bounce、TXT)。
- 你應該看到:通常 Email 下拉只有預設的 Jira 地址(還沒有 custom email);使用預設地址時可以改 email prefix。看完按取消,不要儲存。
試試看:改一個設定,觀察差異
T1撤銷後馬上再跑一次步驟 3 的 curl,10 分鐘後再跑一次。看結果
T2再建一把 API keys without scopes 的 key,看建立前的說明,然後立刻撤銷。看結果
T3(想像,不實際做)你建好 tunnel,但 Data Center 的 admin 還沒把 security key 貼上。看結果
API key 建立完成那一刻:一串只出現一次的 key 和複製按鈕。Key 只看一次、一年到期、十分鐘失效。
收尾
- 確認 API keys 清單裡的 lab key 都已撤銷(必做)。
- 清掉終端機歷史裡含 key 的那一行(例如 zsh 的 history 檔),不要把 key 留在電腦上。
- 加了 email domain 但不打算用的話,在 Email domains 分頁 Remove。
資料來源(5)有疑慮時點開看官方原文
- Manage an organization with the admin APIs
Select Organization settings, then API keys.
- The Organizations REST API
Use the API Key as a Bearer access token to authenticate the script and manage your organization.
- Manage an organization with the admin APIs
It may take up to 10 minutes for a key you revoke to stop working.
- Create an application tunnel to your Data Center instance
Select Data management, then Data sources, then Application tunnels.
- Configure Jira Cloud to send emails on behalf of your domain
Select Notifications > Internal notifications from the space sidebar.
讀完了?用這張收攏整節
- Admin API key:Organization settings → API keys;只顯示一次,有 scope 的 key 最長一年。
- Revoke 永久、最多 10 分鐘生效;admin 離職要撤銷他的 key。
- 只有連入你網路的流量走 tunnel;連出直連 cloud。
- 一個 DC instance 只接一個 organization 的 tunnel;最多 100 個 tunnel。
- Custom email:org admin 加網域與地址,app admin 只能挑。
- 移除或停用地址,通知改回 app 預設地址。
做題
題目載入中…
- Manage an organization with the admin APIs
- About cloud admin REST APIs
- What are application tunnels?
- Configure required connections and upstream ports
- Create an application tunnel
- Create a tunneled application link
- Troubleshoot application tunnels
- What are the steps for setting up custom email addresses?
- What are the DNS records required for configuring DMARC?
- Add email addresses for your domain
- Configure Jira Cloud to send emails on behalf of your domain
本教材為原創整理,非 Atlassian 官方出版品;題目皆為原創,不含第三方題庫題幹。官方文件近年改用新名稱:product 改稱 app、Atlassian Access 改為 Atlassian Guard、project 改稱 space。考試與舊文件的說法並陳。