gateway = boto3.client('apigateway', region_name=self.conf.region)
gateway.put_method(
restApiId=apiId,
resourceId=resourceId,
httpMethod="OPTIONS",
authorizationType="NONE"
)
gateway.put_method_response(
restApiId=apiId,
resourceId=resourceId,
httpMethod="OPTIONS",
statusCode="200",
responseParameters={
'method.response.header.Access-Control-Allow-Headers': True,
'method.response.header.Access-Control-Allow-Origin': True,
'method.response.header.Access-Control-Allow-Methods': True
},
responseModels={
'application/json': 'Empty'
}
)
gateway.put_integration(
restApiId=api['id'],
resourceId=apiResource['id'],
httpMethod="OPTIONS",
type="MOCK",
requestTemplates={
'application/json': '{"statusCode": 200}'
}
)
gateway.put_integration_response(
restApiId=api['id'],
resourceId=apiResource['id'],
httpMethod="OPTIONS",
statusCode="200",
selectionPattern=".*",
responseParameters={
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'",
"method.response.header.Access-Control-Allow-Methods": "'*'",
"method.response.header.Access-Control-Allow-Origin": "'*'"
},
responseTemplates={
'application/json': ''
}
)
gateway.put_method_response(
restApiId=apiId,
resourceId=resourceId,
httpMethod="POST",
statusCode=200,
responseParameters={'method.response.header.Access-Control-Allow-Origin': True},
responseModels={'application/json': 'Empty'}
URLパラメータを検証していますか? XSSチェッカーは、URLにJavaScriptマークアップを送信しようとする可能性があるため、これについて不平を言っています。危険なタグを取り除いて文字列を消毒しなければ、ここに悪質なスクリプトを挿入することは可能です。 –
@RaviChandra、どうすればそれらを検証できますか? AWS上?私はこの問題をあまり知らない。 – sHamann