Aqua容器安全解決方案_第1頁(yè)
Aqua容器安全解決方案_第2頁(yè)
Aqua容器安全解決方案_第3頁(yè)
Aqua容器安全解決方案_第4頁(yè)
Aqua容器安全解決方案_第5頁(yè)
已閱讀5頁(yè),還剩27頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

Aqua容器安全解決方案

POC測(cè)試步驟

edvance

安領(lǐng)科技

2017-10-27

Version[1.0]

版權(quán)說(shuō)明

包含于此篇文檔中的信息屬于商業(yè)或財(cái)務(wù)機(jī)密(或授權(quán))信息。文檔為安

領(lǐng)有限公司所專(zhuān)有,且只用于評(píng)估目的,除非被安領(lǐng)有限公司授權(quán),否則

此文檔的全部或者部分信息不得用于再版或者引用。

版本歷史

日期版本描述

2017-10-271.0

內(nèi)容

1.準(zhǔn)備工作5

2.鏡像掃描6

2.1白名單鏡像...................................................6

2.2禁止未掃描鏡像運(yùn)行..........................................6

2.3鏡像安裝包的黑白名單........................................6

2.4自定義規(guī)則掃描鏡像...........................................6

2.5包含敏感信息的鏡像..........................................7

2.6結(jié)合JENKINS進(jìn)行鏡像掃描......................................7

3.威脅阻止9

3.1PROCESSLIMITS..................................................................................................9

3.2只允許LINK內(nèi)容器互相通信....................................9

4.徽感信息管理10

4.1自納管SECRET...............................................................................................10

4.2CYBERARK納管SECRET....................................................................................10

5.容器運(yùn)行限制12

5.1以指定用戶(hù)運(yùn)行容器..........................................12

5.2限制容器運(yùn)行時(shí)的只讀文件...................................13

5.3限制容器運(yùn)行時(shí)的可執(zhí)行命令.................................14

5.4限制CONTAINER運(yùn)行時(shí)的進(jìn)出網(wǎng)絡(luò)...............................15

5.5黃金鏡像一保證CONTAINER不對(duì)容器內(nèi)任何文件進(jìn)行修改..........16

5.6限制CONTAINER不以特權(quán)模式運(yùn)行...............................17

5.7限制CONTAINER掛我的數(shù)據(jù)卷..................................17

5.8自主學(xué)習(xí)并生成安全規(guī)則.....................................18

5.9限制容器運(yùn)行時(shí)使用的資源及進(jìn)程數(shù)...........................19

5.10環(huán)境變量加密...............................................20

6.網(wǎng)絡(luò)控制21

6.1容器與HOST之間網(wǎng)絡(luò)限制.....................................21

6.2容器與容器間的網(wǎng)絡(luò)限制.....................................21

7.主機(jī)權(quán)限管控23

7.1角色權(quán)限管控...............................................23

7.2自定義R01E角色.............................................23

7.3通過(guò)IMAGE的LABEL來(lái)分發(fā)權(quán)限.................................24

8.其他25

8.1ROOTPLEASE容器修改主機(jī)配置文件..............................25

8.2私有REGISTRY搭建............................................25

8.3SWARM部署AQUAAGENT...............................................................................26

8.4RANCHER部署AQUAAGENT.............................................................................27

1.準(zhǔn)備工作

在DockerHost主機(jī)上安裝完AquaServer環(huán)境后,可執(zhí)行以下步驟將測(cè)試用鏡像及配置文件導(dǎo)入到環(huán)境

中。

1.將optfolder下的文件夾上傳到DockerHost的/opt路徑下

2.通過(guò)df-h命令確保測(cè)試主機(jī)/var路徑掛載磁盤(pán)剩余空間大于10G,否則導(dǎo)入鏡像會(huì)導(dǎo)致磁盤(pán)滿(mǎn)

3.將測(cè)試鏡像上傳到DockerHost主機(jī)內(nèi),并通過(guò)dockerloadstar包路徑,來(lái)導(dǎo)入測(cè)試鏡像

4.登錄AquaWeb端>>lmages?Addimages?localengine,手動(dòng)逐一添加步驟2里導(dǎo)入的鏡像文件。

除了imagescan/labeltest外都導(dǎo)入,此鏡像將用于未掃描鏡像測(cè)試。

注:如果不想逐一添加也可配置自動(dòng)拉取本地鏡像,System?lntegrations?LocalEngine〉〉勾選

