--- tags: Blue 的學習紀錄 --- # Verifying Apache Project Release (YuniKorn) 以 Apache Yunikorn 為例 在發佈新版本前,會請專案參與者投票(任何人都可以) 確認這個版本的發佈是否有問題 請各位協助驗證 協助的方式是對新的 release 做任何驗證後,在 Email 中進行 vote 表達意見 回覆的內容分為兩個主體: - **是否同意該 release?** 內容的開頭是 **-1/0/+1 (binding/non-binding)** 由於是 vote,所以可以表達對於該版本 release 的支持態度 "-1" 表達的是不同意,由於 vote 必須不能有任何 -1 才會通過,所以必須要有合理的依據可以說服大家 binding/non-binding 則是在表達投票者對於該專案的影響力 只有專案的 PMC member 是 binding,其餘人包含 commiter 都是 non-binding 在規定上,需要兩個以上 PMC +1,該 release 才會通過 - **羅列所做的驗證、驗證時的環境為何** 以下使用 [[VOTE] Release Apache YuniKorn 1.6.1 RC1](https://lists.apache.org/thread/3d857t7px8kgs3qvr078fs4w65qb8b10) 為例 如果有事先訂閱 dev@yunikorn.apache.org email list 就會收到這封信 沒有事先訂閱的話,也只要以相同 title 並回信給 dev@yunikorn.apache.org 就能進行投票 接下來介紹其中幾個常見的驗證方式和做法 ## Verified signatures and checksums 驗證發佈內容的來源以及正確性 步驟可參考[官方文件](https://yunikorn.apache.org/community/download/#verifying-the-signature) 首先根據信件內容所提供的位置,進行檔案的下載: ```bash # Download release source code, asc, and sha512 files # Modify the URL based on the target location URL=https://dist.apache.org/repos/dist/dev/yunikorn/1.6.1-RC1/ curl -s $URL | awk -F'"' '/href/ && !/\/$/ {print $2}' | xargs -n 1 -I {} curl -O $URL{} # Download the Public Key for verification curl -O https://downloads.apache.org/yunikorn/KEYS ``` ### 檔案內容說明 - `apache-yunikorn-1.6.1-src.tar.gz` Release 的原始碼檔案,包含程式碼及相關內容 - `apache-yunikorn-1.6.1-src.tar.gz.asc` 原始碼檔案經雜湊處理後,使用私鑰加密生成的數位簽章(純粹的字串),用於驗證檔案的來源與完整性 - `apache-yunikorn-1.6.1-src.tar.gz.sha512` 原始碼檔案經 SHA-512 雜湊後生成的字串,用於驗證檔案的完整性(檔案是否未被修改) - Apache public key 提供 Apache 的公鑰,用於驗證簽章。 下載連結: <https://downloads.apache.org/yunikorn/KEYS> ### Verifying the signature 驗證 release 發佈者的身分 - `apache-yunikorn-1.6.1-src.tar.gz.asc` 是 Release 檔案經雜湊處理後,使用私鑰簽署生成的數位簽章 - 驗證的過程包含兩個步驟: 1. 使用對應的公鑰解碼 `.asc` 文件,獲得簽名時的雜湊值 2. 計算 `apache-yunikorn-1.6.1-src.tar.gz` 的實際雜湊值,並與解碼後的雜湊值進行比對 - 驗證條件: 如果成功使用公鑰解碼,並且兩個雜湊值一致,則可以確認: - 檔案的完整性未被破壞 - 檔案確實由對應公鑰的擁有者發佈 ```bash # 下載 Apache YuniKorn 開發者的公鑰 curl -O https://downloads.apache.org/yunikorn/KEYS # Import 公鑰 gpg --import KEYS # 驗證 FILE=apache-yunikorn-1.6.1-src.tar.gz.asc gpg --verify $FILE ``` `gpg` 是一個用於資料加密和數位簽名的工具 若能成功驗證,應該要能顯示出: ```shell # Good signature from "xxx <xxx@apache.org>" ``` ### Verifying the checksum `apache-yunikorn-1.6.1-src.tar.gz.sha512` 是原始碼經過 sha512 雜湊後的字串 用於快速方便的讓第三方可以驗證檔案完整性,不需要公私鑰 只需要將 `apache-yunikorn-1.6.1-src.tar.gz` 也進行一次 sha512 雜湊 若雜湊後的結果與 `apache-yunikorn-1.6.1-src.tar.gz.sha512` 內容一致 則表示 `apache-yunikorn-1.6.1-src.tar.gz` 的內容與所發佈的版本內容一致 ```bash FILE=apache-yunikorn-1.6.1-src.tar.gz.sha512 sha512sum -c $FILE ``` 成功的話會出現: ```shell # apache-yunikorn-1.6.1-src.tar.gz: OK ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up