Scaleway logo
Instance API

A security group is a set of firewall rules on a set of Instances. Security groups enable you to create rules that either drop or allow incoming traffic from certain ports of your Instances.

Security groups are stateful by default which means return traffic is automatically allowed, regardless of any rules. As a contrary, you have to switch in a stateless mode to define explicitly allowed.


List security groups

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups

List all existing security groups.

List security groups › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

List security groups › query Parameters

name
​string

Name of the security group.

organization
​string

Security group Organization ID.

project
​string

Security group Project ID.

tags
​string

List security groups with these exact tags (to filter with several tags, use commas to separate them).

project_default
​boolean

Filter security groups with this value for project_default.

per_page
​integer · uint32

A positive integer lower or equal to 100 to select the number of items to return.

page
​integer · int32

A positive integer to choose the page to return.

List security groups › Responses


Create a security group

POST
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups

Create a security group with a specified name and description.

Create a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

Create a security group › Request Body

name
​string · required

Name of the security group.

description
​string

Description of the security group.

project
​string | null

Project ID the security group belong to.

tags
​string[]

Tags of the security group.

project_default
​boolean | null

Whether this security group becomes the default security group for new Instances.

stateful
​boolean

Whether the security group is stateful or not.

inbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default policy for inbound rules.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
outbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default policy for outbound rules.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
enable_default_security
​boolean | null

True to block SMTP on IPv4 and IPv6. This feature is read only, please open a support ticket if you need to make it configurable.

Create a security group › Responses


Update a security group

PUT
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{id}

Replace all security group properties with a security group message.

Update a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
id
​string · required

UUID of the security group.

Update a security group › Request Body

name
​string

Name of the security group.

tags
​array | null

Tags of the security group.

creation_date
​string | null · date-time

Creation date of the security group (will be ignored). (RFC 3339 format)

modification_date
​string | null · date-time

Modification date of the security group (will be ignored). (RFC 3339 format)

description
​string

Description of the security group.

enable_default_security
​boolean

True to block SMTP on IPv4 and IPv6. This feature is read only, please open a support ticket if you need to make it configurable.

inbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default inbound policy.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
outbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default outbound policy.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
organization
​string

Security groups Organization ID.

project
​string

Security group Project ID.

project_default
​boolean

True use this security group for future Instances created in this project.

Instances attached to this security group.

stateful
​boolean

True to set the security group as stateful.

Update a security group › Responses


Get a security group

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}

Get the details of a security group with the specified ID.

Get a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group you want to get.

Get a security group › Responses


Delete a security group

DELETE
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}

Delete a security group with the specified ID.

Delete a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group you want to delete.

Delete a security group › Responses

No data returned

Update a security group

PATCH
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}

Update the properties of security group.

Update a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group. (UUID format)

Update a security group › Request Body

name
​string | null

Name of the security group.

description
​string | null

Description of the security group.

enable_default_security
​boolean | null

True to block SMTP on IPv4 and IPv6. This feature is read only, please open a support ticket if you need to make it configurable.

inbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default inbound policy.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
tags
​array | null

Tags of the security group.

project_default
​boolean | null

True use this security group for future Instances created in this project.

outbound_default_policy
​scaleway.instance.v1.SecurityGroup.Policy · enum

Default outbound policy.

Enum values:
unknown_policy
accept
drop
Default: unknown_policy
stateful
​boolean | null

True to set the security group as stateful.

Update a security group › Responses


List rules

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules

List the rules of the a specified security group ID.

List rules › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group.

List rules › query Parameters

per_page
​integer · uint32

A positive integer lower or equal to 100 to select the number of items to return.

page
​integer · int32

A positive integer to choose the page to return.

List rules › Responses


Update all the rules of a security group

PUT
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules

Replaces the existing rules of the security group with the rules provided. This endpoint supports the update of existing rules, creation of new rules and deletion of existing rules when they are not passed in the request.

Update all the rules of a security group › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group to update the rules on.