AutomaticallyPullNewImages。這樣AquaAgent就會(huì)在配置的指定拉取時(shí)間拉取本地鏡像進(jìn)行掃描。

國(guó)Audit

Integrations

Administration

ModifyRegistry:LocalEngine

合Policiesv

RegistryTypeDockerEngine

ImageAssurance

Endpointunlx-y/ZVar/run/dockersock

ThreatMhigation

RuntimeProfilesegsix初var/run/dockersock

ContainerFlrewail

UserAccessControlQAutomat?ca?yPullNewImajes

Whenenabled,theserverwillautomaticallypullnewrepoartones/ima9esfromtheregistryevey

mSecrets

目Hosts

DailyPullTime03:00

QCompliance<

紫Systemv

Integrations

labels

AquaGatewaysSaveChangesICancel

Users

Settings

5.登錄AquaWebj^?Systerr)?Settings,點(diǎn)擊Import按鈕導(dǎo)入aqua_settings.json文件

6.通過(guò)groupadddocker添力口docker用戶(hù)組

2.鏡像掃描

2.1白名單鏡像

1.通過(guò)ImageAssurance內(nèi)配置,首先設(shè)置DisallowImagesbyCVESeverity,則執(zhí)行

dockerrun-v/:/hostOS-i-tchrisfosterelli/rootplease失敗

2.通過(guò)ImagiAssurance內(nèi)配置,設(shè)置chrisfcsterHIi/rcctpleasa鏡像為WhiWlistlmagp,則執(zhí)行

dockerrun-v/:/hostOS-i-tchrisfosterelli/rootplease成功

2.2禁止未掃描鏡像運(yùn)行

1.通過(guò)ImageAssurance內(nèi)配置,設(shè)置BlockUnregisteredImages,同時(shí)對(duì)應(yīng)label(key=vaule)的鏡像可

以做例外,如下圖

BlockUnregisteredImages?>

QEnablebtockunregisteredimages

Donotallowtoruncontainersfromunauthorizedimages

Whitdistimageswiththefollowingpnfix(es):

+Add

Whitdistimageswiththefollowingdockb

+Add

DOCKERLABEL

license=GPLv20

2.執(zhí)行dockerrun-dimagescan/labeltest未掃描鏡像可以正常運(yùn)行,因?yàn)榇绥R像已打了license=GPLv2

的label,如果將此例外去?■即被禁止運(yùn)行

2.3鏡像安裝包的黑白名單

1.通過(guò)ImageAssurance內(nèi),設(shè)置PackageBlacklist,禁止包含黑名單Package的鏡像運(yùn)行,可填寫(xiě)

python包,所有版本,則執(zhí)行dockerrun-dcentos被禁止

2.通過(guò)ImageAssurance內(nèi),設(shè)置PackageWhitelist,可以設(shè)置鏡像必須包含的安裝程序包,如未包含

白名單內(nèi)安裝包,鏡像將被禁止執(zhí)行,可填寫(xiě)python包,所有版本,則執(zhí)行dockerrun-dalpine被

禁止

2.4自定義規(guī)則掃描鏡像

1.通過(guò)ImageAssurance內(nèi),設(shè)置CustomChecks可以使用自定義規(guī)則腳本進(jìn)行掃描,腳本返回0則禁

用鏡像。使用默認(rèn)SSH包檢查腳本即可,任何安裝了SSH包的鏡像都將被禁用

CustomChecks

QEnablecustomchecks

Anyshellscriptthatresultsinexit-code10,willflagtheimageasdisallowed.

Note:Whenyoueditandsavecustomchecks,youneedtorescantheimagesmanuallyto

enforcethenewchecks.

>ManageScripts

Thispokeywillbeappliedtoimagesthat

containthefollowingword.SpecifythescriptthatwIBbeusedforthe

customcheck:_______

***willassignthepolicytoallimages.

Add

Example-nginx

PatternScript

*check_sshd_installed0

2.在Images頁(yè)面將imagescan/centoswithssh鏡像Rescan重新掃描

3.執(zhí)行dockerrun-it-rmimagescan/centoswithssh/bin/bash被禁止,因?yàn)榇绥R像安裝了SSH包被

Disallow

2.5包含敏感信息的鏡像

1.在System?Settings內(nèi),勾選ScanOptions1的Scansensitivedatainimages并Save

