-
Notifications
You must be signed in to change notification settings - Fork 51
SecurityGroup Management Guide(KR)
ByoungSeob Kim edited this page Feb 4, 2026
·
2 revisions
- 사용자는 Security Group을 생성하여 VM의 inbound/outbound 네트워크 트래픽을 제어할 수 있다.
- Security Group은 특정 VPC에 소속되며, 하나 이상의 보안 규칙(Security Rules)을 포함할 수 있다.
- CB-Spider Security Group은 허용 규칙(Allow Rule)을 정의하는 방식으로 동작한다.
- Security Group과 VM 간의 관계는 아래 그림과 같다.
┌─────────────────────────────────────────────────────────────┐
│ CB-Spider Security Group │
│ │
│ VPC (10.0.0.0/16) │
│ ├── SecurityGroup-1 │
│ │ ├── Rule: Inbound TCP 22 from 0.0.0.0/0 │
│ │ ├── Rule: Inbound TCP 80 from 0.0.0.0/0 │
│ │ └── Rule: Outbound ALL -1 to 0.0.0.0/0 │
│ │ └── Applied to: VM-1, VM-2 │
│ │ │
│ └── SecurityGroup-2 │
│ ├── Rule: Inbound TCP 3306 from 10.0.0.0/16 │
│ ├── Rule: Outbound ALL -1 to 0.0.0.0/0 │
│ └── Applied to: VM-3 │
└─────────────────────────────────────────────────────────────┘
Security Group 생성 시 default Rule은 다음과 같으며, CSP별로 관련 Rule이 보일 수도 있고 안보일 수도 있다:
- inbound: 모든 트래픽 차단
- outbound: 모든 트래픽 허용
각 Security Rule은 다음과 같은 속성으로 정의된다:
| 속성 | 설명 | 예시 |
|---|---|---|
| Direction | 트래픽 방향 |
inbound | outbound
|
| IPProtocol | 대상 프로토콜 |
ALL, TCP, UDP, ICMP
|
| FromPort | 시작 포트 | TCP/UDP: 1~65535ICMP/ALL: -1
|
| ToPort | 종료 포트 | TCP/UDP: 1~65535ICMP/ALL: -1
|
| CIDR | 적용 대상 주소 범위 |
0.0.0.0/0, ::/0, 10.0.0.0/16 등 |
- 사용자는 다음과 같은 CB-Spider REST API를 이용하여 Security Group 정보를 JSON 규격으로 제공받는다.
# Security Group 관리
POST /spider/securitygroup - Create SecurityGroup
GET /spider/securitygroup - List SecurityGroups
GET /spider/securitygroup/vpc/{VPCName} - List SecurityGroups in VPC
GET /spider/securitygroup/{Name} - Get SecurityGroup
DELETE /spider/securitygroup/{Name} - Delete SecurityGroup
# Security Group 등록/해제 (기존 CSP Security Group 연동)
POST /spider/regsecuritygroup - Register SecurityGroup
DELETE /spider/regsecuritygroup/{Name} - Unregister SecurityGroup
# Security Group 목록 조회 (전체)
GET /spider/allsecuritygroup - List All SecurityGroups (CB-Spider + CSP)
GET /spider/allsecuritygroupinfo - List All SecurityGroups Info
# Security Group 통계
GET /spider/countsecuritygroup - Count All SecurityGroups
GET /spider/countsecuritygroup/{ConnectionName} - Count SecurityGroups by Connection
# CSP Security Group 직접 삭제
DELETE /spider/cspsecuritygroup/{Id} - Delete CSP SecurityGroup
# Security Rules 추가/삭제
POST /spider/securitygroup/{SGName}/rules - Add Rules
DELETE /spider/securitygroup/{SGName}/rules - Remove Rules
Security Group 정보 (SecurityInfo)
| 필드 | 설명 | 예시 |
|---|---|---|
| IId | Security Group의 식별자 정보 (NameId, SystemId) | ● {Name: "sg-01", SystemId: "sg-1234abcd"} |
| VpcIID | 소속 VPC의 식별자 정보 (NameId, SystemId) | ● {Name: "vpc-01", SystemId: "vpc-5678efgh"} |
| SecurityRules | Security Rule 정보 리스트 | ● 아래 Security Rule 정보 참조 |
| TagList | Security Group에 할당된 태그 리스트 | ● [{Key: "Environment", Value: "Production"}] |
| KeyValueList | CSP가 제공하는 추가 정보를 Key/Value List 형태로 제공 | ● [{Key: "GroupId", Value: "sg-1234"}] |
Security Rule 정보 (SecurityRuleInfo)
| 필드 | 설명 | 예시 |
|---|---|---|
| Direction | 트래픽 방향 | ● "inbound", "outbound" |
| IPProtocol | 프로토콜 유형 | ● "TCP", "UDP", "ICMP", "ALL" |
| FromPort | 시작 포트 번호 | ● "22", "80", "1", "-1"(ALL/ICMP) |
| ToPort | 종료 포트 번호 | ● "22", "80", "65535", "-1"(ALL/ICMP) |
| CIDR | 적용 대상 IP 주소 범위 (CIDR 표기) | ● "0.0.0.0/0", "10.0.0.0/16", "::/0" |
프로토콜별 Security Rule 세부 규칙
| Direction | IPProtocol | FromPort | ToPort | CIDR | 비고 |
|---|---|---|---|---|---|
| inbound, outbound | ALL | -1 | -1 | 0.0.0.0/0, ::/0 등 | 모든 트래픽 허용 |
| inbound, outbound | TCP | 1~65535 | 1~65535 | 0.0.0.0/0 등 | 예: SSH(22), HTTP(80), HTTPS(443) |
| inbound, outbound | UDP | 1~65535 | 1~65535 | 0.0.0.0/0 등 | 예: DNS(53), NTP(123) |
| inbound, outbound | ICMP | -1 | -1 | 0.0.0.0/0 등 | 네트워크 계층, 포트 불필요 예: ping, traceroute |
- AWS에서 SSH와 HTTP 접근을 허용하는
sg-webSecurity Group을 생성하는 API 호출 및 결과 예시가 다음과 같다.
curl -sX 'POST' 'http://localhost:1024/spider/securitygroup' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"Name": "sg-web",
"VPCName": "vpc-01",
"SecurityRules": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "22",
"ToPort": "22",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "80",
"ToPort": "80",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "443",
"ToPort": "443",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "outbound",
"IPProtocol": "ALL",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
}
]
}
}' | jq응답 예시:
{
"IId": {
"NameId": "sg-web",
"SystemId": "sg-0a1b2c3d4e5f67890"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "22",
"ToPort": "22",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "80",
"ToPort": "80",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "443",
"ToPort": "443",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "outbound",
"IPProtocol": "ALL",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
}
],
"KeyValueList": [
{
"Key": "GroupId",
"Value": "sg-0a1b2c3d4e5f67890"
},
{
"Key": "GroupName",
"Value": "sg-web"
}
]
}- AWS
sg-webSecurity Group 정보 호출 API 및 제공 정보 예시가 다음과 같다.
curl -sX 'GET' 'http://localhost:1024/spider/securitygroup/sg-web?ConnectionName=aws-config01' | jq응답 예시:
{
"IId": {
"NameId": "sg-web",
"SystemId": "sg-0a1b2c3d4e5f67890"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "22",
"ToPort": "22",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "80",
"ToPort": "80",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "443",
"ToPort": "443",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "outbound",
"IPProtocol": "ALL",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
}
]
}curl -sX 'GET' 'http://localhost:1024/spider/securitygroup?ConnectionName=aws-config01' | jq응답 예시:
{
"securitygroup": [
{
"IId": {
"NameId": "sg-web",
"SystemId": "sg-0a1b2c3d4e5f67890"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [...]
},
{
"IId": {
"NameId": "sg-db",
"SystemId": "sg-1b2c3d4e5f678901"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [...]
}
]
}curl -sX 'GET' 'http://localhost:1024/spider/securitygroup/vpc/vpc-01?ConnectionName=aws-config01' | jq응답 예시:
{
"securitygroup": [
{
"IId": {
"NameId": "sg-web",
"SystemId": "sg-0a1b2c3d4e5f67890"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [...]
}
]
}- 기존 Security Group에 새로운 Rule을 추가하는 API 호출 예시가 다음과 같다.
curl -sX 'POST' 'http://localhost:1024/spider/securitygroup/sg-web/rules' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"RuleInfoList": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "3306",
"ToPort": "3306",
"CIDR": "10.0.0.0/16"
},
{
"Direction": "inbound",
"IPProtocol": "ICMP",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
}
]
}
}' | jq응답 예시:
{
"IId": {
"NameId": "sg-web",
"SystemId": "sg-0a1b2c3d4e5f67890"
},
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-1a2b3c4d"
},
"SecurityRules": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "22",
"ToPort": "22",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "80",
"ToPort": "80",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "443",
"ToPort": "443",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "3306",
"ToPort": "3306",
"CIDR": "10.0.0.0/16"
},
{
"Direction": "inbound",
"IPProtocol": "ICMP",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
},
{
"Direction": "outbound",
"IPProtocol": "ALL",
"FromPort": "-1",
"ToPort": "-1",
"CIDR": "0.0.0.0/0"
}
]
}curl -sX 'DELETE' 'http://localhost:1024/spider/securitygroup/sg-web/rules' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"RuleInfoList": [
{
"Direction": "inbound",
"IPProtocol": "TCP",
"FromPort": "3306",
"ToPort": "3306",
"CIDR": "10.0.0.0/16"
}
]
}
}' | jq응답 예시:
{
"Result": "true"
}curl -sX 'DELETE' 'http://localhost:1024/spider/securitygroup/sg-web' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01"
}' | jq응답 예시:
{
"Result": "true"
}- VM 등이 연결된 Security Group을 강제 삭제할 경우
force=true옵션을 사용한다.
curl -sX 'DELETE' 'http://localhost:1024/spider/securitygroup/sg-web?force=true' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01"
}' | jq-
다음 순서로 대상 CSP 선택 및 Security Group 정보를 관리한다.
- Connection 선택: AdminWeb 상단에서 대상 CSP Connection 선택
- Security Group 메뉴 접근: 좌측 메뉴에서 "Security Group" 선택
- Security Group 생성: "Create SecurityGroup" 버튼 클릭 후 필요한 정보 입력
- Security Rules 관리: Security Group 상세 화면에서 Rules 추가/삭제 가능
AdminWeb에서 Security Group 목록을 조회하면 다음과 같은 정보가 표시된다:
- Security Group Name
- Security Group SystemId (CSP ID)
- VPC Name
- Rules 개수
- 생성 시간
- 작업 버튼 (상세보기, 삭제 등)
AdminWeb에서 Security Group 생성 시 다음 정보를 입력한다:
- Security Group Name: CB-Spider에서 관리할 Security Group 이름
- VPC Name: Security Group이 소속될 VPC
-
Security Rules (1개 이상 권장):
- Direction (inbound/outbound)
- Protocol (ALL/TCP/UDP/ICMP)
- Port Range (FromPort ~ ToPort)
- CIDR (IP 주소 범위)
- Tags (선택)
Security Group 상세 화면에서는 다음 정보와 작업이 가능하다:
기본 정보:
- Security Group IId (NameId, SystemId)
- VPC IId (NameId, SystemId)
- KeyValueList (CSP 추가 정보)
Security Rules 관리:
- Security Rules 목록 표시
- Add Rules 버튼: 새 Rule 추가
- Remove Rules 버튼: 개별 Rule 삭제
- Rule 상세 정보 보기 (Direction, Protocol, Port, CIDR)
작업 버튼:
- Delete SecurityGroup: Security Group 삭제
- Refresh: 정보 갱신
- Security Group 생성 (Create SecurityGroup)
- Inbound Rules 추가:
- SSH: TCP 22 from 관리자 IP
- HTTP: TCP 80 from 0.0.0.0/0
- HTTPS: TCP 443 from 0.0.0.0/0
- Outbound Rules: ALL -1 to 0.0.0.0/0 (기본)
- VM 생성 시 해당 Security Group 지정
- Security Group 생성
- Inbound Rules 추가:
- MySQL: TCP 3306 from 애플리케이션 서버 CIDR (예: 10.0.1.0/24)
- SSH: TCP 22 from 관리자 IP
- Outbound Rules: 필요 시 제한적으로 설정
- DB 서버 VM에 해당 Security Group 적용
- CSP에 이미 존재하는 Security Group의 정보 확인 (SystemId)
- Register SecurityGroup API를 통해 CB-Spider에 등록
- CB-Spider에서 해당 Security Group 관리 및 Rules 추가/삭제 가능
-
Web Tier Security Group:
- Inbound: TCP 80, 443 from Internet
- Outbound: TCP 3000 to App Tier CIDR
-
App Tier Security Group:
- Inbound: TCP 3000 from Web Tier CIDR
- Outbound: TCP 3306 to DB Tier CIDR
-
DB Tier Security Group:
- Inbound: TCP 3306 from App Tier CIDR
- Outbound: 최소 권한
-
CIDR 설정:
0.0.0.0/0은 모든 IP를 허용하므로 보안상 주의 필요 - 포트 범위: FromPort ≤ ToPort 관계 유지 필요
-
프로토콜별 포트 설정:
- TCP/UDP: 1~65535 범위 사용
- ICMP/ALL: -1 사용 (포트 개념 없음)
- 중복 규칙: 동일한 규칙 중복 추가 시 CSP별로 동작이 다를 수 있음
- VM이 연결된 Security Group은 삭제 불가
- 강제 삭제(force=true) 시 연결된 VM의 Security Group 설정이 변경될 수 있음 (주의!)
- Default Security Group은 삭제 불가 (CSP 정책)
-
AddRules()/RemoveRules() 호출 후 실제 효과가 나타나는 시간:
- 일반적: 7~10초
- Azure: 60~80초 (긴 대기 시간 필요)
- 규칙 변경 후 즉시 테스트하면 이전 규칙이 적용될 수 있으므로 충분한 대기 필요
- ALL 프로토콜: 모든 트래픽을 의미하며, 포트는 -1로 설정
- ICMP 프로토콜: 네트워크 계층 프로토콜로 포트 개념이 없음, -1로 설정
-
Install & Start Guide
-
Usage Guide
- Usage Overview
- Connection Management
- Region/Zone Info
- Quota Info
- VM Price Info
- VM Image Info
- VM Spec Info
- VPC/Subnet Management
- Security Group Management
- KeyPair Management
- VM Management
- Disk Management
- Network Load Balancer(NLB) Management
- Kubernetes Cluster Management
- Object Storage(S3) Management
- Tag Management
- Cloud Driver Capability Info
- (WIP)VM Multi‐Network Management
- Function Menu
- MetaDB Auto Backup
- How to get CSP Credentials
- Tutorials
- Developer Guide
- Cloud Driver Developer Guide
- CB‐Spider Multi‐Cloud Driver Developer Team Skill
- Cloud Driver Developer Guide-WIP
- VM SSH Key Development Guide-WIP
- VM User Development Guide
- What is the CSP SDK API Version of drivers
- Region Zone Info and Driver API
- (StartVM TerminateVM) API Call Counts and Waiting
- StartVM and TerminateVM Main Flow of drivers
- VM Root Disk Configuration Guide
- Security Group Rules and Driver API
- Network Load Balancer and Driver API
- VM Snapshot, MyImage and Disk Overview
- Kubernetes and Driver API(PMKS, K8S)
- Tag and Cloud Driver API
- AnyCall API Extension Guide
- How to ...
- How to Use AWS S3 with Credentials
- How to Use Alibaba ECS i1.* Instance Types
- How to provision GPU VMs
- How to test CB Spider with Mock Driver
- How to install CB Spider on WSL2 under 공유기/사설망
- How to install CB Spider on macOS
- How to run CB Spider Container on macOS
- How to get Azure available Regions
- How to profile memory usage in Golang
- [For Cloud-Migrator]