1 00:00:00,359 --> 00:00:02,200 uh the title of their talk is exploiting 2 00:00:02,200 --> 00:00:04,799 kubernetes via misconfiguration y1 CSP 3 00:00:04,799 --> 00:00:06,640 environments everyone please give a warm 4 00:00:06,640 --> 00:00:10,120 welcome for and 5 00:00:11,440 --> 00:00:14,360 CH hi 6 00:00:14,360 --> 00:00:21,640 guys um hello we are L 214 we will start 7 00:00:21,640 --> 00:00:23,480 presenting M 8 00:00:23,480 --> 00:00:28,320 compettion focus on cncf Project in CSP 9 00:00:28,320 --> 00:00:31,240 environment uh we are a team consist of 10 00:00:31,240 --> 00:00:35,079 two member myself and hello my name is 11 00:00:35,079 --> 00:00:38,079 CH par currently working in security 12 00:00:38,079 --> 00:00:42,039 compliance he is King working as a s 13 00:00:42,039 --> 00:00:44,320 reliability engineer we are a bit 14 00:00:44,320 --> 00:00:46,600 nervous because our English is not 15 00:00:46,600 --> 00:00:49,160 perfect but please listen patiently 16 00:00:49,160 --> 00:00:52,520 thank you today we will talk about kuber 17 00:00:52,520 --> 00:00:56,760 etics and in Security in these four key 18 00:00:56,760 --> 00:01:00,600 areas uh first let's understand what 19 00:01:00,600 --> 00:01:04,479 kubernetes is all about uh here's so 20 00:01:04,479 --> 00:01:07,159 what we already know about container 21 00:01:07,159 --> 00:01:09,119 deployment weird a little bit 22 00:01:09,119 --> 00:01:11,720 traditional deployment involve learning 23 00:01:11,720 --> 00:01:17,520 service directly on the host OS then in 24 00:01:17,520 --> 00:01:20,560 evolved to wasure machine deployment 25 00:01:20,560 --> 00:01:23,439 where we use hypervisor technology on 26 00:01:23,439 --> 00:01:27,920 the host OS to create to create gu OS 27 00:01:27,920 --> 00:01:30,479 BMS and L Serv 28 00:01:30,479 --> 00:01:33,600 now we have evolved into container 29 00:01:33,600 --> 00:01:36,840 deployment which Lear services in 30 00:01:36,840 --> 00:01:39,439 isolated space is called service 31 00:01:39,439 --> 00:01:42,200 application container on the host away 32 00:01:42,200 --> 00:01:45,520 through through a container 33 00:01:45,520 --> 00:01:48,399 runtime uh there are many framework that 34 00:01:48,399 --> 00:01:50,960 support containers deployment but we 35 00:01:50,960 --> 00:01:55,280 focused on kubernetes 22 is popularly in 36 00:01:55,280 --> 00:01:58,600 kubernetes uh in kubernetes uh in the in 37 00:01:58,600 --> 00:02:01,880 server where the host OS is installed is 38 00:02:01,880 --> 00:02:05,000 called a node uh where a container run 39 00:02:05,000 --> 00:02:08,840 time is container d lanss uh and the 40 00:02:08,840 --> 00:02:11,879 smallest unit of deployment deployment 41 00:02:11,879 --> 00:02:16,280 is called a part which can learn on long 42 00:02:16,280 --> 00:02:18,560 one or more 43 00:02:18,560 --> 00:02:21,440 containers application containers like 44 00:02:21,440 --> 00:02:24,200 engine X web server or database in the 45 00:02:24,200 --> 00:02:27,680 part Along on what we called work node 46 00:02:27,680 --> 00:02:30,519 which also have component like 47 00:02:30,519 --> 00:02:34,080 kuet or KU proxy for kubernetes 48 00:02:34,080 --> 00:02:36,080 kubernetes 49 00:02:36,080 --> 00:02:39,280 operations there's also Master node that 50 00:02:39,280 --> 00:02:42,680 container uh that control this work node 51 00:02:42,680 --> 00:02:45,920 but doesn't Lear application Services uh 52 00:02:45,920 --> 00:02:48,519 the master node has a static part to 53 00:02:48,519 --> 00:02:51,040 control worker node and in the static 54 00:02:51,040 --> 00:02:53,920 part there are component like kuo API 55 00:02:53,920 --> 00:02:57,480 server a scheduler and control manager 56 00:02:57,480 --> 00:03:02,040 and um etcd which we which is used uh 57 00:03:02,040 --> 00:03:05,360 used as a data storaging from this slide 58 00:03:05,360 --> 00:03:08,280 please make sure to remember a API 59 00:03:08,280 --> 00:03:12,040 server and etcd kubernetes environment 60 00:03:12,040 --> 00:03:15,640 which consist of more than one W node 61 00:03:15,640 --> 00:03:19,000 and master note is called 62 00:03:19,000 --> 00:03:24,080 cluster so how does a user control kuet 63 00:03:24,080 --> 00:03:27,640 is uh first users need to communicate in 64 00:03:27,640 --> 00:03:30,720 the API server on the Master node to 65 00:03:30,720 --> 00:03:35,040 control to node remotely to do so uh 66 00:03:35,040 --> 00:03:40,319 they use the API server you port and API 67 00:03:40,319 --> 00:03:44,239 token secondly users send send out 68 00:03:44,239 --> 00:03:47,680 request to API server using kuber CTL or 69 00:03:47,680 --> 00:03:52,439 kubernetes C Tool uh to ex execute kuber 70 00:03:52,439 --> 00:03:56,239 CTL uh we need to define 71 00:03:56,239 --> 00:04:00,079 various uh kubernetes control through y 72 00:04:00,079 --> 00:04:04,319 file which is a key Focus for us uh this 73 00:04:04,319 --> 00:04:07,480 y file a type of manifest file in Json 74 00:04:07,480 --> 00:04:11,400 format control kubernetes object demon 75 00:04:11,400 --> 00:04:14,480 set deployment and jobs object control 76 00:04:14,480 --> 00:04:18,238 part deployment strage service control 77 00:04:18,238 --> 00:04:22,240 part Network networking and comp map set 78 00:04:22,240 --> 00:04:25,919 environment value valubles for nodes and 79 00:04:25,919 --> 00:04:29,960 part it also said all L based access 80 00:04:29,960 --> 00:04:33,720 control for API tokens and low PA 81 00:04:33,720 --> 00:04:35,639 security 82 00:04:35,639 --> 00:04:40,880 policies to comp uh yamile you need to 83 00:04:40,880 --> 00:04:44,080 Define four essential field API server 84 00:04:44,080 --> 00:04:48,520 version kind metadata as spe the object 85 00:04:48,520 --> 00:04:53,120 is specified in the kind field well 86 00:04:53,120 --> 00:04:56,440 various options for controlling kues are 87 00:04:56,440 --> 00:04:58,639 also 88 00:04:58,639 --> 00:05:02,280 defined the thir step is sending file uh 89 00:05:02,280 --> 00:05:05,360 sending the yam file to the API server 90 00:05:05,360 --> 00:05:08,720 using an API token transmittable via 91 00:05:08,720 --> 00:05:11,130 HTTP in JWT 92 00:05:11,130 --> 00:05:12,440 [Music] 93 00:05:12,440 --> 00:05:16,360 format in a bit more detail the process 94 00:05:16,360 --> 00:05:19,319 processes follows the this structure 95 00:05:19,319 --> 00:05:22,160 when a user request the API server using 96 00:05:22,160 --> 00:05:26,360 using a yam file with KUB CTL and on API 97 00:05:26,360 --> 00:05:29,759 token the API server verified the low 98 00:05:29,759 --> 00:05:33,160 associated with the token and 99 00:05:33,160 --> 00:05:36,200 execute the request Define the yo 100 00:05:36,200 --> 00:05:38,160 [Music] 101 00:05:38,160 --> 00:05:42,080 file the master note then use this 102 00:05:42,080 --> 00:05:45,919 yamile to manage worker nodes 103 00:05:45,919 --> 00:05:49,520 accordingly uh next what Lisk does 104 00:05:49,520 --> 00:05:53,960 kubernetes have uh first you can you can 105 00:05:53,960 --> 00:05:57,280 first uh first you can take over a part 106 00:05:57,280 --> 00:05:59,639 by exploiting bability in the appli 107 00:05:59,639 --> 00:06:01,759 application learning in the container 108 00:06:01,759 --> 00:06:03,639 within the 109 00:06:03,639 --> 00:06:07,240 Pod after the PA take over they might 110 00:06:07,240 --> 00:06:11,000 escalate privilege from the work node to 111 00:06:11,000 --> 00:06:13,400 m to the master node and 112 00:06:13,400 --> 00:06:14,720 [Music] 113 00:06:14,720 --> 00:06:18,599 cluster lastly they could use the part 114 00:06:18,599 --> 00:06:22,840 API to API token to access the secret in 115 00:06:22,840 --> 00:06:26,199 the master node etcd such as database 116 00:06:26,199 --> 00:06:30,360 credential API Keys T certification stif 117 00:06:30,360 --> 00:06:35,759 case and H SSH Keys uh this is our main 118 00:06:35,759 --> 00:06:38,720 scenario to be 119 00:06:38,720 --> 00:06:42,560 discussed so how can we make it easier 120 00:06:42,560 --> 00:06:47,440 to exploit such as a simil complex 121 00:06:47,520 --> 00:06:51,120 scenario to take over to take over the 122 00:06:51,120 --> 00:06:54,240 work node of the PA takeover a shadow 123 00:06:54,240 --> 00:06:56,639 and one day exploit and security policy 124 00:06:56,639 --> 00:06:59,840 Mis comination are required uh po 125 00:06:59,840 --> 00:07:03,680 nobilities that all rce and liile Lead 126 00:07:03,680 --> 00:07:06,560 are absolutely necessary absolutely 127 00:07:06,560 --> 00:07:09,440 necessary for many services unloaded to 128 00:07:09,440 --> 00:07:13,160 The Container the work node as in the 129 00:07:13,160 --> 00:07:16,440 master node in inter node communication 130 00:07:16,440 --> 00:07:20,879 is at risk even without J and one day 131 00:07:20,879 --> 00:07:23,800 exploit if the low based accesses 132 00:07:23,800 --> 00:07:26,639 control setting the all setting of the 133 00:07:26,639 --> 00:07:31,720 AP token is mismate is is configured our 134 00:07:31,720 --> 00:07:34,520 presenting presentation focuses on the 135 00:07:34,520 --> 00:07:37,039 dis B security policy and law based 136 00:07:37,039 --> 00:07:39,400 Access Control 137 00:07:39,400 --> 00:07:42,280 setting uh there are many security 138 00:07:42,280 --> 00:07:45,720 policies that can be defined in yamile 139 00:07:45,720 --> 00:07:50,599 in kues but we will cover four poost pi 140 00:07:50,599 --> 00:07:53,800 and three security context 141 00:07:53,800 --> 00:07:58,199 option when deploying a path if host p 142 00:07:58,199 --> 00:08:01,240 is true in the Y while you can read the 143 00:08:01,240 --> 00:08:04,680 work node process from the PA as you can 144 00:08:04,680 --> 00:08:09,319 see in the ight image but host when host 145 00:08:09,319 --> 00:08:13,680 p is first only the part uh processes in 146 00:08:13,680 --> 00:08:17,120 the output when the PS a command is 147 00:08:17,120 --> 00:08:20,919 execute executed in the path if host p 148 00:08:20,919 --> 00:08:24,639 is true as shown in the lower image low 149 00:08:24,639 --> 00:08:27,360 light imag the work noes process is 150 00:08:27,360 --> 00:08:30,000 output along with the 151 00:08:30,000 --> 00:08:30,960 PA 152 00:08:30,960 --> 00:08:35,080 processes if this option is true and on 153 00:08:35,080 --> 00:08:39,559 AER hijacking AER hijack a b we becomes 154 00:08:39,559 --> 00:08:43,080 easier to exploit further because they 155 00:08:43,080 --> 00:08:45,720 can see the node 156 00:08:45,720 --> 00:08:48,959 processes the following is allow 157 00:08:48,959 --> 00:08:52,200 probility escalation in security context 158 00:08:52,200 --> 00:08:55,519 this security policy allows binaries 159 00:08:55,519 --> 00:08:59,200 with senu ID set to be execute executed 160 00:08:59,200 --> 00:09:04,240 with user privilege if is set to be C 161 00:09:04,240 --> 00:09:07,160 and allil allowability escalation is 162 00:09:07,160 --> 00:09:09,959 first when you're trying to read the ETC 163 00:09:09,959 --> 00:09:13,959 Shadow ET Shadow file with loot 164 00:09:13,959 --> 00:09:17,279 privilege escalation is not 165 00:09:17,279 --> 00:09:21,480 possible uh if it is said to True uh it 166 00:09:21,480 --> 00:09:25,040 led to escalation escarate permission 167 00:09:25,040 --> 00:09:29,560 and lead to itc's Shadow file 168 00:09:29,560 --> 00:09:33,240 uh now let's devel into cap capability 169 00:09:33,240 --> 00:09:36,160 within the security context capabilities 170 00:09:36,160 --> 00:09:40,279 allow us to segment L Corner commissions 171 00:09:40,279 --> 00:09:43,040 selectively uh granting some of this 172 00:09:43,040 --> 00:09:45,640 corner privileges from the work node to 173 00:09:45,640 --> 00:09:48,680 the part while the while there are are 174 00:09:48,680 --> 00:09:51,839 numberous type of capability assigning 175 00:09:51,839 --> 00:09:55,240 privileg such as she's admin and that 176 00:09:55,240 --> 00:10:00,200 admin to a part to a part can introduce 177 00:10:00,200 --> 00:10:01,480 significant 178 00:10:01,480 --> 00:10:05,800 risk uh for example supposed we add net 179 00:10:05,800 --> 00:10:09,000 alom capability to our part and deploy 180 00:10:09,000 --> 00:10:13,120 it uh without this capability operation 181 00:10:13,120 --> 00:10:15,640 like bring down the internet General 182 00:10:15,640 --> 00:10:19,880 interfaces will fail uh however with net 183 00:10:19,880 --> 00:10:22,040 admin permission the path can 184 00:10:22,040 --> 00:10:26,519 successfully execute uh interet Z down 185 00:10:26,519 --> 00:10:29,440 effectively uh contr controlling the 186 00:10:29,440 --> 00:10:32,839 network interface part of the work node 187 00:10:32,839 --> 00:10:35,680 this mean with the right right 188 00:10:35,680 --> 00:10:39,560 capability a part and part can 189 00:10:39,560 --> 00:10:43,040 manipulate critical resource of the work 190 00:10:43,040 --> 00:10:46,440 node highlighting highlighting the 191 00:10:46,440 --> 00:10:49,880 importance of cous capability 192 00:10:49,880 --> 00:10:52,600 segment 193 00:10:52,600 --> 00:10:55,839 assignment uh the last security context 194 00:10:55,839 --> 00:11:00,480 fil give gives the part of sa privileges 195 00:11:00,480 --> 00:11:03,480 as the work note this is probably 196 00:11:03,480 --> 00:11:06,720 developed for debugging purpose but it 197 00:11:06,720 --> 00:11:09,839 is it is a probility that you really 198 00:11:09,839 --> 00:11:13,600 need to be careful about when operation 199 00:11:13,600 --> 00:11:16,279 uh service and shown in the figure 200 00:11:16,279 --> 00:11:20,200 figure on the right if you set privilege 201 00:11:20,200 --> 00:11:24,480 too true for the part you you 202 00:11:24,480 --> 00:11:30,399 can access our list and the work note 203 00:11:30,399 --> 00:11:33,200 let's now look at the kubernetes L based 204 00:11:33,200 --> 00:11:35,399 access control settings to put this 205 00:11:35,399 --> 00:11:39,880 simply uh L based Access Control created 206 00:11:39,880 --> 00:11:42,320 uh service account to use kubernetes 207 00:11:42,320 --> 00:11:45,680 Grant service account all low to control 208 00:11:45,680 --> 00:11:50,200 no and part and Grant this to the API 209 00:11:50,200 --> 00:11:52,800 token in this presentation we will 210 00:11:52,800 --> 00:11:55,920 explain the permission assigned assigned 211 00:11:55,920 --> 00:11:57,920 to the servicer 212 00:11:57,920 --> 00:12:01,440 account first first the kubernetes admin 213 00:12:01,440 --> 00:12:03,880 create is service account and the 214 00:12:03,880 --> 00:12:07,360 service account is assigned on API 215 00:12:07,360 --> 00:12:12,200 token then a l is created the L consist 216 00:12:12,200 --> 00:12:15,639 of resource and bir for example if the 217 00:12:15,639 --> 00:12:19,600 resource is a part and the verbs are 218 00:12:19,600 --> 00:12:23,360 leased this law will be able to check 219 00:12:23,360 --> 00:12:27,360 the list of part and you can 220 00:12:27,360 --> 00:12:31,000 distinguish whether it's low is for the 221 00:12:31,000 --> 00:12:35,839 entire cluster or a specific l space now 222 00:12:35,839 --> 00:12:39,560 perform finding that grants a low to the 223 00:12:39,560 --> 00:12:42,600 service account if it is for the entire 224 00:12:42,600 --> 00:12:46,880 cluster for from cluster Ro binding and 225 00:12:46,880 --> 00:12:49,800 if it is for a specific dat space 226 00:12:49,800 --> 00:12:54,040 perform Ro binding finally Define the 227 00:12:54,040 --> 00:12:57,560 service account B the low in the yire 228 00:12:57,560 --> 00:13:00,120 that deploys to part 229 00:13:00,120 --> 00:13:02,720 then the part can control the kubernetes 230 00:13:02,720 --> 00:13:05,959 resource using the API token according 231 00:13:05,959 --> 00:13:08,959 to the low bound to the service 232 00:13:08,959 --> 00:13:12,320 account the most important things here 233 00:13:12,320 --> 00:13:15,199 is to the setup resources and birth 234 00:13:15,199 --> 00:13:18,440 correctly when created a low a good set 235 00:13:18,440 --> 00:13:21,920 good set case like the one the left is 236 00:13:21,920 --> 00:13:26,160 have Earth that watch the node part and 237 00:13:26,160 --> 00:13:29,399 the secret lers we focus on the follow 238 00:13:29,399 --> 00:13:33,040 following cases and determine that they 239 00:13:33,040 --> 00:13:37,399 are bable the resource is not and the 240 00:13:37,399 --> 00:13:41,279 verb are patch or the resource and 241 00:13:41,279 --> 00:13:46,120 secret and the verbs is G and 242 00:13:51,519 --> 00:13:55,279 list hi I amim this is my first 243 00:13:55,279 --> 00:13:58,160 overseeing presentation so I very 244 00:13:58,160 --> 00:13:59,959 nervous 245 00:13:59,959 --> 00:14:02,638 oh thank 246 00:14:02,920 --> 00:14:07,079 you let's see how we can explain the 247 00:14:07,079 --> 00:14:09,399 scenarios based on the information we 248 00:14:09,399 --> 00:14:11,720 have learned so 249 00:14:11,720 --> 00:14:14,560 far we will explain how to obtain 250 00:14:14,560 --> 00:14:17,800 credential thr to different scenarios 251 00:14:17,800 --> 00:14:21,160 all of our scenarios proceed assuming 252 00:14:21,160 --> 00:14:25,040 that an attacker has hij a walker node 253 00:14:25,040 --> 00:14:28,079 in the first scenario the attacker node 254 00:14:28,079 --> 00:14:30,399 has a part deploy that has a lot of 255 00:14:30,399 --> 00:14:33,120 privileges such as the ability to read 256 00:14:33,120 --> 00:14:35,759 information about secret the second 257 00:14:35,759 --> 00:14:38,240 scenario we will assume that the path 258 00:14:38,240 --> 00:14:41,360 that can patch no is deployed on a node 259 00:14:41,360 --> 00:14:44,279 controlled by the teer and a path that 260 00:14:44,279 --> 00:14:47,399 can read secret is deployed on another 261 00:14:47,399 --> 00:14:50,160 note this is a scenario where the 262 00:14:50,160 --> 00:14:52,639 attacker induced a path that can read a 263 00:14:52,639 --> 00:14:55,120 secret to be deployed on a node 264 00:14:55,120 --> 00:14:57,880 controlled by the teer our scenarios 265 00:14:57,880 --> 00:15:01,399 were tested in the the AWS 266 00:15:01,399 --> 00:15:03,720 environment this screen shows the 267 00:15:03,720 --> 00:15:07,440 overall flow of the first scenario as 268 00:15:07,440 --> 00:15:10,759 mentioned earlier by utilizing the demon 269 00:15:10,759 --> 00:15:14,320 feature that is deployed all on all note 270 00:15:14,320 --> 00:15:17,199 aner can access a part deployed as a 271 00:15:17,199 --> 00:15:21,160 demon from a node that can be ConEd 272 00:15:21,160 --> 00:15:23,959 however since the part has excessive 273 00:15:23,959 --> 00:15:26,639 privileges it can use those privileges 274 00:15:26,639 --> 00:15:29,720 to send a request to the AP 275 00:15:29,720 --> 00:15:32,519 and obtain credential information I will 276 00:15:32,519 --> 00:15:35,519 explain this in future detail 277 00:15:35,519 --> 00:15:39,800 now if one day bability exists and an 278 00:15:39,800 --> 00:15:43,199 application deed with mis configurated 279 00:15:43,199 --> 00:15:46,199 permission settings is open to the 280 00:15:46,199 --> 00:15:49,120 outside an attacker can access it from 281 00:15:49,120 --> 00:15:51,800 the outside throughout a one day attack 282 00:15:51,800 --> 00:15:53,639 obtain a share throughout comment 283 00:15:53,639 --> 00:15:57,240 injection or IC such as Li share and 284 00:15:57,240 --> 00:15:59,839 take control of the path 285 00:15:59,839 --> 00:16:02,639 after that the attacker can use the aay 286 00:16:02,639 --> 00:16:06,000 token in the part through the take over 287 00:16:06,000 --> 00:16:09,040 part or access the host process if the 288 00:16:09,040 --> 00:16:11,800 per permission setting are incorrect 289 00:16:11,800 --> 00:16:14,800 such as host PID security context and 290 00:16:14,800 --> 00:16:19,720 the extra or set being a able to access 291 00:16:19,720 --> 00:16:22,360 the host process means that the attacker 292 00:16:22,360 --> 00:16:26,040 can ultimately hijack the node and 293 00:16:26,040 --> 00:16:28,040 obtain information about the other 294 00:16:28,040 --> 00:16:30,600 deployed parts 295 00:16:30,600 --> 00:16:33,600 the part captured in this way can check 296 00:16:33,600 --> 00:16:35,839 the status of the part deployed under 297 00:16:35,839 --> 00:16:40,279 the body C PA pass and can the API token 298 00:16:40,279 --> 00:16:44,079 information mounted by Def in volume I 299 00:16:44,079 --> 00:16:47,120 made this process in code and wrote a 300 00:16:47,120 --> 00:16:50,800 script to obtain each Tok for each part 301 00:16:50,800 --> 00:16:55,399 U ID which is the necessory 302 00:16:55,839 --> 00:16:58,480 information this is a page to verify the 303 00:16:58,480 --> 00:17:01,639 information we obtained to verify the 304 00:17:01,639 --> 00:17:04,079 token obtained above we compared the 305 00:17:04,079 --> 00:17:07,720 token in three locations first we check 306 00:17:07,720 --> 00:17:11,480 the token stored in Baron SC kuet 307 00:17:11,480 --> 00:17:14,640 service account in the part second we 308 00:17:14,640 --> 00:17:17,599 checked the token in the path deployed 309 00:17:17,599 --> 00:17:20,839 in body coret path on the worker node 310 00:17:20,839 --> 00:17:24,280 finally we extracted only the uid with 311 00:17:24,280 --> 00:17:27,439 grab to check if the uid of the 312 00:17:27,439 --> 00:17:29,880 corresponding information 313 00:17:29,880 --> 00:17:33,520 it's the same as the path in the end we 314 00:17:33,520 --> 00:17:36,600 were able to see that the token compared 315 00:17:36,600 --> 00:17:39,440 above was actually the token of the same 316 00:17:39,440 --> 00:17:42,000 deployed 317 00:17:42,000 --> 00:17:44,760 path with the token obtained in this 318 00:17:44,760 --> 00:17:47,720 manner we were able to check what 319 00:17:47,720 --> 00:17:50,360 permissions the token was assigned to 320 00:17:50,360 --> 00:17:53,640 and what part were set with ex 321 00:17:53,640 --> 00:17:57,640 permissions dra on automation 322 00:17:57,640 --> 00:18:01,080 script for for example when rest API C 323 00:18:01,080 --> 00:18:04,440 was sent to the API server we could see 324 00:18:04,440 --> 00:18:06,679 that different response were received 325 00:18:06,679 --> 00:18:10,320 depending on whether the permissions are 326 00:18:10,320 --> 00:18:14,120 open or not as show on the screen and we 327 00:18:14,120 --> 00:18:16,400 could check the permissions set for the 328 00:18:16,400 --> 00:18:20,520 token based on the authorized 329 00:18:20,520 --> 00:18:23,799 information finally by regarding the 330 00:18:23,799 --> 00:18:26,919 tokens of our pass and sending AR rest 331 00:18:26,919 --> 00:18:30,159 API request we can check the token that 332 00:18:30,159 --> 00:18:33,000 has the excessive permissions we need 333 00:18:33,000 --> 00:18:36,320 such as the permission to retri 334 00:18:36,320 --> 00:18:39,480 Secret in this secreen to show an 335 00:18:39,480 --> 00:18:43,880 example if you send a request to API V1 336 00:18:43,880 --> 00:18:47,039 secret to get secret 337 00:18:47,039 --> 00:18:49,799 information you can obtain the store 338 00:18:49,799 --> 00:18:53,120 scret and if you base the 64 de code 339 00:18:53,120 --> 00:18:56,799 this you can check this plain 340 00:18:56,799 --> 00:19:00,039 text uh this screen shows the overall 341 00:19:00,039 --> 00:19:03,080 flow of the second scenario we have 342 00:19:03,080 --> 00:19:05,919 previously confirmed that a PA with 343 00:19:05,919 --> 00:19:08,600 accessible privileges is deployed on a 344 00:19:08,600 --> 00:19:11,440 node that can be controlled by an 345 00:19:11,440 --> 00:19:14,400 attacker this scenario is possible 346 00:19:14,400 --> 00:19:16,679 because it is deployed as a demon set 347 00:19:16,679 --> 00:19:19,799 which are characteristic of Coronet 348 00:19:19,799 --> 00:19:22,840 deployment the second scenario is to 349 00:19:22,840 --> 00:19:25,960 incude the theer to deploy a part with 350 00:19:25,960 --> 00:19:29,480 exist C PR privileges on the not that 351 00:19:29,480 --> 00:19:32,799 can be controlled by a notaker even 352 00:19:32,799 --> 00:19:35,280 though it is deployed as a different 353 00:19:35,280 --> 00:19:39,320 type of object not not 354 00:19:39,400 --> 00:19:42,480 demoned imagine there is the worke a 355 00:19:42,480 --> 00:19:44,120 controlled by 356 00:19:44,120 --> 00:19:46,720 theer which has permissions to patch 357 00:19:46,720 --> 00:19:50,559 node another part capable of accessing 358 00:19:50,559 --> 00:19:53,280 secret information is deployed on a 359 00:19:53,280 --> 00:19:55,520 different node of not 360 00:19:55,520 --> 00:19:58,280 B typically due to the deployment 361 00:19:58,280 --> 00:20:01,840 feature this part might not end up on 362 00:20:01,840 --> 00:20:03,800 the attacker 363 00:20:03,800 --> 00:20:05,360 [Music] 364 00:20:05,360 --> 00:20:09,039 node however with a token grating node 365 00:20:09,039 --> 00:20:12,360 patching Authority on work node a the 366 00:20:12,360 --> 00:20:15,200 attacker can manipulate the deployment 367 00:20:15,200 --> 00:20:18,080 causing the secret accessing part to be 368 00:20:18,080 --> 00:20:21,760 positioned on their control node for 369 00:20:21,760 --> 00:20:24,919 example if you have the authority to 370 00:20:24,919 --> 00:20:27,840 patch a note you can set a tent to 371 00:20:27,840 --> 00:20:30,400 prevent it from from being deploy 372 00:20:30,400 --> 00:20:33,840 deployed to or no or to force it to be 373 00:20:33,840 --> 00:20:37,240 deployed on only to specific node or to 374 00:20:37,240 --> 00:20:40,600 force it to be deployed to no under the 375 00:20:40,600 --> 00:20:42,840 attack 376 00:20:42,840 --> 00:20:46,320 control if you set the tent like this it 377 00:20:46,320 --> 00:20:48,760 will be deployed to a node that the 378 00:20:48,760 --> 00:20:51,400 attacker can control in the next 379 00:20:51,400 --> 00:20:52,600 deployment 380 00:20:52,600 --> 00:20:55,600 schedule since the deployed part has 381 00:20:55,600 --> 00:20:59,159 excessive permissions to check the SC 382 00:20:59,159 --> 00:21:01,240 it is possible to obtain credentials 383 00:21:01,240 --> 00:21:04,000 throughout the 384 00:21:04,000 --> 00:21:07,480 token this is to secret EXT extration 385 00:21:07,480 --> 00:21:09,840 using obtained tokens similar to our 386 00:21:09,840 --> 00:21:12,240 first 387 00:21:19,200 --> 00:21:21,840 scenario what do you think do you don't 388 00:21:21,840 --> 00:21:25,159 you think this is very un letic scenario 389 00:21:25,159 --> 00:21:28,039 or we thought we thought so for so at 390 00:21:28,039 --> 00:21:29,480 first to 391 00:21:29,480 --> 00:21:32,360 we looked for the case where uh our 392 00:21:32,360 --> 00:21:35,799 scenario happened in the real world uh 393 00:21:35,799 --> 00:21:38,960 first in the m compation security policy 394 00:21:38,960 --> 00:21:42,159 uh there was a case where PR and host P 395 00:21:42,159 --> 00:21:45,679 were true and US Kim reported this and 396 00:21:45,679 --> 00:21:48,080 has the 397 00:21:48,080 --> 00:21:51,720 CB what about L Bas access control then 398 00:21:51,720 --> 00:21:55,520 uh we were able to find a comit that 399 00:21:55,520 --> 00:21:59,240 changed the verb of secret secret to be 400 00:21:59,240 --> 00:22:03,480 restricted in KU birds and open Cruise 401 00:22:03,480 --> 00:22:06,799 which are among the various project in 402 00:22:06,799 --> 00:22:07,960 Pro 403 00:22:07,960 --> 00:22:11,400 kubernetes uh we got some ideas from 404 00:22:11,400 --> 00:22:15,480 here we we thought why don't we do some 405 00:22:15,480 --> 00:22:18,559 research on CNF project for kubernetes 406 00:22:18,559 --> 00:22:22,080 CNF has metrics defined as graduate 407 00:22:22,080 --> 00:22:25,279 incubating and sandbox and there are 408 00:22:25,279 --> 00:22:29,279 about 200 of them 409 00:22:29,279 --> 00:22:32,320 uh we Define f number pattern uh in the 410 00:22:32,320 --> 00:22:35,960 yamur FR for incubating and SAS projects 411 00:22:35,960 --> 00:22:39,679 first the secret policy mentioned of is 412 00:22:39,679 --> 00:22:42,679 set to set to true and the deployment 413 00:22:42,679 --> 00:22:46,880 strateg is demon and deployment the L is 414 00:22:46,880 --> 00:22:51,240 clear cluster L and low and in resource 415 00:22:51,240 --> 00:22:53,640 we created a pattern and analyze to 416 00:22:53,640 --> 00:22:57,640 cases where it is not patch or secret 417 00:22:57,640 --> 00:22:59,760 get list 418 00:22:59,760 --> 00:23:03,440 looking at cncf landscape uh there are 419 00:23:03,440 --> 00:23:08,159 over 140 incubating and sandbox 420 00:23:08,159 --> 00:23:11,600 project to sum up uh there were many 421 00:23:11,600 --> 00:23:14,720 miscomputation in the CNC cncf project 422 00:23:14,720 --> 00:23:19,039 yam that corresponded to the Vol pattern 423 00:23:19,039 --> 00:23:22,600 we created in the case of low based L 424 00:23:22,600 --> 00:23:25,400 based Access Control setting comparation 425 00:23:25,400 --> 00:23:28,960 there are 15 sand boxes and five 426 00:23:28,960 --> 00:23:31,520 incubating in the case of security 427 00:23:31,520 --> 00:23:34,600 police Mis compination there are 33 c 428 00:23:34,600 --> 00:23:38,559 boxes and nine 429 00:23:38,559 --> 00:23:43,159 Inu uh we found and reported a total of 430 00:23:43,159 --> 00:23:47,559 22 B cases um unfortunately there were 431 00:23:47,559 --> 00:23:51,960 some uh duplicate cases but is but it 432 00:23:51,960 --> 00:23:54,480 was interesting that were that there 433 00:23:54,480 --> 00:23:58,480 were hackers like us who find bgs also 434 00:23:58,480 --> 00:24:01,760 there was place called test test code to 435 00:24:01,760 --> 00:24:06,240 send a response mail uh we are proving 436 00:24:06,240 --> 00:24:09,720 uh that is a Le test code lastly there 437 00:24:09,720 --> 00:24:13,720 was a case that was scoped out we are 438 00:24:13,720 --> 00:24:17,279 sad uh if there is is a cncf project 439 00:24:17,279 --> 00:24:20,520 manager who received our email please 440 00:24:20,520 --> 00:24:24,559 respond however nine of nine out of 22 441 00:24:24,559 --> 00:24:27,640 reports are in the processes on of 442 00:24:27,640 --> 00:24:32,159 issuing C yes CBS I hope they will be 443 00:24:32,159 --> 00:24:35,679 issued we will looking forward to 444 00:24:35,679 --> 00:24:38,720 it uh finally let's talk about 445 00:24:38,720 --> 00:24:41,320 kubernetes security 446 00:24:41,320 --> 00:24:43,919 overload uh there are many security 447 00:24:43,919 --> 00:24:47,080 framework for kubernetes for example 448 00:24:47,080 --> 00:24:50,880 there are CIS Benchmark wasp kubernetes 449 00:24:50,880 --> 00:24:54,240 top 10 and kubernetes part security 450 00:24:54,240 --> 00:24:57,880 standard here we also advise that you 451 00:24:57,880 --> 00:25:01,120 careful senual security policy and L 452 00:25:01,120 --> 00:25:03,600 based Access Control setting as we 453 00:25:03,600 --> 00:25:06,399 explained however uh this framework 454 00:25:06,399 --> 00:25:10,679 often only check the YY created by 455 00:25:10,679 --> 00:25:14,279 kubernetes users cncf projects often do 456 00:25:14,279 --> 00:25:17,600 not check with the framework or have 457 00:25:17,600 --> 00:25:21,120 hores this is because uh we naturally 458 00:25:21,120 --> 00:25:24,320 think that is that it is said well uh 459 00:25:24,320 --> 00:25:28,640 some cncf cncf projects use the option 460 00:25:28,640 --> 00:25:31,600 because that is absolutely necessary uh 461 00:25:31,600 --> 00:25:34,200 therefore we must understanding why 462 00:25:34,200 --> 00:25:36,720 security policy and L based Access 463 00:25:36,720 --> 00:25:40,279 Control setting are necessary in cncf 464 00:25:40,279 --> 00:25:43,360 projects and uh it can be monitoring 465 00:25:43,360 --> 00:25:47,360 through cspm and CSP 466 00:25:47,360 --> 00:25:49,480 environment uh lastly there are 467 00:25:49,480 --> 00:25:51,559 supporters who helped with the 468 00:25:51,559 --> 00:25:54,120 presentation we were able to present 469 00:25:54,120 --> 00:25:56,520 today thank to the support of South 470 00:25:56,520 --> 00:25:59,919 Korea security education program B and 471 00:25:59,919 --> 00:26:03,679 Junu and you our company and I just had 472 00:26:03,679 --> 00:26:07,440 a baby Ser 473 00:26:07,440 --> 00:26:10,360 ago thank you thank I am also very 474 00:26:10,360 --> 00:26:13,679 grateful to my wife lastly I always 475 00:26:13,679 --> 00:26:17,520 thanks I would like to thank you the go 476 00:26:17,520 --> 00:26:21,960 who thought came and I about security 477 00:26:21,960 --> 00:26:24,360 thank you for listening uh if you have 478 00:26:24,360 --> 00:26:26,440 any question please please please come 479 00:26:26,440 --> 00:26:31,799 to us after this presentation thank you