arazzo: 1.0.1
info:
title: Amazon EC2 Harden an Existing Security Group
summary: Look up a security group by name and add a scoped inbound rule to it.
description: >-
Adds a tightly scoped inbound rule to an existing security group. The
workflow resolves the security group by name to confirm it exists, then
authorizes a single inbound rule for the requested protocol, port range, and
CIDR. Every step spells out its request inline using the Amazon EC2 query
protocol (Action and Version parameters) so the flow can be read and
executed without opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-620
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-620
capability_name: Cybersecurity Management
spec: amazon-ec2-security-groups-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: securityGroupsApi
url: ../openapi/amazon-ec2-security-groups-api-openapi.yml
type: openapi
workflows:
- workflowId: harden-existing-security-group
summary: Resolve a security group and authorize one scoped inbound rule.
description: >-
Chains DescribeSecurityGroups and AuthorizeSecurityGroupIngress to add a
single inbound rule to an already-existing security group.
inputs:
type: object
required:
- groupId
- ipProtocol
- fromPort
- toPort
- cidrIp
properties:
groupId:
type: string
description: The ID of the security group to harden.
ipProtocol:
type: string
description: The IP protocol name (tcp, udp, icmp) or number.
fromPort:
type: integer
description: The start of the port range.
toPort:
type: integer
description: The end of the port range.
cidrIp:
type: string
description: The IPv4 CIDR range allowed by the new rule.
steps:
- stepId: resolveGroup
description: Confirm the target security group exists before adding a rule.
operationId: DescribeSecurityGroups
requestBody:
contentType: application/x-www-form-urlencoded
payload:
Action: DescribeSecurityGroups
Version: '2016-11-15'
GroupIds:
- $inputs.groupId
successCriteria:
- condition: $statusCode == 200
outputs:
resolveStatus: $statusCode
- stepId: authorizeRule
description: Authorize the requested scoped inbound rule on the security group.
operationId: AuthorizeSecurityGroupIngress
requestBody:
contentType: application/x-www-form-urlencoded
payload:
Action: AuthorizeSecurityGroupIngress
Version: '2016-11-15'
GroupId: $inputs.groupId
IpProtocol: $inputs.ipProtocol
FromPort: $inputs.fromPort
ToPort: $inputs.toPort
CidrIp: $inputs.cidrIp
successCriteria:
- condition: $statusCode == 200
outputs:
authorizeStatus: $statusCode
outputs:
authorizeStatus: $steps.authorizeRule.outputs.authorizeStatus
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.