2.通過(guò)ImageAssurance內(nèi),設(shè)置DisallowImageswithSensitiveData,可以設(shè)置包含敏感信息(比如

PrivateRSAkey)的鏡像被禁止運(yùn)行

3.執(zhí)行dockerrun-dimagescan/sensitivedata失敗,因?yàn)槠?opt路徑下有id_rsa的PrivateRSAkey

2.6結(jié)合Jenkins進(jìn)行鏡像掃描

1.在Dockerhost主機(jī)上執(zhí)行:

chmod-R777/opt/jenkins

dockerrun-d\

-uroot\

-v/opt/jenkins:/var/jenkins_home\

-v/var/run/docker.sock:/var/run/docker.sock\

-v$(whichdocker):/usr/bin/docker:ro\

-v/usr/lib64/libsystemd-journal.so.O:/usr/lib/x86_64-linux-gnu/libsystemd-journal.so.O\

-v/usr/lib64/libsystemd-idl28.so.0:/usr/lib/x86_64-lirux-gnu/libsystemd-idl28.so.0\

-v/usr/lib64/libdevmapper.so.l.02:/usr/lib/x86_64-linux-gnu/libdevmapper.so.l.02\

-v/usr/lib64/libgcrypt.so.ll:/usr/lib/x86_64-linux-gnu/libgcrypt.so.ll\

-v/ui>r/lib64/libdw.bo.l:/ubr/lib/x86_64-liriux-griu/libdw.j>o.l\

-v/usr/lib64/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7\

-p9090:8080\

-namejenkins\

--restart=always\

jenkins

