Skip to content

[INITOS-JONGSEOK] - bootc-esxii-pipeline - #16

Merged
yureutaejin merged 5 commits into
cloud-club:mainfrom
jskim096:main
Jun 23, 2025
Merged

[INITOS-JONGSEOK] - bootc-esxii-pipeline#16
yureutaejin merged 5 commits into
cloud-club:mainfrom
jskim096:main

Conversation

@jskim096

@jskim096 jskim096 commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

https://github.com/jskim096/init-os-image/blob/main/jongseok/bootc-esxi-pipeline/README.md

Description

  • Github Action을 이용한 ESXi VM 자동화 파이프라인 형성

  • KISA의 리눅스 취약점 분석 평가 가이드 중 *'계정의 wheel 그룹 권한' 과 파일 경로에 따른 권한 변경 불가' 에 초점을 두었음

  • 과연 컨테이너 파일에 KISA 취약점 분석 가이드를 반영한 뒤, 생성한 OS에 대해 사용자가 설정을 바꾸면 바뀔까?

@github-actions
github-actions Bot requested review from yucori and yureutaejin June 17, 2025 13:08

@yureutaejin yureutaejin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

배포까지 -완-해버린.... 👍

Comment on lines +9 to +13
VM_NAME: git-vm
VM_CPU: 2
VM_MEM: 4
VM_DISK: 30
VM_NETWORK: "VM Network"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM 옵션을 configuration file로 만들거나, workflow_dispatch.inputs filed를 사용해서 상황에 맞게 동적으로 제공하는 것도 좋을 것 같습니다.

Comment on lines +45 to +51
- name: Serve ISO
run: |
ISO_FILENAME="${IMAGE_NAME}-${IMAGE_VERSION}.iso"
cd output
mv $ISO_DIRNAME/bootiso/install.iso $ISO_FILENAME
nohup python3 -m http.server 8080 --bind 0.0.0.0 > http.log 2>&1 &
echo $! > http.pid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to use working-directory syntax

Comment on lines +56 to +60
ISO_FILENAME="${IMAGE_NAME}-${IMAGE_VERSION}.iso"
RUNNER_IP=$(hostname -I | awk '{print $1}')
sshpass -p "${{ secrets.ESXI_PASS }}" ssh -o StrictHostKeyChecking=no \
${{ secrets.ESXI_USER }}@${{ secrets.ESXI_HOST }} \
"wget http://$RUNNER_IP:8080/$ISO_FILENAME -O /vmfs/volumes/${{ secrets.ESXI_DATASTORE }}/$ISO_FILENAME"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is rsync or scp package not available?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오... rsync 스크립트로 변경분만 넘기면 네트워크 대역폭도 적게 차고 동기화할 수 있군요 구웃 배워갑니다

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 IaC 선호하다보니 이렇게 일반 프로그래밍 언어로도 가능하다는 것을 잊었네요.
상태가 아닌 절차로 수행되는데 오류 발생이 크게 없는 편인가요?

## 피드백
- 버튼 한 번으로 ESXi VM 자동화 생성 및 버전 관리에 가능성에 대해 놀람

- 테스트 과정에서 rm -rf /etc 가 모두 삭제되어서 당황했으나 bootc rollback으로 복구

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


- 레지스트리 Harbor에 컨테이너 이미지를 Push할 때 중복 데이터를 정확히 고려하지 않아 아쉬움 (태그로 관리하면 될까?)

- 여기서 CI/CD는 모르지만 테스트와 알림까지 더해지면 좋을 듯 No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- Containerfile에는 **서비스 개념보단 OS에 초점을 맞춤**

- KISA의 리눅스 취약점 분석 평가 가이드 중 **'계정의 wheel 그룹 권한'** 과 **'파일 경로에 따른 권한 변경 불가'** 에 초점을 두었음

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought :
Harbor 배포 때 --with-trivy 넣거나, 컨테이너 이미지 빌드 후 vulnerability scanning step을 넣는 것으로 충족이 안될 지

fyi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아직까진 OS 초기 보안 설정에 대해 자동으로 설정해주는 과정은 없는 것고 자체적으로 자동화 툴(스크립트나 Ansible)을 만드는듯...
매번 담당자가 가이드 따라하면서 손으로 하기 때문에 누락되기도 해서 애매함 (나도 몇번 누락ㅎㅎ)

이건 자동화하려는 움직임같은데 자료 찾다가 가져옴!
http://isweb.joongbu.ac.kr/~jbuis/2023/report-2023-4.pdf

@yureutaejin yureutaejin changed the title [INITOS-JONGSEOK] - [bootc-esxii-pipeline] [INITOS-JONGSEOK] - bootc-esxii-pipeline Jun 18, 2025

@yucori yucori left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기승전결이 너무 좋았어요 덕분에 공부가 많이 됐습니다!

```
Self-Runner는 ESXi로 SSH로 접근하고 wget을 통해 Bootc(Self-Runner)로 접근하여 ISO 파일을 다운로드

* scp로 ISO 2.6GB를 넘기려했으나 3시간 이상이 소요되어 방법을 바꾸었고 8초로 단축

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scp에서 wget으로 전송 방식을 전환했을 때, 소요 시간이 단축되는 이유가 무엇인가요??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scp는 SSH기반 프로토콜인데 너무 오래걸려서ㅠ
보안 무시하고 HTTP를 이용하여 디렉토리를 공유하고 파일을 wget으로 가져왔어요!
대신 보안이 취약해서 이렇게 하면 안될거에여ㅎㅎ

@yureutaejin
yureutaejin merged commit ba03acb into cloud-club:main Jun 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants