AEWS2기

· AEWS2기
실습3(This webhook is for mutating pods that will require AWS IAM access) For the webhook to inject a new Token into our Pod, we are going to create a new Kubernetes Service Account, annotate our Service Account with an AWS IAM role ARN, and then reference this new Kubernetes Service Account in a Kubernetes Pod. The eksctl tool can be used to automate a few steps for us, but all of these steps can..
· AEWS2기
실습2 - Kubernetes Service Accounts Kubernetes Pods are given an identity through a Kubernetes concept called a Kubernetes Service Account. When a Service Account is created, a JWT token is automatically created as a Kubernetes Secret. This Secret can then be mounted into Pods and used by that Service Account to authenticate to the Kubernetes API Server. # 파드2 생성 cat
· AEWS2기
보안 컨텍스트 내용과 실습 참고 책 ⇒ 쿠버네티스 완벽 가이드 👍🏻 쿠버네티스 완벽 가이드 - 예스24 일본 아마존 쿠버네티스 분야 베스트셀러 1위! 쿠버네티스 버전 1.18로, 쿠버네티스의 기본부터 실무까지 총망라! 쿠버네티스 환경, 버전, kubectl 버전, 그 외 시스템 버전 업데이트! 쿠버네티스 1.1 www.yes24.com 컨테이너 보안 컨텍스트 SecurityContext - 링크 ← 파드가 아님음 주의! 각 컨테이너에 대한 보안 설정 → 침해사고 발생 시 침해사고를 당한 권한을 최대한 축소하여 그 사고에 대한 확대를 방치 종류개요 privileged 특수 권한을 가진 컨테이너로 실행 capabilities Capabilities 의 추가와 삭제 allowPrivilegeEscalation..
· AEWS2기
Kyverno : K8S Native Policy Mgmt [EKS Workshop] Policy management with Kyverno - Link Managing Pod Security on Amazon EKS with Kyverno - 링크 & PSS - Link Kyverno (Greek for “govern”) is a policy engine designed specifically for Kubernetes. It is a Cloud Native Computing Foundation (CNCF) project allowing teams to collaborate and enforce Policy-as-Code. Kyverno allows for declarative Kubernetes re..
· AEWS2기
(최성욱님) 악성코드분석님 : EKS pod가 IMDS API를 악용하는 시나리오 - 링크 Github Youtube mysql 배포 cat /etc/profile MyDnzHostedZoneId=$(aws route53 list-hosted-zones-by-name --dns-name "${MyDomain}." --query "HostedZones[0].Id" --output text) echo $MyDomain, $MyDnzHostedZoneId # 사용 리전의 인증서 ARN 확인 CERT_ARN=`aws acm list-certificates --query 'CertificateSummaryList[].CertificateArn[]' --output text` echo $CERT_ARN cat Me..
· AEWS2기
EKS → 액세스 구성 모드 확인 : EKS API 및 ConfigMap ← 정책 중복 시 EKS API 우선되며 ConfigMap은 무시됨 기본 정보 확인 access policy, access entry, associated-access-policy - Link Docs User-facing_roles # EKS API 액세스모드로 변경 aws eks update-cluster-config --name $CLUSTER_NAME --access-config authenticationMode=API # List all access policies : 클러스터 액세스 관리를 위해 지원되는 액세스 정책 ## AmazonEKSClusterAdminPolicy – 클러스터 관리자 ## AmazonEKSAdmin..
· AEWS2기
1. 노드 mapRoles 확인 # 노드 IP 확인 및 PrivateIP 변수 지정 N1=$(kubectl get node --label-columns=topology.kubernetes.io/zone --selector=topology.kubernetes.io/zone=us-east-1a -o jsonpath={.items[0].status.addresses[0].address}) N2=$(kubectl get node --label-columns=topology.kubernetes.io/zone --selector=topology.kubernetes.io/zone=us-east-1b -o jsonpath={.items[0].status.addresses[0].address}) N3=$(kubectl ..
· AEWS2기
1. [myeks-bastion] testuser 사용자 생성 # testuser 사용자 생성 aws iam create-user --user-name testuser # 사용자에게 프로그래밍 방식 액세스 권한 부여 aws iam create-access-key --user-name testuser # testuser 사용자에 정책을 추가 aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --user-name testuser # get-caller-identity 확인 aws sts get-caller-identity --query Arn kubectl whoami # EC2 IP 확인 : myeks-ba..
· AEWS2기
1. kubectl 명령어 흐름 kubectl 명령 → aws eks get-token → EKS Service endpoint(STS)에 토큰 요청 ⇒ 응답값 디코드(Pre-Signed URL 이며 GetCallerIdentity..) - 링크 STS Security Token Service : AWS 리소스에 대한 액세스를 제어할 수 있는 임시 보안 자격 증명(STS)을 생성하여 신뢰받는 사용자에게 제공할 수 있음 https://ap-northeast-2.console.aws.amazon.com/cloudtrail/home?region=ap-northeast-2#/events?EventSource=sts.amazonaws.com AWS CLI 버전 1.16.156 이상에서는 별도 aws-iam-aut..
· AEWS2기
RBAC 관련 krew 플러그인 # 설치 kubectl krew install access-matrix rbac-tool rbac-view rolesum whoami # k8s 인증된 주체 확인 kubectl whoami # Show an RBAC access matrix for server resources kubectl access-matrix # Review access to cluster-scoped resources kubectl access-matrix --namespace default # Review access to namespaced resources in 'default' kubectl rbac-tool lookup system:nodes # eks:node-bootstrapper k..
· AEWS2기
1. EKS 배포, Grafana, Kubeopsview, promtheus 설치 원클릭 설치파일 - 클라우드포메이션 기본설정 # default 네임스페이스 적용 kubectl ns default # 노드 정보 확인 : t3.medium kubectl get node --label-columns=node.kubernetes.io/instance-type,eks.amazonaws.com/capacityType,topology.kubernetes.io/zone # ExternalDNS MyDomain=myeks.net echo "export MyDomain=myeks.net" >> /etc/profile MyDomain=gasida.link echo "export MyDomain=gasida.link" >>..
yeongki0944
'AEWS2기' 카테고리의 글 목록 (2 Page)