共用方式為


Notation@0 - 表示法 v0 工作

用於設定表示法 CLI 的 Azure Pipepine 工作,使用表示法簽署並驗證。

語法

# Notation v0
# Azure Pipepine Task for setting up Notation CLI, sign and verify with Notation.
- task: Notation@0
  inputs:
    command: 'install' # 'install' | 'sign' | 'verify'. Required. Command to run. Default: install.
  # Command Configuration
    #isCustomVersion: false # boolean. Optional. Use when command = install. Custom Version. Default: false.
    #version: '1.3.2' # string. Required when command = install && isCustomVersion = false. Version. Default: 1.3.2.
    #url: # string. Required when command = install && isCustomVersion = true. Download URL. 
    #checksum: # string. Required when command = install && isCustomVersion = true. Checksum. 
    #artifactRefs: # string. Optional. Use when command = verify || command = sign. Artifact references. 
    #trustPolicy: # string. Required when command = verify. Trust Policy File Path. 
    #trustStore: # string. Required when command = verify. Trust Store Folder Path. 
  # Advanced Configuration
    #signatureFormat: 'cose' # 'cose' | 'jws'. Optional. Use when (command = sign || command = verify) && command = sign. Signature Format. Default: cose.
    #allowReferrersAPI: false # boolean. Optional. Use when command = sign || command = verify. [Experimental] Allow Referrers API. Default: false.
  # Plugin Configuration
    #plugin: 'azureKeyVault' # 'azureKeyVault'. Required when command = sign. Plugin. Default: azureKeyVault.
    #akvPluginVersion: '1.2.1' # string. Required when plugin = azureKeyVault && command = sign. Plugin Version. Default: 1.2.1.
    #azurekvServiceConection: # string. Optional. Use when plugin = azureKeyVault && command = sign. Azure Key Vault service connection. 
    #keyid: # string. Required when plugin = azureKeyVault && command = sign. Key ID. 
    #caCertBundle: # string. Optional. Use when plugin = azureKeyVault && command = sign. Certificate Bundle File Path. 
    #selfSigned: false # boolean. Optional. Use when plugin = azureKeyVault && command = sign. Self-signed Certificate. Default: false.
  # Timestamp
    #timestampURL: # string. Optional. Use when command = sign. Timestamp URL. 
    #timestampRootCert: # string. Optional. Use when command = sign. Timestamp Root Certificate.

輸入

執行command - 命令
string。 必須的。 允許的值:installsignverify。 預設值:install

指定工作的命令模式。

  • 安裝 - install 命令會偵測目前的作系統和架構,以從 GitHub 版本下載對應的表示法 CLI。 它也會針對 ./data 資料夾中的黃金檔案驗證所下載檔案的總和檢查碼,並將表示法新增至PATH。
  • 簽署 - sign 命令會下載選取的表示法外掛程式、驗證其總和檢查碼,然後在表示法 CLI 上呼叫 以簽署。
  • 驗證 - verify 命令會視 Notation CLI 的要求,將信任存放區和信任原則從使用者的程式代碼存放庫傳輸到 Notation 組態資料夾。 然後它會叫用表示法 CLI 來執行驗證。

isCustomVersion - 自定義版本
boolean。 選擇性。 command = install時使用 。 預設值:false

指定 true,藉由指定 url 屬性中自定義版本的自定義版本,為工作提供自定義版本的表示法。


version - 版本
stringcommand = install && isCustomVersion = false時為必要項。 預設值:1.3.2

要安裝的表示法版本。 範例:1.0.0、1、1.0、1.0.0。


url - 下載 URL
stringcommand = install && isCustomVersion = true時為必要項。

要使用的自訂表示法版本的 URL,例如:https://github.com/notaryproject/notation/releases/download/v1.0.0/notation_1.0.0_linux_amd64.tar.gz


checksum - 總和檢查碼
stringcommand = install && isCustomVersion = true時為必要項。

所下載檔案的 SHA-256 總和檢查碼。


artifactRefs - 成品參考
string。 選擇性。 command = verify || command = sign時使用 。