2.生成的ienkins可通過(guò)http:〃(DockerHostlP>:9090進(jìn)入,用戶(hù)名為admin,密碼為password。

3.進(jìn)入ManageJenkins?ConfigureSystem將以下各項(xiàng)按實(shí)際情況填寫(xiě),其中的IP地址都是docker

host測(cè)試主機(jī)的。

4.點(diǎn)擊test項(xiàng)目>>manage,諛置項(xiàng)目要掃描的鏡像名及其所屬Registry名,此處Registry名為在Aqua

Server?System?lntegrations?Registry里進(jìn)行綁定的名字,

Imagetoscan:

OLocalimage每

@Hostedimage?

Hidebaseimagevulnecabilries

5.最后運(yùn)行test項(xiàng)目的build即可,里面已添加了Aqua鏡像三描的步驟,從Consoleoutput杳看掃描

執(zhí)行結(jié)果

3.威脅阻止

3.1Processlimits

1.通過(guò)ThreatMitigation內(nèi),勾選ForkGuadr卜.的EnableForkBombProtection,設(shè)置Processlimit為

10后保存

2.執(zhí)行dockerrun-dthreattest/process,里面已開(kāi)啟了超過(guò)10個(gè)進(jìn)程,多余進(jìn)程會(huì)被禁止生成

3.2只允許Link內(nèi)容器互相通信

1.執(zhí)行以下命令生成兩個(gè)容器:

dockerrun-it-v/opt/aquatest:/usr/share/nginx/html:ro-p80:80-d-namenginxweb\

networktest/nginxweb

dockerrun-it-d-nametestcentos

生成后進(jìn)入test容器可以curl到nginx發(fā)布的網(wǎng)頁(yè)

dockerexec-ittest/bin/bash

curlhttp:〃<dockerhostip>

2.在ThreatMitigation?BlockNetworkingBetweenunlinkedContainers下勾選BlockNetwork保存后,

再次進(jìn)入test容器無(wú)法curl到網(wǎng)頁(yè)

3.重新生成新的帶link的centos訪(fǎng)問(wèn)容器即可curl到網(wǎng)頁(yè)

dockerrun-it-d-linknginxv/eb:testlinkcentos

4.敏感信息管理

4.1自納管Secret

1.通過(guò)之前的配置導(dǎo)入,前臺(tái)網(wǎng)頁(yè)Secret內(nèi)應(yīng)已有一個(gè)aqua.password

2.運(yùn)行dockerrun-it-d-namesecretsecrettest/static_password

此容器己將aqua.passwcrd作為Password環(huán)境變量打入c用戶(hù)執(zhí)行dockerinspectsecret|grpp

password只會(huì)看到Password={aqua.password),看不到真實(shí)值

3.用戶(hù)執(zhí)行dockerexec-itsecret/bin/bash進(jìn)入容器執(zhí)行env命令后,可看到真實(shí)值。同時(shí)用戶(hù)如在

前臺(tái)網(wǎng)頁(yè)端對(duì)aqua.password的值進(jìn)行更改后,容器內(nèi)對(duì)應(yīng)值也會(huì)動(dòng)態(tài)刷新到,不需要重啟容器

4.2CyberArk納管Secret

1.Aqua可以CyberArk的CCP進(jìn)行綁定配置,通過(guò)其獲取CyberArk平臺(tái)內(nèi)保存的密碼.通過(guò)

System?lntegrations?SecretKeyStores,點(diǎn)擊AddSecretKeyStore進(jìn)行綁定,其中的Test

Connection按鈕沒(méi)有任何實(shí)際作用。

ModifyKeyStore:CCP(CyberArkEnterprisePasswordVault)

QEnabled

*ConnectionURL

https:〃192.168.195/

*AppID

AIMWebService2

?Safe

Windows

PullInterval(minutes)①

1

Labels?

TestConnection

ConnecitionURL:CCP的訪(fǎng)問(wèn)地址,只需要填寫(xiě)IP地址,不需要后綴

AppID:CCP使用的AppID

Safe:獲取密碼賬號(hào)所/Safe

PullInterval:定期刷新時(shí)間(測(cè)試下來(lái)沒(méi)有實(shí)際功能,即無(wú)法將新值自動(dòng)刷新到容器內(nèi))

2.在綁定的CyberarkVault內(nèi),創(chuàng)建WindowsSafe,配置CCP相關(guān)APPID和Provider用戶(hù)對(duì)此Safe有

獲取密碼權(quán)限,同時(shí)創(chuàng)建?個(gè)測(cè)試賬號(hào),賬號(hào)名為CyberArkVaultTest

3.在Aqua網(wǎng)頁(yè)端>>Secrets?AddNewSecret,在Store處選擇步驟一新建的CyberArkStore名,在

Name處填寫(xiě)Vault內(nèi)賬號(hào)名,即CyberArkVaultTest

Secrets>NewSecret

CCP(CyberArkEnterprisePasswordVaUH)

4.點(diǎn)擊Save的同時(shí),Aqua會(huì)嘗試獲取密碼,如有報(bào)錯(cuò)會(huì)直接在頁(yè)面內(nèi)顯示出來(lái)

5.運(yùn)行dockerrunitdnamesecretsccrcttcst/static_password

此容器已將CCP.CyberArkVaultTest作為CyberArkPassword環(huán)境變量打入。用戶(hù)執(zhí)行dockerinspect

secret|grepCyber只會(huì)看到CyberArkPassword={CCP.CyberArkVaultTest},看不到真實(shí)值

6.用戶(hù)執(zhí)行dockerexec-itsecret/bin/bash進(jìn)入容器執(zhí)行env命令后,可看到真實(shí)值。

5.容器運(yùn)行限制

5.1以指定用戶(hù)運(yùn)行容器

當(dāng)運(yùn)行容器時(shí)沒(méi)以也參數(shù)指定運(yùn)行用戶(hù)環(huán)境時(shí),Docker默認(rèn)將以root用戶(hù)運(yùn)行容器,最高用戶(hù)權(quán)限所

帶來(lái)的風(fēng)險(xiǎn)可想而知。用戶(hù)可通過(guò)AquaSecurity中的Runtimeprofile來(lái)限制容器運(yùn)行時(shí)只能以當(dāng)前Host

用戶(hù)的UID和GID來(lái)運(yùn)行

IdentityInsideTheContainer

Allowcontainertorunwithanyuser

?Runinowner'susercontext.UsetheUIDandGIDoftheuserwhoexecutedthecontainer

Restrictcontainertorunwithspecificusers

Preventrootuserfromrunningcontainers

1.不加-u參數(shù)運(yùn)行容器后,得到的UID和GID為Host當(dāng)前用戶(hù)docker

dockerdocxker5dockerrun-it--nanetestruntimecentos/bin/bash

WARNING:Error叮/home/docker/.docker/config.json:permissiondenied

WARNING:YourkerneldoesnotsupportswapUnitcapabilitiesorthecgroup1snotmounted,neworyHaltedwithoutswap.

bash:/root/.bashrc二:P_e_rm_issi-on-de.nied

iid-lOOO(docker)gid-1000(docker)^roups-1000(docker),4(adn),24(cdron),27(sudo),30(tape),46(plugdev)t110(lxd),115(lpadmin),116(sambashare)

2.同時(shí)我們可以限制容器不以root用戶(hù)運(yùn)行。

IdentityInsideTheContainer

?Allowcontainertorunwilhanyuser

Runinowner'susercontext.UsetheUIDandGIDoftheuserwhoexecutedthecontainer

Restrictcontainertorunwithspecificusers

QPreventrootuserfromrurningcontainers

3.當(dāng)以root用戶(hù)運(yùn)行容器時(shí),得至ljPermissionDenied的報(bào)錯(cuò),同時(shí)AquaSecurity內(nèi)也有對(duì)應(yīng)

Block日志。運(yùn)彳亍命令為dockerrun-itruntime/runuser/bin/sh

root@aqua~]#dockerrun-itruntime/runuser/bin/sh

