ref: https://www.cyberark.com/resources/threat-research-blog/securing-kubernetes-clusters-by-eliminating-risky-permissions
本篇文章是一個基礎分享文,整個主軸圍繞於 Authentication 與 Authorization 兩大塊,同時透過這兩大概念的介紹來分享一些會可能會有資安問題的設定
開頭作者探討了 Kubernetes 的架構,並且將 API Server 這個重點核心拿來出探討,提到為了存取 Kubernetes API,使用者必須要經過三個階段的處理,分別是
Authentication, Authorization 以及 Admission Control
接者用一個簡單的流程來說明上述三者的差異,假設今天有一個 Client 想要請求 API Server 幫忙創建一個 Pod 的物件。
首先 API Server 會針對該請求進行 Authentication 的檢查,通常情況下會使用 Certificate, Tokens, Basic Authentication(username/password) 來判別。
如果通過後,則會進入到 Authorization 的階段,該階段要判別發送當前 Request 的 Client 是否擁有創建 Pod 的權限,如果有權限就會把相關操作交給後續的 Admission Control 來處理。
文章中舉了一個名為 AlwaysPullImages 的 Admission Controller,該 Controller 對於一個多用戶的 Kubernetes Cluster 來說特別有用,主要是用來確保使用者 A 想要使用的 Private Image 不能被使用者 B 存取。
試想一個情況,假設今天使用者 A 順利於 NodeA 上抓取了自己的 Private Image,那使用者 B 假如很剛好知道這個 Image 的名稱,是不是有機會就可以不需要相關權限直接使用 NodeA 上的 Image?
所以這個 Admission Controller 就是用來避免這個問題的。
接者作者從 Authentication 與 Authorization 中個挑選一個方式來介紹並且講解這兩者如何結合的。
Authentication 使用的是 Service Account Token,管理會事先於 Kubernetes 內創立一個相關的 Service Account,並且把該 SA(Service Account) 的 Token 給交給 Client(Kubeconfig 也可)
Client 發送 HTTPS 請求到 API Server 的時候就可以夾帶這個 Token 的資訊,這樣 API Server 就會去檢查該 Token 是否存在於 Cluster 內。
事實上當每個 Pod 被創立後, Kubernetes 預設情況下就會將該 namespace 下的 service account 資訊給掛載到該 Pod 內的 "/var/run/secrets/kubernetes.io/serviceaccount" 這個路徑
這樣該 Pod 就可以使用該 Service Account Token 的資訊與 API Server 溝通。
Authorization 則是使用 RBAC 的方式來處理, RBAC 由三個部分組成,分別是 Role(代表可以針對 Cluster 進行什麼樣類型的操作,譬如 create pod, delete pod), Subject(你是誰,譬如 Service Account), RoleBinding(用來將 Role 與 Subject 給綁定)
管理員要創建並且管理這些叢集的話,就要好好的去設計這三個物件的關係,來確保最後的 Client 可以擁有剛剛好符合其需求的權限,千萬不要為了懶散而給予過多權限。
接者作者列舉了五種 Risky permissions 的可能情境
1. Listing secrets
大部分的應用程式開發者都會使用 secret 的物件來管理一些機密資訊,如帳號密碼,憑證等,所以一個擁有 list secrets 的 service account 其實是相對危險的。
非必要的話,不要讓管理員以外的任何使用者有這個權限,特別是使用 ClusterRole/ClusterRoleBinding 時要特別注意
2. Creating a pod with a privileged service account
假設今天有一個攻擊者已經獲得一個可以創建 pod 的 service account,那該攻擊者已經可以很順利的於叢集內創建 Pod 去進行基本操作(譬如挖礦)
如果攻擊者很巧地又知道目標 namespace 內存在一個很強的 service account,它就有辦法讓他創立的 Pod 去使用這個很強的 Service Account 並且進行更多後續操作
3. Impersonating privileged accounts
作者提到 Impersonating 這個 Role 裡面的動作要特別小心使用,擁有這個權限的使用者可以輕鬆化身為其他的使用者/群組
舉例來說,一個擁有 Impersonating -> users/group 的 serviceaccount 是沒有辦法看到任何 secrets 的物件。
但是攻擊者只要使用的時候加上 --as=null --as-group=system:master 則就會變成如 master 般的上帝擁有這些權限
因此這種權限設定上要特別小心
4. Reading a secret – brute-forcing token IDs
5. Creating privileged RoleBindings
後續兩個有興趣的可以參考全文,都是滿有趣的一些想法,值得閱讀擴展自己的認知
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
「basic authentication」的推薦目錄:
- 關於basic authentication 在 矽谷牛的耕田筆記 Facebook 的最讚貼文
- 關於basic authentication 在 Charles Mok 莫乃光 Facebook 的最佳貼文
- 關於basic authentication 在 陳婉容 Sherry Facebook 的精選貼文
- 關於basic authentication 在 コバにゃんチャンネル Youtube 的最佳貼文
- 關於basic authentication 在 大象中醫 Youtube 的最讚貼文
- 關於basic authentication 在 大象中醫 Youtube 的最佳貼文
- 關於basic authentication 在 "Basic Authentication" in Five Minutes - YouTube 的評價
basic authentication 在 Charles Mok 莫乃光 Facebook 的最佳貼文
Are you concerned about security of video conferencing tools? This will be a useful free webinar for all to understand what to do and how to adopt best practices to their own scenarios.
Topic : “Security tips for using video conferencing tools during the pandemic period”
Date: 22-April, 2020 (Wed)
Time: 11:00am – 12:00pm (HK Time)
Webinar link will be sent to you after receiving your registration request submitting to
info-hk@wizlynxgroup.com
with following required information:
1) Name 2) Company Name, 3) work email address, 4) Job title.
=============================================
We are going to host a free webinar on next Wed 22-Apr 2020, 11am-12pm.
Topic : “Security tips for using video conferencing tools during the pandemic period”
Date: 22-April, 2020 (Wed)
Time: 11:00am – 12:00pm (HK Time)
Webinar link: To be provided after receiving the registration request (See 1.3)
As the coronavirus pandemic situation getting serious in recent weeks, video conferencing are more frequently used to communicate with your peers and clients, as a good security practice, have you ever evaluated the security level of video conferencing tools that are being used? Are there any default settings that are vulnerable and easily exploited by the attacker? Any possibility that your sensitive meeting conversation leaks owing to the misconfiguration or poor setup.
1.1 The webinar is hosted by #wizlynx for users who are new to video conferencing tools because of the pandemic situation, its purpose is to provide good security recommendations summarized below:
1. Basic security guidelines to launch a secure video conference
2. Recommended default video conferencing setting in general
3. Recommended security best practices using video conferencing tools
4. Good practices for co-hosting conferencing (Internal or external)
5. To protect your meeting with sufficiency authentication
1.2 The webinar will be conducted in English with Cantonese supporting.
1.3 Webinar link will be sent to you after receiving your registration request submitting to info-hk@wizlynxgroup.com with following required information:
1) Name 2) Company Name, 3) work email address, 4) Job title.
Please be noted it is not this webinar’s intention to compare different tools/brands, therefore it will not focus on a particular tool's setting but aiming to provide general security tips for setting up similar video conferencing tools. Audiences can apply it according to their own environment.
Michael Lo
basic authentication 在 陳婉容 Sherry Facebook 的精選貼文
Yubico 贊助香港抗爭者世上最強網上保安鎖匙Yubikey
我們八月的時候聯絡瑞典網上保安科技公司 Yubico,解釋香港警察侵犯被捕者及抗爭者私隱的問題,希望他們可以贊助香港抗爭者五百條Yubikey。想不到會收到Yubico回覆,在核實我們身份後,非常慷慨地向我們寄出了五百條Yubikey。
甚麼是Yubikey?它可能是全球最有名的硬件二部認證(hardware 2-step authentication)方式。即是說,很多支援二部認證的軟件或操作系統(如最普及的Facebook﹑Google﹑Instagram﹑macOS﹑Microsoft等)都可以用Yubikey加強保安。簡單來說,它就是一條安全金鑰,當你用browser登入戶口時,在輸入密碼時要再插入「手指」才可進入戶口。任何人沒有這條手指都進不了你的戶口,別說黑警,連專業hacker都爆不入。
Yubikey安全嗎?很多專家認為Yubikey「unhackable」,是最安全的網上保安方式,Google也要求八萬多員工利用Yubikey做二部認證,因國家級黑客可以輕易bypass短訊和一次性密碼認證,但bypass不了Yubikey。
現在我們正準備將五百條Yubikey循不同渠道發放給民間記者及抗爭者。贊助的Yubikey是Security Key by Yubico型號,不支援NFC,但有齊基本二部認證功能。假如大家負擔得起,又有需要,可以去www.yubico.com買更高端的Yubikey,最貴那條好像也不過60美元。
最後,在此感謝Yubico的慷慨贊助,好人一生平安!
Swedish Online Security Company Yubico sponsors Hong Kong protesters with Yubikey, the world's strongest online security key
Amidst grave concern over the online security of protesters in face of aggravating police abuse of power, we contacted Yubico in August, hoping that they would kindly sponsor Hong Kong protesters with their feature product: Yubikey. It was to our surprise that Yubico swiftly responded and mailed us 500 Yubikey in no time.
So, what is Yubikey? Yubikey is probably the best form of hardware authentication device that offers extra security with 2-step authentication. In other words, OS or software that support 2-step authentication (e.g. Facebook, Instagram, macOS, Microsoft, Google) can be made even more secure with Yubikey. When you access your account on your browser, you will be prompted to enter your password, and then your Yubikey. No one without the key is able to break into your account, not even professional hackers, let alone HKPF.
Can Yubikey really secure your laptop? Many tech experts call it "unhackable", and it is probably the best way of online security in the world. Google also requires its 85,000+ employees to use Yubikey in place of OTP (one-time password) and or one-time codes, for physical security keys are just this much harder for hackers to bypass.
We are now planning to disseminate the keys through different channels to journalists and protesters. The model sponsored is "Security Key by Yubico", a budget Yubikey with all basic 2-step authentication features. You may see other affordable options on www.yubico.com.
Last but not least - Thanks Yubico for your kind sponsorship! We wish you all the best!
basic authentication 在 "Basic Authentication" in Five Minutes - YouTube 的必吃
Learn what " Basic Authentication " is, how it's used, and what the HTTP Request looks like!#Authentication #BasicAuth ... ... <看更多>