Skip to content

stratumctl security-groups

Manage security groups

Terminal window
stratumctl security-groups [flags]

Aliases: security-group, sg, sgs

Create a security group (returns 202)

Terminal window
stratumctl security-groups create <name> [flags]
Terminal window
stratumctl security-groups create web --description "web tier"
stratumctl security-groups create locked-down --default-egress-allow=false
Flag Type Default Description
--default-egress-allow bool true Allow all egress by default (AWS-shape)
--description string Free-form description
--display-name string Human-friendly display name
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--region string Region override

Soft-delete a security group

Terminal window
stratumctl security-groups delete <sg-id> [flags]
Terminal window
stratumctl security-groups delete sg-3f8d2k9x
Flag Type Default Description
--force bool false delete a platform-owned resource anyway (needs platform:ManageInternal; audited; the platform re-creates it)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Describe a security group

Terminal window
stratumctl security-groups get <sg-id> [flags]
Terminal window
stratumctl security-groups get sg-3f8d2k9x
stratumctl security-groups get sg-3f8d2k9x --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

List security groups in a project

Terminal window
stratumctl security-groups list [flags]
Terminal window
stratumctl security-groups list
stratumctl security-groups list --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Manage a security group’s rules

Terminal window
stratumctl security-groups rules [flags]

Aliases: rule

Add a rule (reads the current rules, appends, and replaces the set)

Terminal window
stratumctl security-groups rules add <sg-id> [flags]
Terminal window
stratumctl security-groups rules add sg-3f8d2k9x --protocol tcp --from-port 22 --source 10.0.0.0/8
stratumctl security-groups rules add sg-3f8d2k9x --protocol tcp --from-port 8000 --to-port 8100 --source sg-7k2m9x4q --source-type security-group
stratumctl security-groups rules add sg-3f8d2k9x --direction egress --protocol all --source 0.0.0.0/0
Flag Type Default Description
--description string Free-form description
--direction string ingress ingress | egress
--from-port int 0 Start of the port range (omit –to-port for a single port)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)
--protocol string tcp | udp | icmp | all (required)
--source string CIDR (e.g. 0.0.0.0/0) or an sg-… id (required)
--source-type string cidr cidr | security-group
--to-port int 0 End of the port range

List a security group’s rules

Terminal window
stratumctl security-groups rules list <sg-id> [flags]
Terminal window
stratumctl security-groups rules list sg-3f8d2k9x
stratumctl security-groups rules list sg-3f8d2k9x --output json
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Remove a rule by id (reads the current rules, drops it, and replaces the set)

Terminal window
stratumctl security-groups rules remove <sg-id> <rule-id> [flags]
Terminal window
stratumctl security-groups rules remove sg-3f8d2k9x sgr-8k2m4x7q
Flag Type Default Description
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)

Replace the entire rule set from a JSON file ({“rules”:[…]})

Terminal window
stratumctl security-groups rules replace <sg-id> [flags]
Terminal window
stratumctl security-groups rules replace sg-3f8d2k9x --from-file rules.json
Flag Type Default Description
--from-file string Path to a JSON file with the full rule set (required)
--project string Project ID (defaults to STRATUM_PROJECT or profile project_id)