ernrissiondenied

r*ArlVfllib/iiiH_

Containerelastic_thompson'triedtochangeuidtouser(0)

imageruntime/runusef:atest

Contaner:eas*c.thompson

ConxanerID:d304266-a610

User:roo:

ProcessID:1

Runtme3rofileRuntr-e_Runuser

ReasonforBlockUnauthorizeduse,blockedbyrun:meprofie

5.2限制容器運(yùn)行時(shí)的只讀文件

1.用戶(hù)通常希望在Container運(yùn)行時(shí)不要對(duì)容器的一些關(guān)鍵系統(tǒng)或程序文件進(jìn)行修改,比如/etc、

/bin目錄等。AquaSecurit/可以通過(guò)RuntimeProfile來(lái)做到這點(diǎn)

Read-OnlyDirectoriesandFiles

Speedydirectororftes?oe^srictedBSreadcZy

Direct?7menuj£endMmslash/

+Add

READONLYDIRECTORYORFILE

~/etc/0

/bin/0

ExcludeList

Specrfydirectooescrfies:ha:willoeexd'jdedfremtheIts:aoo.w

4-Add

2.設(shè)置對(duì)/etc目錄的只讀后,以root用戶(hù)運(yùn)行容器仍舊無(wú)法對(duì)/etc目錄下的任何文件進(jìn)行修改。

運(yùn)行命令為dockerrun-itruntime/file/bin/sh,之后vi/etc/hostname修改文件會(huì)有如下報(bào)錯(cuò)

reerror:operationnotpermitted!

Userroot-performed7bin/busybox/etc/hostname

Image:runtime,-fie:ates:

Container:AFA二也小m

ContainerID:002567-edCOD

US?r:fOOX

UserId:0

EffectiveUser:root

EffectiveUserID:0

Category:2

Action:open

Resource:exc/hostname

ResourceDigest:

Process:

ProcessID:6

Runt*reProfie:Runtm?_PeasOniyFIe

ReasonforBlockjnauthonzedactonDeckedDyruntmeprofile

5.3限制容器運(yùn)行時(shí)的可執(zhí)行命令

i.限制用戶(hù)在容器運(yùn)行時(shí)的可執(zhí)行命令是十分重要的,其能有效避免一些誤操作所帶來(lái)的嚴(yán)重后

果。AquaSecurity可通過(guò)Runtimeprofile里的AllowedExecutables來(lái)設(shè)置容器運(yùn)行時(shí)的可執(zhí)行

命令白名單,如下圖我們只允許執(zhí)行/bin/bash命令。

AllowedExecutables

Separateallowedexecutablesforsuperandnon-supefusers

+Add

EXECUTABLEFILE

bin/besh0

bin/sh0

Ifempv.allexecuxableswi:beallc.ved

2.當(dāng)用戶(hù)試圖執(zhí)行Is命令時(shí),得至Permissiondenied的報(bào)港,同時(shí)AquaSecurity處也有對(duì)應(yīng)

Block日志。

