이쿠의 슬기로운 개발생활

함께 성장하기 위한 보안 개발자 EverNote 내용 공유

반응형

클라우드 165

98. kube-bench

kube-bench 목표 kubernetes 취약점 점검 tool은 kube-bench 사용법에 대해 알아봄 kube-bench란? Aqua security에서 개발한 것으로 kube-bench는 kubernetes cluster가 보안적으로 안전하게 구성되어있는지 검사해주는 tool임. CIS Kubernetes Benchmark 문서를 기반으로 kubernetes cluster의 취약점을 확인해줌. 취약점 scan 결과를 PASS, FAIL, WARN 3가지로 출력해주고 FAIL, WARN 항목에 대해서는 Remediations 항목에서 어떻게 하면 개선되는지 가이드까지 해줌. CIS Benchmark 란? CIS(Center for Internet Security, 비영리 조직)에서 배포하는 보안 ..

Ansible playbook에서 sudo 사용하기

Ansible playbook에서 sudo 사용하기 문제 상황 Ansible로 host에 접속해야하는데 해당 host는 ssh접속 시 root계정은 막혀있음. 일반 계정으로 ssh 접속 가능. 하지만 Ansible로 확인해야하는 파일은 root 권한이 있어야 확인 가능함. 이를 해결하기 위해 Ansible 접속 시 일반 계정으로 접속해서 sudo 명령으로 진행해야함. 환경 [host] SSH 접속 : root 차단, centos 계정으로 접속 가능 확인해야하는 파일 경로 : /root/rootTempFile.txt 문제가 되는 ansible playbook [예제 playbook] --- - hosts: all tasks: - name: execute the script command: cat /root..

Ansible, Hashicorp vault container 연동

Ansible, Hashicorp vault container 연동 환경 [Ansible Server] CentOS7 ip : 10.0.2.10 [원격 Server] CentOS7 ip : 10.0.2.7 Docker를 사용한 방법 사전 작업 docker 설치 yum update -y yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum install -y docker-ce systemctl start docker systemctl enable docker.service 작업 폴더 생성 mkd..

97. Container 관련 기술 리서치

Container 관련 기술 리서치 개발하는데 Container에 대한 자세한 이해가 필요해서 Container관련 기술에 대해서 글로 정리하며 다시 한번 복습 및 리서치를 진행해봄. 리서치와 복습만이 살길이다....ㅠㅠ Container란? 제가 아는 내용을 설명드릴려고 하면 일단 Linux와 Windows는 별개로 설명드려야할 것 같음. linux Container linux container는 리눅스 네임스페이스(Linux namespaces), 컨트롤 그룹(cgroup), 루트 디렉터리 격리(chroot) 등의 커널 기능을 활용해서 linux 커널을 공유하면서 프로세스를 격리된 환경에서 실행하는 기술임. [container의 대표적인 특징] 1. stateless하게 동작해서 container 상..

Ansible "to use the 'ssh' connection type with passwords, you must install the sshpass program"

Ansible 에러 정리 "to use the 'ssh' connection type with passwords, you must install the sshpass program" [오류상태] fatal: [10.0.2.7]: FAILED! => {"failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"} [원인] host에 sshpass가 설치되어있지 않아서 발생 [해결법] CentOS : yum install -y sshpass Ubuntu : apt-get install -y sshpass

96. kubeadm 설치 에러 : kubelet error

failed to run Kubelet: misconfiguration: kubelet cgroup driver: \"systemd\" 상황 kubeadm을 사용해서 kubernetes cluster 구성 시 error 발생함 [사용한 명령어] kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.0.2.15 ERROR MSG [kubeadm Err msg] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s [kubelet-c..

95. Portieris (v0.12.2)

Portieris [Container image 인증 관련 글 목록] Notary Service 란? Docker Notary : Docker Content Trust (DCT) DCT를 사용해서 Dcoker Hub에 서명된 Trust Image Push 하기 Notary와 DCT를 사용해서 Private Registry에 서명된 Trust Image Push하기 개인 인증서를 사용해서 Notary Service 구동 kubernetes image인증 - Portieris kubernetes image인증 - Portieris2 목표 Portieris가 update되면서 설치 과정이 간편해짐. kubernetes에서 인증된 image 만 cluster에 배포되도록하는 Portieris addon을 설치,..

Ansible directory, file 생성 후 file 내용 추가

localhost에 directory, file 생성 후 내용 추가 (file 모듈) playbook 예제 --- - hosts: localhost connection: local become: true tasks: - name: Creates directory file: path: ~/test state: directory - name: Creates file file: path: ~/test/test.txt state: touch - name: insert String in file lineinfile: path: ~/test/test.txt line: "insert test data!!!" File, lineinfile module 사용 playbook 실행 ansible-playbook -i ho..

Ansible Play boock "Are you sure you want to continue connecting (yes/no)" 항목 Pass 하는 법

Ansible Play boock "Are you sure you want to continue connecting (yes/no)" 항목 Pass 하는 법 문제 상황 Ansible로 여러 host를 자동화로 관리해야하는데 아래와 같은 상황이 발생해서 key 입력을 해줘야함. key입력 없이 한번에 자동으로 되야하는데 매우 곤란한 상황이 발생함. 원인 Ansible Server에서 manager node(원격 host)에 최초 ssh 접속 시도를 하면 사용자에게 해당 host에 접속을 할 것 인지 확인을 거치게 됨. host에 접속이 최초인지 아닌지 ssh가 확인하는 방법은 Known_hosts 파일을 통해서 진행함. Known_hosts 파일에 host의 내용이 존재하지 않으면 해당 메세지를 출력해서 ..

Ansible 파일, 디렉터리 삭제 (file 모듈)

파일, 디렉터리 삭제 (file 모듈) playbook 예제 --- - hosts: all remote_user: root become: true tasks: - name: delete file file: path: /temp/{{item}} state: absent with_items: - test.sh - sample.txt - name: delete directory file: path: /temp/ state: absent 파일 삭제의 경우 shell 모듈을 사용해서 명령을 통해 제거도 가능하지만 file 모듈을 사용해서 제거해보기로 함. file 모듈은 state: absent를 사용하여 대상 파일을 제거함. 파일이 없는 경우 무시하고 지나감 with_item 를 사용하여 여러 파일을 삭제할 수..

반응형