VPC Endpoints — gateway, interface, policies
An endpoint lets a private instance reach an AWS service over the AWS network instead of the public internet. No IGW, no NAT, nothing to size: endpoints scale horizontally, are redundant, and can even be cross-Region.
Endpoint cho phép một instance nằm sâu trong subnet private gọi thẳng tới service của AWS qua mạng nội bộ của AWS thay vì vòng ra internet công cộng. Không cần IGW, không cần NAT, cũng chẳng phải chọn dung lượng: endpoint tự co giãn theo chiều ngang, có sẵn dự phòng, và còn dùng được xuyên Region.
Two flavours, and every question lives in the gap between them: the gateway endpoint is a route table entry for S3 and DynamoDB that cannot leave the VPC; the interface endpoint is an ENI with a private IP that on-premises can reach.
Chỉ có hai loại, và mọi câu hỏi đều xoáy vào đúng khoảng cách giữa chúng: gateway endpoint thực chất chỉ là một dòng trong route table, dành cho S3 và DynamoDB, và không ra khỏi được VPC; còn interface endpoint là một ENI có IP private, nên từ on-premises vẫn gọi tới được.
Gateway endpoint when… / interface endpoint when…Khi nào chọn gateway endpoint… / khi nào chọn interface endpoint…
Neither is a mistake. The decision is made by two questions only: is the service S3 or DynamoDB, and does anything outside this VPC need the same path. Answer those and the choice is forced. Không có lựa chọn nào là sai cả. Chỉ cần trả lời hai câu: service này có phải S3 hay DynamoDB không, và có thứ gì ngoài VPC này cần đi chung đường đó không. Trả lời xong là gần như không còn gì để cân nhắc.
Gateway endpointChọn gateway endpoint
- The target is S3 or DynamoDB, and the callers are inside this VPC. That is the whole use case.Đích đến là S3 hoặc DynamoDB, và bên gọi nằm ngay trong VPC này. Nguyên vẹn use case của nó chỉ có vậy.
- You want the NAT Gateway data bill for bulk S3 traffic to go away. The endpoint is free — the NAT is not.Bạn muốn cắt tiền data đi qua NAT Gateway cho khối traffic S3 lớn. Endpoint không mất phí, còn NAT thì tính từng GB.
- You would rather not consume subnet IPs or manage another security group — a gateway endpoint creates no ENI at all.Bạn không muốn tốn thêm IP trong subnet hay phải trông thêm một security group nữa — gateway endpoint không tạo ENI nào cả.
- Application code must keep calling the same public S3 hostname with no DNS work at all.Ứng dụng cứ gọi đúng hostname public của S3 như cũ, không phải đụng gì tới DNS.
Interface endpointChọn interface endpoint
- The service is anything else — SSM, ECR, Secrets Manager, KMS, SQS, Athena, CloudWatch. Gateway does not cover them.Service là bất cứ thứ gì khác — SSM, ECR, Secrets Manager, KMS, SQS, Athena, CloudWatch. Gateway không phục vụ những thứ này.
- On-premises must reach it over Direct Connect or Site-to-Site VPN. This is the deciding line, and it holds even for S3.On-premises phải gọi tới được qua Direct Connect hoặc Site-to-Site VPN. Đây là câu chốt, và với cả S3 cũng vậy.
- Another VPC over Transit Gateway or peering should share one central endpoint instead of each VPC building its own.Một VPC khác qua Transit Gateway hoặc peering muốn xài chung một endpoint tập trung, thay vì VPC nào cũng dựng riêng một cái.
- You want to filter who may use the endpoint with a security group — the gateway endpoint gives you nothing to attach one to.Bạn muốn dùng security group để lọc ai được đi qua endpoint — gateway endpoint thì chẳng có chỗ nào để gắn vào.
Gateway vs interface — the table to answer anything fromGateway và interface — bảng để trả lời mọi câu hỏi
Read the two red lines against the two green ones and the whole topic is settled. The gateway endpoint is plumbing in a route table: cheap, invisible, and stuck inside the VPC. The interface endpoint is a real network object with an IP and a security group, which is exactly why traffic arriving from Direct Connect or a VPN can find it.
Cứ đặt hai dòng đỏ cạnh hai dòng xanh là xong cả chủ đề. Gateway endpoint chỉ là đường ống nằm trong route table: rẻ, không thấy mặt mũi đâu, và kẹt cứng trong VPC. Interface endpoint là một vật thể mạng thật, có IP và có security group — chính vì thế traffic từ Direct Connect hay VPN đi vào mới tìm thấy nó.
| Gateway endpoint | Interface endpoint | |
|---|---|---|
| ServicesService hỗ trợ | S3 and DynamoDB onlychỉ S3 và DynamoDB | most AWS services, S3 includedhầu hết service của AWS, có cả S3 |
| How traffic finds itTraffic tới nó bằng cách nào | a route table entry: destination = AWS prefix list pl-…, target = vpce-…một dòng route table: destination là prefix list pl-… của AWS, target là vpce-… |
DNS: the hostname resolves to a private IP, then normal routing takes overqua DNS: hostname phân giải ra IP private, sau đó là định tuyến bình thường |
| ENI | none created — nothing appears in your subnetskhông tạo cái nào — subnet của bạn không mọc thêm gì | one ENI with a private IP per subnet you selectmỗi subnet bạn chọn sẽ có một ENI kèm IP private |
| Security groupSecurity group | none. Nothing to attach one to — control it with the endpoint policy insteadkhông có. Chẳng có chỗ nào để gắn — muốn siết thì siết bằng endpoint policy | yes, on the endpoint ENI — allow 443 from the caller's SGcó, gắn trên ENI của endpoint — mở 443 cho SG của bên gọi |
| Reach from outside the VPCGọi từ ngoài VPC | impossible. Not over VPN, Direct Connect, Transit Gateway or peering — on-prem cannot use itkhông được. Không qua VPN, Direct Connect, Transit Gateway hay peering — on-prem chịu thua | yes — reachable from Direct Connect and Site-to-Site VPNđược — gọi tới được từ Direct Connect và Site-to-Site VPN |
| Hostname the app usesHostname app phải gọi | the same public S3 hostname — nothing to changevẫn hostname public của S3 — không phải sửa gì | the vpce-… hostname, or the normal one if private DNS is onhostname vpce-…, hoặc hostname bình thường nếu bật private DNS |
| ScopePhạm vi | VPC level, one gateway per VPC; associate every route table that needs itcấp VPC, mỗi VPC một gateway; nhớ gắn vào tất cả route table cần dùng | subnet level — pick subnets, ideally one per AZ for availabilitycấp subnet — chọn subnet, tốt nhất mỗi AZ một cái cho chắc |
| CostChi phí | free — and it removes NAT data charges for S3 trafficmiễn phí — lại còn cắt được tiền data qua NAT cho traffic S3 | per ENI-hour + per GB, in every AZ you place onetính theo giờ mỗi ENI + theo GB, và tính cho từng AZ bạn đặt |
| Underlying techNền tảng bên dưới | VPC routing — a prefix list pointed at an AWS-managed targetđịnh tuyến của VPC — một prefix list trỏ vào target do AWS quản lý | AWS PrivateLink — the same machinery third parties expose services withAWS PrivateLink — đúng bộ máy mà bên thứ ba dùng để mở service ra |
| First thing to check when brokenHỏng thì soi cái gì trước | VPC DNS resolution, then the route table — is the prefix-list route actually on this subnet's table?DNS resolution của VPC, rồi tới route table — route prefix-list đã nằm đúng trên table của subnet này chưa? | what the hostname resolves to, then the endpoint's own security group inboundhostname đang phân giải ra cái gì, rồi tới luật inbound trên security group của chính endpoint |
Gateway endpoint — a route, not a deviceGateway endpoint — một dòng route, không phải một thiết bị
There is no box in the subnet. You create the endpoint at the VPC level, tick the route tables it should apply to, and AWS writes a line into each: destination an AWS-managed prefix list, target the vpce-…. Traffic to S3 now matches that more specific route instead of 0.0.0.0/0 and never reaches the NAT.
Không có cái hộp nào nằm trong subnet cả. Bạn tạo endpoint ở cấp VPC, tick những route table cần áp dụng, rồi AWS tự viết vào mỗi table một dòng: destination là prefix list do AWS quản lý, target là vpce-…. Từ đó traffic đi S3 khớp vào route hẹp hơn này chứ không rơi vào 0.0.0.0/0, nên không bao giờ chạm tới NAT nữa.
pl-63a5400a (com.amazonaws.us-east-1.s3, 54.231.0.0/17, 52.216.0.0/15, 3.5.16.0/21, …) is every public range S3 uses in that Region. You reference the name; AWS keeps the contents current. Without it you would be hand-editing route tables every time S3 added an address block.
Là một gói các dải CIDR có tên, do AWS tự bảo trì. pl-63a5400a (com.amazonaws.us-east-1.s3, 54.231.0.0/17, 52.216.0.0/15, 3.5.16.0/21, …) chính là toàn bộ dải public mà S3 dùng trong Region đó. Bạn chỉ tham chiếu cái tên, phần ruột bên trong AWS lo cập nhật. Không có nó thì mỗi lần S3 thêm dải địa chỉ là bạn lại phải sửa tay route table.
Interface endpoint — an ENI you can point at from anywhere privateInterface endpoint — một ENI mà mọi đường private đều trỏ tới được
You pick subnets; AWS provisions an ENI with a private IP in each, and gives the endpoint its own private endpoint hostname. Traffic to that IP is carried by PrivateLink to the service. Because it is an ordinary private IP inside your CIDR, anything that can route to your VPC — Direct Connect, VPN, a peered VPC — can reach it. Bạn chọn subnet; AWS dựng trong mỗi subnet một ENI có IP private, và cấp cho endpoint một hostname riêng. Traffic gửi tới IP đó được PrivateLink mang tới service. Vì đó chỉ là một IP private bình thường nằm trong CIDR của bạn, nên thứ gì định tuyến được vào VPC — Direct Connect, VPN, một VPC peering — đều chạm tới được.
Two knobs matter at creation time: the security group on the ENI (allow 443 from the callers, or nothing works) and the private DNS checkbox, covered next.
Lúc tạo chỉ có hai thứ đáng bận tâm: security group gắn trên ENI (phải mở 443 cho bên gọi, không thì đứng im) và ô tick private DNS, nói ngay dưới đây.
Private DNS — only the answer changesPrivate DNS — thứ thay đổi chỉ là câu trả lời DNS
Say it out loud once and it stops being confusing: private DNS is DNS resolution inside your VPC, not a separate "private version" of the AWS service. Same Athena, same API, same wire format. The only thing that changed is what the resolver hands back. Nói to một lần là hết rối: private DNS là chuyện phân giải DNS bên trong VPC của bạn, không phải một "bản private" nào khác của service AWS. Vẫn là Athena đó, vẫn API đó, gói tin vẫn y hệt. Cái duy nhất đổi là câu trả lời mà resolver đưa lại.
So trace the name, not the service. ON: the app asks for the public hostname → the VPC resolver's private DNS overrides the public answer → hands back the ENI's private IP → the request stays in-VPC and never touches the NAT. OFF: the very same hostname resolves to a public IP, which matches 0.0.0.0/0, so the packet goes out through the NAT to the public endpoint — the interface endpoint sits there unused, and your "private" call was never private.
Nên bám theo cái tên, đừng bám theo service. BẬT: app hỏi hostname public → private DNS của VPC resolver ghi đè câu trả lời public → trả về IP private của ENI → request nằm trong VPC, không bao giờ chạm NAT. TẮT: vẫn hostname đó phân giải ra IP public, khớp 0.0.0.0/0, nên gói tin đi vòng qua NAT tới endpoint public — cái interface endpoint nằm im không ai dùng, và cuộc gọi bạn tưởng là "private" thật ra chưa bao giờ private.
Both rows start from the identical hostname — the fork is the resolver step in the middle. Private DNS ON makes that step answer with the private IP, so the traffic stays in the VPC; OFF, the same name answers public and the packet drifts out through the NAT. That is also why private DNS is a convenience, not a security control: turning it off does not block the call, it just quietly reroutes it out the front door.
Cả hai hàng đều xuất phát từ đúng một hostname — ngã rẽ nằm ở bước resolver ở giữa. Bật private DNS thì bước đó trả về IP private, traffic ở lại trong VPC; tắt thì vẫn tên đó trả về IP public và gói tin trôi ra ngoài qua NAT. Cũng vì thế private DNS chỉ là tiện lợi, không phải biện pháp bảo mật: tắt nó đi không chặn được cuộc gọi, chỉ lặng lẽ đẩy cuộc gọi ra cửa trước mà thôi.
true: Enable DNS hostnames and Enable DNS Support. Miss either and the checkbox is unavailable, or the name keeps resolving to the public endpoint and your "private" traffic is quietly still going out through the NAT.
Cả hai thiết lập của VPC phải bằng true: Enable DNS hostnames và Enable DNS Support. Thiếu một trong hai thì hoặc là ô tick bị mờ, hoặc tên vẫn phân giải ra endpoint public — và luồng traffic bạn tưởng là "private" thật ra vẫn lặng lẽ chui qua NAT.
Endpoint policies — a layer, never an overrideEndpoint policy — một lớp nữa, không phải quyền phủ quyết
An endpoint policy is a JSON document attached to the endpoint that controls what can be reached through it. It does not override or replace IAM policies or resource policies such as an S3 bucket policy: a call succeeds only when every one of them allows it. Endpoint policy là một tài liệu JSON gắn vào endpoint, quy định qua nó thì được chạm tới cái gì. Nó không ghi đè, cũng không thay thế policy của IAM hay resource policy như bucket policy của S3: một request chỉ đi lọt khi tất cả các lớp đó cùng cho phép.
This endpoint policy lets one IAM user send to one SQS queue through the endpoint: Endpoint policy dưới đây cho phép đúng một IAM user gửi vào đúng một queue SQS khi đi qua endpoint:
{
"Statement": [{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::123456789012:user/MyUser" },
"Action": ["sqs:SendMessage"],
"Resource": "arn:aws:sqs:us-east-2:123456789012:MyQueue"
}]
}
Pinning an S3 bucket to your VPCChốt một bucket S3 vào VPC của bạn
The shape is always the same: Deny + StringNotEquals — deny everything that did not come from where you expect. aws:sourceVpce pins to one specific endpoint and is the tighter option; aws:sourceVpc pins to a whole VPC, which is the right call when that VPC has several endpoints and you want one rule to cover them all.
Khuôn viết lúc nào cũng vậy: Deny kèm StringNotEquals — chặn tất cả những gì không đến từ chỗ bạn mong đợi. aws:sourceVpce chốt vào đúng một endpoint, chặt hơn; còn aws:sourceVpc chốt vào cả một VPC, hợp khi VPC đó có nhiều endpoint và bạn muốn một luật phủ hết.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "Access-to-specific-VPCE-only",
"Principal": "*",
"Action": "s3:*",
"Effect": "Deny",
"Resource": ["arn:aws:s3:::my_secure_bucket",
"arn:aws:s3:::my_secure_bucket/*"],
"Condition": {
"StringNotEquals": { "aws:sourceVpce": "vpce-1a2b3c4d" }
}
}]
}
Swap the condition key for "aws:sourceVpc": "vpc-111bbb22" and the same statement covers every endpoint in that VPC at once.
Đổi condition key thành "aws:sourceVpc": "vpc-111bbb22" là cùng một statement đó phủ luôn mọi endpoint trong VPC ấy.
aws:SourceIp does not work hereaws:SourceIp không dùng được ở đây
An S3 bucket policy can restrict by public IP or Elastic IP — not by private IP. Endpoint traffic arrives with a private source address, so an aws:SourceIp condition simply does not apply to VPC endpoint traffic. If a proposed answer locks a bucket to 10.0.1.0/24, it is wrong; the working answer is aws:sourceVpce or aws:sourceVpc.
Bucket policy của S3 chỉ giới hạn được theo public IP hoặc Elastic IP — không giới hạn được theo IP private. Traffic qua endpoint mang địa chỉ nguồn là IP private, nên điều kiện aws:SourceIp không có tác dụng gì với traffic đi qua VPC endpoint. Thấy đáp án nào khoá bucket vào 10.0.1.0/24 thì loại ngay; đáp án chạy được là aws:sourceVpce hoặc aws:sourceVpc.
It doesn't work — check in this orderKhông chạy — soi theo đúng thứ tự này
Walk the packet from the instance outwards. Each step is cheap to check and rules out everything before it, so do not skip ahead to IAM — that is the last box, not the first. Đi theo gói tin, từ instance ra ngoài. Mỗi bước kiểm tra rất nhanh và loại trừ hết những bước trước, nên đừng nhảy thẳng xuống IAM — nó là ô cuối cùng, không phải ô đầu tiên.
| CheckKiểm tra gì | What it looks like when this is the faultTriệu chứng khi lỗi nằm ở đây | |
|---|---|---|
| 1 | VPC DNS settings — DNS resolution must be enabled; for an interface endpoint, DNS hostnames tooThiết lập DNS của VPC — phải bật DNS resolution; với interface endpoint thì bật cả DNS hostnames | the name does not resolve at all, or resolves to a public addresstên không phân giải được, hoặc phân giải ra một địa chỉ public |
| 2 | Instance security group, outbound — 443 must be allowed outSecurity group của instance, chiều outbound — phải cho 443 đi ra |
DNS is fine, the connection just hangs and times outDNS ổn, nhưng kết nối treo rồi timeout |
| 3 | Route table — the subnet's table must carry the prefix-list route to the gateway endpointRoute table — table của subnet đó phải có route prefix-list trỏ vào gateway endpoint | works from one subnet and not another — the endpoint was never associated with that tablesubnet này chạy, subnet kia không — endpoint chưa hề được gắn vào table của subnet kia |
| 3′ | For an interface endpoint instead: the hostname resolves to the ENI's private IP, and the endpoint's own security group allows inbound 443Với interface endpoint thì thay bằng: hostname phân giải ra IP private của ENI, và security group của chính endpoint mở inbound 443 |
the classic one — everyone checks the client SG and forgets the endpoint has its ownca kinh điển — ai cũng soi SG phía client rồi quên mất bản thân endpoint cũng có SG riêng |
| 4 | VPC endpoint policy — does it allow this action on this resource?VPC endpoint policy — nó có cho phép action này trên resource này không? | an explicit AccessDenied that survives even with an admin IAM rolebáo AccessDenied rõ ràng, gắn cả role admin vào vẫn y nguyên |
| 5 | S3 bucket policy — a Deny with aws:sourceVpce pointing at a different endpointBucket policy của S3 — một luật Deny với aws:sourceVpce đang trỏ vào một endpoint khác |
works from one VPC, denied from the new one you just builtVPC cũ thì chạy, VPC vừa dựng xong thì bị từ chối |
| 6 | IAM permissions — the instance role actually has s3:GetObject on that prefixQuyền IAM — role của instance có thật sự có s3:GetObject trên prefix đó không |
the boring answer, and the one to reach for lastđáp án nhàm nhất, và cũng là thứ nên nghĩ tới sau cùng |
Things that catch you outNhững chỗ hay sập bẫy
- "Private DNS" is not a private service. It is name resolution inside your VPC. Athena is the same Athena; the resolver just answers with the endpoint ENI's private IP instead of a public one. Outside the VPC, the same name still points at the public endpoint. "Private DNS" không phải là một service riêng tư nào cả. Nó là chuyện phân giải tên trong VPC của bạn. Athena vẫn là Athena đó; chỉ là resolver trả về IP private của ENI thay vì IP public. Ra khỏi VPC thì cái tên ấy vẫn trỏ về endpoint public như thường.
- A gateway endpoint stops at the VPC boundary. VPN, Direct Connect, Transit Gateway, peering — none of them carry it. Any question with "from our data centre" or "from the other VPC" in it has already ruled the gateway endpoint out. Gateway endpoint dừng lại ngay ở biên VPC. VPN, Direct Connect, Transit Gateway, peering — không đường nào mang nó đi được. Đề nào có chữ "từ data center của chúng tôi" hay "từ VPC bên kia" là đã tự loại gateway endpoint rồi.
- The endpoint policy is not a substitute for IAM. It only narrows what can pass through the endpoint. The same principal with the same credentials can still take the public path unless a resource policy denies traffic that did not arrive through the endpoint. Endpoint policy không thay được IAM. Nó chỉ siết những gì đi qua endpoint. Vẫn principal đó, vẫn credential đó, người ta hoàn toàn có thể đi đường public — trừ khi resource policy chặn hẳn mọi request không đến từ endpoint.
-
aws:SourceIpsilently does nothing. Bucket policies filter on public or Elastic IPs, never private ones. The policy saves without error and protects nothing. Useaws:sourceVpceoraws:sourceVpc.aws:SourceIpchẳng làm gì cả mà cũng không báo lỗi. Bucket policy chỉ lọc theo IP public hoặc Elastic IP, không bao giờ theo IP private. Policy lưu lại êm ru mà thực chất không bảo vệ gì. Phải dùngaws:sourceVpcehoặcaws:sourceVpc. - One gateway per VPC, but many route tables. The endpoint is defined at the VPC level; the route is only written into the tables you associated. A subnet you forgot keeps paying the NAT, and nothing looks broken. Mỗi VPC một gateway, nhưng route table thì nhiều. Endpoint khai ở cấp VPC, còn route chỉ được ghi vào những table bạn đã gắn. Subnet nào bỏ sót thì vẫn đi qua NAT và vẫn tính tiền — nhìn bên ngoài chẳng thấy hỏng chỗ nào.
- An interface endpoint has a security group and a bill. One ENI per subnet, charged per hour and per GB. Place one per AZ for availability, then remember that a hundred services × three AZs is a real number on the invoice. Interface endpoint vừa có security group vừa có hoá đơn. Mỗi subnet một ENI, tính tiền theo giờ và theo GB. Muốn HA thì mỗi AZ một cái, nhưng nhớ rằng trăm service nhân ba AZ là một con số có thật trên invoice.
- Cross-Region is supported, same-VPC is not the limit. Endpoints scale horizontally and are redundant by design — there is no instance size to pick and no failover to build. If a design proposes "an HA pair of endpoints", it has misunderstood the object. Dùng xuyên Region được, và không bị bó trong đúng một VPC. Endpoint tự co giãn ngang và vốn đã dự phòng sẵn — không phải chọn size, không phải dựng failover. Thiết kế nào đề xuất "một cặp endpoint HA" là đang hiểu sai bản chất của nó.
Exam reflexesPhản xạ khi đi thi
| The question says…Đề nói… | AnswerTrả lời |
|---|---|
| "Private instances need S3 access without a NAT, at the lowest cost""Instance private cần truy cập S3 mà không qua NAT, rẻ nhất có thể" | Gateway endpoint — free, and it removes the NAT data charge entirelyGateway endpoint — miễn phí, lại cắt sạch tiền data đi qua NAT |
| "On-premises over Direct Connect must reach S3 privately""On-premises qua Direct Connect phải truy cập S3 riêng tư" | S3 interface endpoint. A gateway endpoint cannot be extended out of the VPCS3 interface endpoint. Gateway endpoint không mở rộng ra ngoài VPC được |
"The route table shows a destination of pl-63a5400a""Route table hiện destination là pl-63a5400a" |
That is a gateway endpoint — an AWS prefix list targeting a vpce-…Đó là gateway endpoint — một prefix list của AWS trỏ vào vpce-… |
| "Bucket must be reachable only through one endpoint""Bucket chỉ được truy cập qua đúng một endpoint" | Bucket policy: Deny + StringNotEquals on aws:sourceVpceBucket policy: Deny kèm StringNotEquals trên aws:sourceVpce |
| "Several endpoints in that VPC, one rule for all of them""VPC đó có nhiều endpoint, muốn một luật phủ hết" | Same shape, but the key is aws:sourceVpc — vpc-111bbb22Vẫn khuôn đó, chỉ đổi key thành aws:sourceVpc — vpc-111bbb22 |
| "They restricted the bucket by the instance's private IP and nothing changed""Họ khoá bucket theo IP private của instance mà chẳng thấy khác gì" | aws:SourceIp does not apply to endpoint traffic — public and Elastic IPs onlyaws:SourceIp không áp dụng cho traffic qua endpoint — chỉ IP public và Elastic IP |
| "Go private without changing application code""Chuyển sang đi private mà không sửa code ứng dụng" | Interface endpoint with private DNS, and both VPC DNS settings trueInterface endpoint bật private DNS, và hai thiết lập DNS của VPC đều true |
"Endpoint policy allows only sqs:SendMessage, yet the user calls other APIs""Endpoint policy chỉ cho sqs:SendMessage, mà user vẫn gọi được API khác" |
They went around the endpoint. Add a queue policy denying traffic not from the endpointHọ đi vòng qua endpoint. Thêm queue policy deny mọi request không đến từ endpoint |