共用方式為


Notation@0 - 表示法 v0 工作

設定表示法 CLI 的 Azure Pipepine 工作、使用表示法簽署和驗證。

Syntax

# 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.1.0' # string. Required when command = install && isCustomVersion = false. Version. Default: 1.1.0.
    #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 = sign || command = verify. 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.1.0' # string. Required when plugin = azureKeyVault && command = sign. Plugin Version. Default: 1.1.0.
    #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.

輸入

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

指定工作的命令模式。

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

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

指定 true 為工作提供自定義版本的表示法,方法是在 屬性中 url 指定自定義版本的下載URL。


version - 版本
string. 當 command = install && isCustomVersion = false 時為必要。 預設值:1.1.0

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


url - 下載 URL
string. 當 command = install && isCustomVersion = true 時為必要。

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


checksum - 校驗
string. 當 command = install && isCustomVersion = true 時為必要。

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


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

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


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

簽章信封格式。


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

如果不支援 (傳回 404) ,請使用「查閱者 API」簽署簽章,後援至「查閱者」卷標架構。


plugin - 外掛程式
string. 當 command = sign 時為必要。 允許的值: azureKeyVault (Azure 金鑰保存庫 Plugin) 。 預設值:azureKeyVault


akvPluginVersion - 外掛程式版本
string. 當 plugin = azureKeyVault && command = sign 時為必要。 預設值:1.1.0

要安裝的 Azure 金鑰保存庫 外掛程式版本。 如需可用的版本 ,請參閱 notation-azure-kv 版本頁面


azurekvServiceConection - Azure 金鑰保存庫 服務連線
string. 選擇性。 使用時機 plugin = azureKeyVault && command = sign

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


keyid - 金鑰識別碼
string. 當 plugin = azureKeyVault && command = sign 時為必要。

密鑰標識碼是 Azure 金鑰保存庫 的金鑰或憑證識別碼。


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

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


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

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


trustPolicy - 信任原則檔案路徑
string. 當 command = verify 時為必要。

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


trustStore - 信任存放區資料夾路徑
string. 當 command = verify 時為必要。

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


工作控制選項

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

輸出變數

無。

備註

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

必要條件

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

表示法安裝命令

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

表示法符號命令

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

表示法驗證命令

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

規格需求

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