用於簽署的容器成品參考。 如果未指定,工作會使用先前 Docker 推送工作中的成品參考。 範例: <registry name>/<repository name>@<digest>. 多個成品參考必須以逗號分隔。


signatureFormat - 簽章格式
string。 選擇性。 (command = sign || command = verify) && command = sign時使用 。 允許的值:cosejws。 預設值:cose

簽章信封格式。


allowReferrersAPI - [實驗性] 允許查閱者 API
boolean。 選擇性。 command = sign || command = verify時使用 。 預設值:false

使用「查閱者 API」簽署簽章,如果不支援則為 「傳回 404」,後援至「查閱者」標籤架構。


plugin - 外掛程式
stringcommand = sign時為必要項。 允許的值:azureKeyVault (Azure Key Vault 外掛程式)。 預設值:azureKeyVault


akvPluginVersion - 外掛程式版本
stringplugin = azureKeyVault && command = sign時為必要項。 預設值:1.2.1

要安裝的 Azure Key Vault 外掛程式版本。 如需可用的版本,請參閱 表示法-azure-kv 版本頁面


azurekvServiceConection - Azure Key Vault 服務連線
string。 選擇性。 plugin = azureKeyVault && command = sign時使用 。

如果您想要使用服務連線進行驗證,請選取金鑰保存庫的 Azure 訂用帳戶。


keyid - 金鑰識別碼
stringplugin = azureKeyVault && command = sign時為必要項。

密鑰標識碼是 Azure Key Vault 的金鑰或憑證標識碼。


caCertBundle - 憑證套件組合檔案路徑
string。 選擇性。 plugin = azureKeyVault && command = sign時使用 。

憑證套件組合檔案與跟證書和所有中繼憑證,從跟證書開始,遵循憑證鏈結中的順序。


selfSigned - 自我簽署憑證
boolean。 選擇性。 plugin = azureKeyVault && command = sign時使用 。 預設值:false

憑證是否為自我簽署憑證。


timestampURL - 時間戳 URL
string。 選擇性。 command = sign時使用 。

RFC 3161 時間戳授權單位 (TSA) 伺服器 URL。 (需要表示法 v1.2.0 或更新版本)。


timestampRootCert - 時間戳跟證書
string。 選擇性。 command = sign時使用 。

時間戳授權單位跟證書的 filepath。 (需要表示法 v1.2.0 或更新版本)。


trustPolicy - 信任原則檔案路徑
stringcommand = verify時為必要項。

相對於存放庫 檔案 信任原則的路徑。 範例: ./path/to/trust-policy.json.


trustStore - 信任存放區資料夾路徑
stringcommand = verify時為必要項。

目錄的路徑,包含與存放庫相關的 信任存放區。 範例: ./path/to/truststore/.


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性

輸出變數

沒有。

備註

表示法工作會呼叫表示法 CLI 來執行簽署和驗證作業。 表示法 CLI 是用來簽署和驗證 Docker 容器成品或映像的工具。 簽署成品時,表示法會簽署成品的唯一指令清單描述元,並將簽章附加至相同的存放庫。 驗證成品時,表示法會從存放庫擷取簽章,並針對信任存放區中的憑證進行驗證。

先決條件

  • 此工作需要公用網路存取權,以從 Github 版本下載 Notation CLI 和 Notation Azure Key Vault 外掛程式。
  • 支援的代理程式 OS:Linux x64/ARM64、Windows x64、macOS x64/ARM64

表示法安裝命令

install 命令會偵測目前的作系統和架構,以從 GitHub 版本下載對應的表示法 CLI。 它也會針對 ./data 資料夾中的黃金檔案驗證所下載檔案的總和檢查碼,並將表示法新增至PATH。

表示法符號命令

sign 命令會下載選取的表示法外掛程式、驗證其總和檢查碼,然後在表示法 CLI 上呼叫 以簽署。

表示法驗證命令

verify 命令會視 Notation CLI 的要求,將信任存放區和信任原則從使用者的程式代碼存放庫傳輸到 Notation 組態資料夾。 然後它會叫用表示法 CLI 來執行驗證。

需求

要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 沒有
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 2.144.0 或更新
工作類別 效用