自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

如何使用Docker Content Trust為容器確保安全?

譯文
安全 應(yīng)用安全
在跨聯(lián)網(wǎng)系統(tǒng)交換數(shù)據(jù)時,信任是一個關(guān)鍵問題。在通過像互聯(lián)網(wǎng)這樣不可靠的媒介進行交互時,為系統(tǒng)依賴的所有數(shù)據(jù)的發(fā)布者確保完整性尤為重要。需要強大的加密保證來保護數(shù)據(jù),這時候Docker Content Trust(DCT)有了用武之地。

?譯者 | 布加迪

審校 | 孫淑娟

在跨聯(lián)網(wǎng)系統(tǒng)交換數(shù)據(jù)時,信任是一個關(guān)鍵問題。在通過像互聯(lián)網(wǎng)這樣不可靠的媒介進行交互時,為系統(tǒng)依賴的所有數(shù)據(jù)的發(fā)布者確保完整性尤為重要。需要強大的加密保證來保護數(shù)據(jù),這時候Docker Content Trust(DCT)有了用武之地。

Docker(DCT)就基礎(chǔ)架構(gòu)中使用的軟件類型和版本提供了強大的加密保證。Docker Content Trust隨Docker版本1.8一同發(fā)布。

Docker Content Trust添加的安全措施可以檢查容器鏡像、存放應(yīng)用程序組件的容器文件以及保存在Docker Hub等注冊中心的內(nèi)容的一致性。

借助注冊中心,Docker Content Trust解決了兩個問題:

  • 從遠程存儲庫下載容器鏡像的用戶可能會上傳含有惡意軟件的鏡像,但無法驗證其完整性。
  • 其次,用戶可能會將過期的容器上傳到注冊中心,這可能影響公司的互操作性、兼容性或性能。

DCT是如何運作的?

Docker Content Trust非常簡單。Docker Content Trust基于Docker Notary工具來發(fā)布和管理可信任內(nèi)容和更新框架(TUF),后者是一種確保軟件更新系統(tǒng)安全的框架。Notary項目提供了客戶機/服務(wù)器基礎(chǔ),用于建立信任,以驗證和處理內(nèi)容集合。

用戶可以安全地獲得發(fā)布者的公鑰,然后使用公鑰來驗證內(nèi)容。Notary依賴TUF進行安全的軟件分發(fā)和更新操作。

Docker Content Trust密鑰:

鏡像標(biāo)簽的信任是通過使用簽名密鑰來管理的。DCT與鏡像的TAG(標(biāo)記)部分相關(guān)聯(lián)。當(dāng)DCT操作初次使用時,會生成一個密鑰集。

以下密鑰類組成一個密鑰集:

  • 離線密鑰,對鏡像標(biāo)記而言它是DCT的根。
  • 存儲庫或?qū)?biāo)記簽名的標(biāo)簽密鑰
  • 服務(wù)器管理的密鑰,比如時間戳密鑰,用于確保存儲庫的新鮮度安全。

鏡像標(biāo)記的信任是通過使用簽名密鑰來管理的。DCT在Docker客戶端中默認(rèn)不啟用。必須遵循以下步驟來設(shè)置DCT。

要想啟用DCT,在您的Linux docker節(jié)點上發(fā)出以下命令:

$ export DOCKER_CONTENT_TRUST=1
DOCKER_CONTENT_TRUST=0 for disabling DCT。

啟用Docker Content Trust的步驟:

  • 生成密鑰
  • 將Signer添加到Docker存儲庫中
  • 對鏡像簽名

為了舉例說明,我將使用Docker中心來執(zhí)行啟用Docker Content Trust的步驟。

第1步:登錄到Docker Hub。

dev@srini:~$ docker login
Username: srinukolaparthi
Password: ******
Login Succeeded

第2步:生成信任密鑰??尚湃蚊荑€基本上建立了您的用戶身份,并授予您對存儲庫鏡像的訪問權(quán)。

Docker trust key generate <signer name>
dev@raghu:~$ docker trust key generate srinidev
Generating key for srinidev...
Enter passphrase for new srinidev key with ID 5259740:
Repeat passphrase for new srinidev key with ID 5259740:
Successfully generated and loaded private key. Corresponding public key available: /Users/docker/srinidev.pub

第3步:將簽名者添加到Docker存儲庫中。

