IBM Cloud 2015 - Network - Security Group

分类

L2

描述

 

介绍

网络IP安全有黑名单,白名单2种方式,

黑名单 -依赖Guest OS的机制,例如 linux iptable configure

白名单 -依赖云管理平台CMP的机制, 例如 Security Group

 

Security Group

doc

Secruity group 新功能,不在SL旧文档库,在 bluemix新文档库

https://console.bluemix.net/docs/infrastructure/security-groups/sg_overview.html#about-security-groups

屏幕左侧sg章节覆盖了定义,日常操作

 

 

Purpose & summary

在云平台层面,对机器的IP进行 on/off block。 传统方式是用机器OS内的iptable, firewall配置

Sg的配置 包括N个rule, 每个rule, 指定inbound/outbound, protocol, ip range.

多个Device 通过关联到sg上面,继承sg上面的rule, 达到效果

举例:把device 01 关联到对应sg上面,实现port control

关联到Allow_all  是能够全部访问

不关联到 allow_all  是不能访问内外网

关联到Allow_tcp_80 是只能访问80端口

关联到only_me  是只能被only_me里面IP机器访问,其他IP机器无法访问。

 

Doc 里面出现的一个示意图

Rule

- App Dev 只能443访问 web layer device

- App Dev 不能访问 App Layer, DB layer

- only Web Layer 能访问 App Layer

-only App Layer 能访问 DB layer

 

Demo: Step-by-step: Adding a pre-defined Security Group during ordering (写的太空泛,不如看下面sg例子来理解)

https://console.bluemix.net/docs/infrastructure/security-groups/add-existing-sg.html#step-by-step-adding-a-pre-defined-security-group-during-ordering

 

 

系统默认*

系统默认提供的sg, account based, 不要删除,可以不关联机器。

下图5个sg是系统默认的, 下面2个是用户自建的

 

sg= allow_all, 有2条rule,

inbound, IPV4, all, CIDR, 0.0.0.0/0

inbound, IPV6, all, CIDR, 0.0.0.0/0

Assign device = 默认把所有机器关联进来

 

Sg= allow_http

inbound, IPV4, TCP, 80-80, CIDR, 0.0.0.0/0

inbound, IPV6, TCP, 80-80, CIDR, 0.0.0.0/0

 

Sg= allow_https

inbound, IPV4, TCP, 443-443, CIDR, 0.0.0.0/0

inbound, IPV6, TCP, 443-443, CIDR, 0.0.0.0/0

 

Sg= allow_ssh

inbound, IPV4, TCP, 22-22, CIDR, 0.0.0.0/0

inbound, IPV6, TCP, 22-22, CIDR, 0.0.0.0/0

 

Sg= allow_outbound

outbound, IPV4, all, CIDR, 0.0.0.0/0

outbound, IPV6, all, CIDR, 0.0.0.0/0

 

 

自建sg*

自建sg, 自建测试,用于参考说明

Sg= only_me

outbound, IPV4, all, CIDR, 0.0.0.0/0

inbound, IPV4, all, CIDR, 119.81.144.138  #只允许这个IP机器连接

 

Sg=xxx-name

inbound, IPV4, all, CIDR, 119.81.137.0/24  #只允许这个IP段

 

 

其他

限制

Resource              Limit

Security groups per network interface        5

Security groups per account           500

Rules per security group 50

Remote rules per security group   5

Network interfaces per security group        100

 

和防火墙区别 Secuiry group, 和firewall share/dedicate, Fortigae 区别

https://console.bluemix.net/docs/infrastructure/fortigate-10g/explore-firewalls.html?pos=4

 

 

test sg

总结:把机器从几个sg里面去除关联,不需重启,(文档上说要重启),直接生效

把机器新加到sg里面,需要重启,很快即时生效

 

测试security group 的操作和结果

1) 把机器从安全组移除,

在 security, network security, security group 里面编辑,把ip_xxx 机器,从sgroup allow_all, allow_http 移除,

不用重启,然后ping, 结果ping不通

2) 把刚才ip_xxx 机器,恢复sgroup 设置,

不用重启,然后ping, 结果可以ping通  (立时生效)

 

注意:

1) device, configure, security group可以看到这台机器的相关设置

2) allow_all, all_http 要同时给予机器,或者取消。

 

 

操作*

1. 从sg里面,关联机器,

security, network security, security group 可以编辑改account下面的系统和自建的 sgroup

https://control.softlayer.com/security/securitygroups

 

2. 从device里面,edit 关联sg.

device, configure, security group, 可以edit 这台机器的关联sgroup

 

注意:

using the default value of 0.0.0.0/0 -- the equivalent to any IP address or subnet.

Sgroup 里面修改过NIC, 需要reboot,  多个同时修改,只要reboot一次

Sgroup 已经被VM使用,或者其他sgroup依赖, 不能被delete

Sgroup allow_all 里面删除空policy 会导致机器双向流量被阻止

 

#

Question

Answer

 

Seceuriy group 设置后,和 KVM console port 有影响吗

The Security Groups are for the Public and Private IPs. They will not affect the KVM Console or it's ports. FYI: When reset, the KVM console picks a random port; so 5901 would only be temporary.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值