Skip to content

feat(rest-api): SecurityPolicy & EndpointAccessMode support#144

Open
afa4 wants to merge 4 commits intooss-serverless:mainfrom
afa4:feat/api-securtity-policy-support
Open

feat(rest-api): SecurityPolicy & EndpointAccessMode support#144
afa4 wants to merge 4 commits intooss-serverless:mainfrom
afa4:feat/api-securtity-policy-support

Conversation

@afa4
Copy link
Copy Markdown

@afa4 afa4 commented Feb 25, 2026

Summary

  • Add support for securityPolicy property under provider.apiGateway to configure TLS version on REST APIs
  • Add support for endpointAccessMode property under provider.apiGateway to control API endpoint access mode (STRICT or BASIC)
  • Add documentation for both new properties in docs/events/apigateway.md

Fixes #133

Example of usage:

provider:
  name: aws
  apiGateway:
    securityPolicy: SecurityPolicy_TLS13_2025_EDGE  # Recommended: Use TLS 1.2 or higher
    endpointAccessMode: STRICT

important notice:

both securityPolicy and endpointAccessMode configs are available only for AWS REST API Gateways, which are created when httpevents are used:

functions:
  testFunctionAwsRest:
    handler: index.handler
    events:
      - http:
          path: /test
          method: get

These properties have no effect if httpApi events are being used since this creates an AWS HTTP API (v2) in the CloudFormation stack:

# securityPolicy and endpointAccessMode configs wont have any effect because of httpApi event config
functions:
  testFunctionAwsHttp:
    handler: index.handler
    events:
      - httpApi:
          # ...

@afa4 afa4 force-pushed the feat/api-securtity-policy-support branch from 67fb215 to f9719ab Compare February 25, 2026 15:08
Copy link
Copy Markdown
Contributor

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you cover this with tests?

@afa4
Copy link
Copy Markdown
Author

afa4 commented Feb 25, 2026

Could you cover this with tests?

sure, wip

@afa4 afa4 force-pushed the feat/api-securtity-policy-support branch from f9719ab to 3de444a Compare February 25, 2026 17:12
@afa4 afa4 requested a review from mnapoli February 25, 2026 17:17
@afa4
Copy link
Copy Markdown
Author

afa4 commented Feb 25, 2026

I had to fix some lint issues

@afa4 afa4 marked this pull request as ready for review February 25, 2026 18:24
@mnapoli
Copy link
Copy Markdown
Contributor

mnapoli commented Mar 25, 2026

This needs docs too, sorry I didn't spot that before. Have a look at other merged PRs to get an idea on what's needed to be merged.

@afa4
Copy link
Copy Markdown
Author

afa4 commented Apr 7, 2026

This needs docs too, sorry I didn't spot that before. Have a look at other merged PRs to get an idea on what's needed to be merged.

No problem, I'll check everything to ensure the best release possible.

@afa4 afa4 changed the title feat(api-gateway): SecurityPolicy support feat(rest-api): SecurityPolicy & EndpointAccessMode support Apr 7, 2026
@afa4
Copy link
Copy Markdown
Author

afa4 commented Apr 8, 2026

@mnapoli I think something is wrong with "Validate Windows" check. It's being running for 5 hours :s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify Security Policy option for API Gateway

2 participants