Update all the rules of a security group › Request Body

List of rules to update in the security group.

Update all the rules of a security group › Responses


Create rule

POST
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules

Create a rule in the specified security group ID.

Create rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group.

Create rule › Request Body

protocol
​scaleway.instance.v1.SecurityGroupRule.Protocol · enum · required
Enum values:
unknown_protocol
TCP
UDP
ICMP
ANY
Default: unknown_protocol
direction
​scaleway.instance.v1.SecurityGroupRule.Direction · enum · required
Enum values:
unknown_direction
inbound
outbound
Default: unknown_direction
action
​scaleway.instance.v1.SecurityGroupRule.Action · enum · required
Enum values:
unknown_action
accept
drop
Default: unknown_action
ip_range
​string · required

(IP network)

dest_port_from
​integer | null · uint32

Beginning of the range of ports to apply this rule to (inclusive).

dest_port_to
​integer | null · uint32

End of the range of ports to apply this rule to (inclusive).

position
​integer · uint32

Position of this rule in the security group rules list.

editable
​boolean

Indicates if this rule is editable (will be ignored).

Create rule › Responses


Get rule

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules/{security_group_rule_id}

Get details of a security group rule with the specified ID.

Get rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required
security_group_rule_id
​string · required

Get rule › Responses


Set security group rule

PUT
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules/{security_group_rule_id}

Replace all the properties of a rule from a specified security group.

Set security group rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required
security_group_rule_id
​string · required

Set security group rule › Request Body

id
​string
protocol
​scaleway.instance.v1.SecurityGroupRule.Protocol · enum
Enum values:
unknown_protocol
TCP
UDP
ICMP
ANY
Default: unknown_protocol
direction
​scaleway.instance.v1.SecurityGroupRule.Direction · enum
Enum values:
unknown_direction
inbound
outbound
Default: unknown_direction
action
​scaleway.instance.v1.SecurityGroupRule.Action · enum
Enum values:
unknown_action
accept
drop
Default: unknown_action
ip_range
​string

(IP network)

dest_port_from
​google.protobuf.UInt32Value · uint32
dest_port_to
​google.protobuf.UInt32Value · uint32
position
​integer · uint32
editable
​boolean

Set security group rule › Responses


Delete rule

DELETE
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules/{security_group_rule_id}

Delete a security group rule with the specified ID.

Delete rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required
security_group_rule_id
​string · required

Delete rule › Responses

No data returned

Update security group rule

PATCH
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/{security_group_id}/rules/{security_group_rule_id}

Update the properties of a rule from a specified security group.

Update security group rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
security_group_id
​string · required

UUID of the security group. (UUID format)

security_group_rule_id
​string · required

UUID of the rule. (UUID format)

Update security group rule › Request Body

protocol
​scaleway.instance.v1.SecurityGroupRule.Protocol · enum

Protocol family this rule applies to.

Enum values:
unknown_protocol
TCP
UDP
ICMP
ANY
Default: unknown_protocol
direction
​scaleway.instance.v1.SecurityGroupRule.Direction · enum

Direction the rule applies to.

Enum values:
unknown_direction
inbound
outbound
Default: unknown_direction
action
​scaleway.instance.v1.SecurityGroupRule.Action · enum

Action to apply when the rule matches a packet.

Enum values:
unknown_action
accept
drop
Default: unknown_action
ip_range
​string | null

Range of IP addresses these rules apply to. (IP network)

dest_port_from
​integer | null · uint32

Beginning of the range of ports this rule applies to (inclusive). If 0 is provided, unset the parameter.

dest_port_to
​integer | null · uint32

End of the range of ports this rule applies to (inclusive). If 0 is provided, unset the parameter.

position
​integer | null · uint32

Position of this rule in the security group rules list.

Update security group rule › Responses


Get default rules

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/security_groups/default/rules

Lists the default rules applied to all the security groups.

Get default rules › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

Get default rules › Responses