[root@aquadockerrun-itruntime/command/bin/bash

bash:/usr/libexec/grepconf.sh:/bin/sh:badinterpreter:Permissiondeni?

bash:/usr/bin/tty:Permissiondenied

[root@533e4e669fc8I/]#Is

bash:/usr/bin/ls:Permissiondenied

[root@533e4e669fc8/]#

3.當(dāng)用戶(hù)在AllowedExecutables處加上Is命令后,此命令即可正常在容器內(nèi)執(zhí)行。即使sh腳本

中有相關(guān)命令也同樣被禁止

HSeparateallowedexecutablesforsuperandnon-superusers

+Add

EXECUTABLEFILE

/bti/bash0

/bin/sh0

/bin/ls0

Ifempty,allexecutableswillbeallowed

***??*???,??一?,?*???,■??=?■??*■*?、*??①~???=、?

[root?533e4e669fc8.q*Is

anaconda-post.logbindevetchomeliblib64lost+foundmediamntoptprocrootrunsbinsrvsystmpusrvar

[root@533e4e669fc8/]#

5.4限制Container運(yùn)行時(shí)的進(jìn)出網(wǎng)絡(luò)

1.對(duì)于Container運(yùn)行時(shí)的對(duì)外通信,用戶(hù)可以限制其進(jìn)出網(wǎng)絡(luò),從而隔絕容器不必要的網(wǎng)絡(luò)通

信。用戶(hù)可以在AquaSecurity內(nèi)Runtimeprofile的Network選項(xiàng)禁止對(duì)應(yīng)鏡像生成的Container

的對(duì)外通信。

Network

Denyinboundnetwork

QDenyoutbound旌-方產(chǎn)

2.這樣當(dāng)Container內(nèi)部嘗試與外部網(wǎng)絡(luò)通信時(shí),就會(huì)失敗。同時(shí)AquaSecurity也會(huì)記錄對(duì)應(yīng)的

Block事件。測(cè)試命令為dockerrun-itruntime/network/bin/sh

一?J?????一?

/#ping3

PING192168.200.33(3):56databytes

AC

—3pingstatistics—

120packetstransmitted,0packetsreceived,100%packetloss

/*

Userroot'performed11921682003342192

Image:runtrreretwork:ares:

Container:sleepy.kepler

ContainerID:73c7679d9481

User:root

UserId:0

EffectiveUserID:0

Category:network

Action:connect

IPAddress:19216820033

Port:42192

Process:

ProcessID:933

RuntmeProfeRumEjNsvork

ReasonforBlockNetworkconnectont/ockedbyruntimeprofile

5.5黃金鏡像一保證Container不對(duì)容器內(nèi)任何文件進(jìn)行修改

1.針對(duì)一些黃金鏡像,用戶(hù)不希望容器對(duì)其進(jìn)行任何修改。則我們可以在AquaSecurity的

runtimeprofile中的ContainerEngineControls中勾選Read-onlyrootfilesystemo

ContainerEngineControls

Thefollowingcontrolswilbeenforcedwithanycontainerexecution.Notethesecontrolswillalsobeenforcedonaudit-onlyhosts.

3Read-onlyrootfilesystem①

Nonewprivileges?

Seccompprofile:

I________________________________________________________________________________________________z]

DropCapabilities:

selectcapabilitytodrop...

2.用戶(hù)嘗試修改、新增、刪除容器內(nèi)的文件報(bào)錯(cuò),無(wú)法進(jìn)行增刪改。測(cè)試語(yǔ)句dockerrun?it

runtime/goldenimage/bin/sh

/etc#touchtest

touch:test:Read-onlyfilesystem

/art-a

—>PackageIzo.x86_640:2.06-8.el7willbeerased

——>Packagepython-decorator.noarch0:3.4.0-3.el7willbeerased

-->ProcessingDependency:python-decoratorforpackage:python-firewall-0.4.3.2-8.1.el7_3.3.noa

—>Packagepython-slip.noarch0:0.4.0-2.el7willbeerased

E45:'readonly'opticxiisset(add!tooverride)

5.6限制Container不以特權(quán)模式運(yùn)行

1.容器運(yùn)行時(shí)如果加上‘-privileged'參數(shù),即會(huì)以特權(quán)模式運(yùn)行,可訪(fǎng)問(wèn)Host上的所有設(shè)備,

此容器幾乎與主機(jī)上其他運(yùn)行的進(jìn)程一樣可訪(fǎng)問(wèn)主機(jī)資源,這將帶來(lái)十分高的安全風(fēng)險(xiǎn)。所以

我們可以通過(guò)AquaRuntimeProfile里的配置禁用特權(quán)模式運(yùn)行容器。

LockdownvX

Preventrunningexecutablenotinoriginalimage

Preventrunningcontainerwhenimageparametersarechanged①

C3Preventrunningwithelevatedprivileges(e.g.-privileged,-network:host)①

2.設(shè)置后,當(dāng)用戶(hù)再次想以特權(quán)模式運(yùn)行容器時(shí)得到'Blockedbvruntimeprofile'的報(bào)錯(cuò),同時(shí)

AquaAudit日志里也有相關(guān)Block信息,測(cè)試命令為dockerrun-it-privileged

runtime/nonprivileged/bin/sh。

[root@aqua~]#dockerrun-一pr~iv,leged"]runtime,'nonpr「vi~leged/bin/sh

docker:Errorresponsefromdaemon:[Aqua-security]YOUdonothavepermissiontoexecutethiscommand,

see'dockerrun--help'.

v08Nov05:USOPM*BlockUserroocrancommand-ce”onnostaqua

dockercreateruntim?/nonpnvihg?d:late3t

Host:aqud

imageName:runtfne/nonprtvle9eclaiesr

UserAccewRule:Runtime.Nonprivile^ec

ReasonforBlockOontawextendedpri?legeswLeWocKedbyruntimeprofile

5.7限制Container掛載的數(shù)據(jù)卷

1.掛載數(shù)據(jù)卷是Container容器間分享永久數(shù)據(jù)的一種方式,這些永久數(shù)據(jù)通常都會(huì)影響應(yīng)用運(yùn)

行時(shí)的配置,一些誤操作的寫(xiě)入可能會(huì)導(dǎo)致Container內(nèi)的應(yīng)用無(wú)法正常運(yùn)行,所以針對(duì)掛載

數(shù)據(jù)卷的限制也是十分必要的。我們可以通過(guò)AquaRuntimeProfile里的Allowedvolumes配置

來(lái)指定Container運(yùn)行時(shí)允許掛載的數(shù)據(jù)卷及其寫(xiě)入讀取權(quán)限。

Volumes

Allowedvolumes:

ReadWrite,+Add

MountPathAccess

/daxa/caxareaoonly0

2.當(dāng)用戶(hù)想要掛載其他數(shù)據(jù)卷時(shí),得到‘Blockedbyruntirreprofile'的報(bào)錯(cuò)。同樣當(dāng)用戶(hù)想要以

ReadWrite權(quán)限掛載時(shí)也會(huì)報(bào)錯(cuò),運(yùn)行語(yǔ)句為dockerrun-rm-it-v/data:/dataruntime/volumes

/bin/sho必須指定ro權(quán)限才能正確掛載,,運(yùn)行語(yǔ)句為dockerrun-rm-it-v/data:/da:a:ro

runtime/volumes/bin/sh。

[root@aquadockerrun--rm-it-vuntime/volumes/bin/sh

docker:Errorresponsefromdaemon:[Aquasecurity]YOUdonothavepermissiontoexecutethiscommand.centaln<

See'dockerrun-help".

[root@aquadockerrun--rm-it-v/data:/data:roruntime/volumes/bin/sh

5.8自主學(xué)習(xí)并生成安全規(guī)則

1.有時(shí)我們自定義的規(guī)則無(wú)法滿(mǎn)足一些復(fù)雜的Container運(yùn)行情景,此時(shí)我們可以讓Aqua進(jìn)行自

主學(xué)習(xí),其會(huì)根據(jù)指定image生成的Container運(yùn)行情況,自動(dòng)生成對(duì)應(yīng)的Container運(yùn)行規(guī)則。

如下圖,我們?cè)贏quaSystem及image級(jí)別開(kāi)啟了自動(dòng)Profile生成。

AutomaticProfilingOptions

QProfileallimagesautomatically①

Enforcementmode①:EnforceAuditOnly

Learningphaseduration(inmnutes):10

Learningphaseduration(inexecutions):2

?UseDefault

>centos

QProfileAutomatically

>jenkins

UseExisting

>jiihiintii

CreateNew

>kam/pingUseProfiler

>leam/tutorial

>nginx071

7nginxG5Aqia.defaul

nginxlatest0(approved)。310

nginxvi?3A10AOSelectLab(

nginxvltestaqua①3A10AO

2.待配置的10分鐘學(xué)習(xí)時(shí)間過(guò)后,Aqua即會(huì)根據(jù)之前Container運(yùn)行的情況,自動(dòng)生成對(duì)應(yīng)的

運(yùn)行規(guī)則,用戶(hù)可在此基礎(chǔ)上再進(jìn)行自定義調(diào)整。

,NameMnxIoolwn9iHeAvailableProfiUControh

Oeser0MAutomaticallygeneratedbyAqua

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論