amazon-web-services - 在 AWS Gateway (REST API) 中添加 HTTP 严格传输安全 (HSTS)
问题描述
我们的安全团队希望 AWS 上的所有 Rest API 都设置 HTTP 严格传输安全 (HSTS) 标头,即使我们的 api 不是从任何网页调用的。
我发现了一些在 Lambda 响应中设置响应标头的用例,但我们的大多数 api 都链接到 SQS 或 SNS。所以我不确定如何在 AWS API GW 中添加这个响应头。
任何人都可以指导我。
解决方案
I was able to find a solution to add the strict Transport Security (HSTS) response header. I have done this through AWS console.
Step 1: Add the Strict-Transport-Security header under Method Response Status code.
Step 2: Under Integration Response, add the necessary mapping value for HSTS header. Attached is the sample i have tried with. The values has to be provided in single quotes(').
推荐阅读
- python-2.7 - 为什么我的 VPython 程序在这个 Glowscript IDE 上运行如此缓慢?
- database - Spring Data JPA/Hibernate 中锁的范围是什么?
- python - Python - 在单元测试中返回异常
- c# - .NET 内存中的浮点表示
- java - 使用 hh:mm:ss 每天在特定时间运行的计划
- arrays - 在SAS中按组填充先前观察中的许多变量的缺失值
- php - 在 Laravel 5.1 中上传多张图片
- vba - 循环收集标签和计算
- python - 在python中组合来自两个不同字符串的数据
- python - Python3 - 处理库依赖于操作系统的情况