IBM Cloud Docs
Managing security groups for virtual server traffic (ibmcloud sl securitygroup)

Managing security groups for virtual server traffic (ibmcloud sl securitygroup)

A security group is a set of IP filter rules that define how to handle incoming (ingress) and outgoing (egress) traffic from the public and private interfaces of a virtual server instance. The rules that you add to a security group are known as security group rules.

Use the following commands from the IBM Cloud® Command Line Interface to manage a security group by using the IBM Cloud classic infrastructure Security Group service.

ibmcloud sl securitygroup create

Create a security group

ibmcloud sl securitygroup create [flags]

Command options:

--d, description
The description of the security group
--n, name
The name of the security group

ibmcloud sl securitygroup delete

Delete the given security group

ibmcloud sl securitygroup delete SECURITYGROUP_ID [flags]

Command options:

--f, force
Force operation without confirmation

ibmcloud sl securitygroup detail

Get details about a security group

ibmcloud sl securitygroup detail SECURITYGROUP_ID

ibmcloud sl securitygroup edit

Edit details of a security group

ibmcloud sl securitygroup edit SECURITYGROUP_ID [flags]

Command options:

--d, description
The description of the security group
--n, name
The name of the security group

ibmcloud sl securitygroup interface-add

Attach an interface to a security group

ibmcloud sl securitygroup interface-add SECURITYGROUP_ID [flags]

Command options:

--i, interface
The interface of the server to associate (public/private)
--n, network-component
The network component ID to associate with the security group
--s, server
The server ID to associate with the security group

ibmcloud sl securitygroup interface-list

List interfaces associated with security group

ibmcloud sl securitygroup interface-list SECURITYGROUP_ID [flags]

Command options:

--sortby
Column to sort by. Options are: id,virtualServerId,hostname

ibmcloud sl securitygroup interface-remove

Detach an interface from a security group

ibmcloud sl securitygroup interface-remove SECURITYGROUP_ID [flags]

Command options:

--i, interface
The interface of the server to remove (public or private)
--n, network-component
The network component to remove from the security group
--s, server
The server ID to remove from the security group

ibmcloud sl securitygroup list

List security groups

ibmcloud sl securitygroup list [flags]

Command options:

--sortby
Column to sort by. Options are: id,name,description,created

ibmcloud sl securitygroup rule-add

Add a security group rule to a security group

ibmcloud sl securitygroup rule-add SECURITYGROUP_ID [flags]

Command options:

--d, direction
The direction of traffic to enforce (ingress or egress), required
--e, ether-type
The ethertype (IPv4 or IPv6) to enforce, default is IPv4 if not specified
--M, port-max
The upper port bound to enforce
--m, port-min
The lower port bound to enforce
--p, protocol
The protocol (icmp, tcp, udp) to enforce
--s, remote-group
The ID of the remote security group to enforce
--r, remote-ip
The remote IP/CIDR to enforce

ibmcloud sl securitygroup rule-edit

Edit a security group rule in a security group

ibmcloud sl securitygroup rule-edit SECURITYGROUP_ID RULE_ID [flags]

Command options:

--d, direction
The direction of traffic to enforce (ingress or egress), required
--e, ether-type
The ethertype (IPv4 or IPv6) to enforce, default is IPv4 if not specified
--M, port-max
The upper port bound to enforce
--m, port-min
The lower port bound to enforce
--p, protocol
The protocol (icmp, tcp, udp) to enforce
--s, remote-group
The ID of the remote security group to enforce
--r, remote-ip
The remote IP/CIDR to enforce

ibmcloud sl securitygroup rule-list

List security group rules

ibmcloud sl securitygroup rule-list SECURITYGROUP_ID [flags]

Command options:

--sortby
Column to sort by. Options are: id,remoteIp,remoteGroupId,direction,ethertype,portRangeMin,portRangeMax,protocol

ibmcloud sl securitygroup rule-remove

Remove a rule from a security group

ibmcloud sl securitygroup rule-remove SECURITYGROUP_ID RULE_ID [flags]

Command options:

--f, force
Force operation without confirmation