docker–key <keyfile> <user name> <repo>
dev@srini:~$ docker trust signer add --key srinidev.pub srinidev srinidev/springboot-test
Adding signer "srinidev" to srinidev/springboot...
Initializing signed repository for srinidev/springboot...
You are about to create a new root signing key passphrase. This passphrase
will be used to protect the most sensitive key in your signing system. Please
choose a long, complex passphrase and be careful to keep the password and the
key file itself secure and backed up. It is highly recommended that you use a
password manager to generate the passphrase and keep it safe. There will be no
way to recover this key. You can find the key in your config directory.
Enter passphrase for new root key with ID 443ffc9:
Repeat passphrase for new root key with ID 443ffc9:
Enter passphrase for new repository key with ID d6ef6dd:
Repeat passphrase for new repository key with ID d6ef6dd:
Successfully initialized "srinidev/springboot"
Successfully added signer: srinidev to srinidev/springboot

第4步:

dev@srini:~$ docker build -t srinidev/springboot:unsigned
Sending build context to Docker daemon 3.072kB
Step 1/2 : FROM busybox:latest
latest: Pulling from library/busybox
05669b0daf1fb: Pull complete
Digest: sha256:e26cd013274a657b86e706210ddd5cc1f82f50155791199d29b9e86e935ce135
Status: Downloaded newer image for busybox:latest
---> 93aa35aa1c79
Step 2/2 : CMD Hello this is busybox!
---> Running in g8ea53541c3f
Removing intermediate container k8ea53541c3f
---> 827bac2bb535
Successfully built 827bac2bb535
Successfully tagged srinidev/springboot:unsigned

第5步:將鏡像推送到Docker存儲庫。

dev@srini:~$ docker push srinidev/springboot:unsigned

第6步:執(zhí)行命令:$ export DOCKER_CONTENT_TRUST=1

第7步:運行Docker鏡像,檢查Docker Content Trust是否有效。

dev@srini:~$ docker run srinidev/springboot:unsigned
docker: No valid trust data for unsigned.
See 'docker run --help'.

由于鏡像未簽名,也沒有提供簽名數(shù)據(jù),因此無法啟動它,因為啟用了Docker Content Trust。所以很明顯,如果啟用了DCT,它將允許用戶在您的系統(tǒng)上拉取/運行鏡像。

第8步:現(xiàn)在不妨測試和構(gòu)建新的簽名鏡像。

dev@srini:~$ docker build -t srinidev/springboot:signed

第9步:使用以下命令對Docker鏡像進行簽名。

dev@srini:~$ docker trust sign srinidev/springboot:signed
Signing and pushing trust data for local image srinidev/springboot:signed,
may overwrite remote trust data
The push refers to repository [docker.io/srinidev/springboot:signed]
a6d503001157: Layer already exists
signed: digest:
sha256:e8d2db0f9cc124273e5f3bbbd2006bf2f3629953983df859e3aa8092134fa373 size: 567
Signing and pushing trust metadata
Enter passphrase for srinidev key with ID 5239740:
Successfully signed docker.io/srinidev/springboot:signed

DTS命令將生成簽名,并將簽名數(shù)據(jù)和鏡像本身推送到Docker注冊中心?;旧?,它對鏡像進行簽名,還執(zhí)行Docker推送。

第10步:運行新的Docker簽名鏡像。

dev@srini:~$ docker run srinidev/springboot:signed

結(jié)語

如果上述步驟很成功,表明Docker Content Trust奏效。要使用帶有簽名和認(rèn)證鏡像的遠程存儲庫,用戶必須啟用選擇加入的Docker Content Trust功能。

原文標(biāo)題:??How to Secure Containers Using Docker Content Trust??,作者:Srinivas Kolaparthi


責(zé)任編輯:華軒 來源: 51CTO
相關(guān)推薦

2021-10-09 08:00:00

SSH安全服務(wù)器

2020-09-22 11:34:29

物聯(lián)網(wǎng)

2021-01-13 09:41:00

物聯(lián)網(wǎng)身份驗證授權(quán)

2018-01-23 07:00:09

2021-09-14 10:25:12

云計算云計算環(huán)境云安全

2021-09-03 20:25:57

零信任網(wǎng)絡(luò)安全網(wǎng)絡(luò)攻擊

2023-05-15 17:53:54

2021-09-03 20:58:45

零信任

2014-08-18 10:09:53

2020-09-27 10:59:28

信息安全新冠疫情削減預(yù)算

2020-07-23 10:39:33

云計算云原生安全

2011-03-31 14:25:33

2019-06-21 09:54:09

Web 開發(fā)代碼

2011-03-22 17:51:57

2009-06-22 09:16:00

無線網(wǎng)絡(luò)加密網(wǎng)絡(luò)安全

2009-07-18 12:19:47

windowsU盤安全啟動

2020-11-01 16:58:13

瀏覽器緩存

2014-03-06 18:24:27

安全制度技術(shù)防御信息安全

2023-09-22 11:18:24

點贊
收藏

51CTO技術(shù)棧公眾號