Skip to content

Commit d21398b

Browse files
authored
feat(seo): add 5 Learning Center articles and SEO contributing guide (P3) (#2027)
1 parent f22dc3b commit d21398b

File tree

4 files changed

+526
-0
lines changed

4 files changed

+526
-0
lines changed

CONTRIBUTING-SEO.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# SEO Guidelines for Apache APISIX Website Contributors
2+
3+
This document provides SEO best practices for anyone contributing content to the Apache APISIX website, documentation, or blog. Following these guidelines ensures that our content ranks well in both traditional search engines and AI-powered search (Google AI Overviews, ChatGPT, Perplexity).
4+
5+
## Frontmatter Requirements
6+
7+
Every Markdown page (blog post, doc page, learning center article) **must** include:
8+
9+
```yaml
10+
---
11+
title: "Human-Readable Title - Primary Keyword | Apache APISIX"
12+
description: "120-160 character description that accurately summarizes the page content and includes the primary keyword naturally."
13+
---
14+
```
15+
16+
### Title Rules
17+
18+
- **Length**: 50-60 characters (Google truncates longer titles in SERPs)
19+
- **Format**: `Primary Topic - Modifier | Apache APISIX`
20+
- **Keyword placement**: Put the primary keyword near the front
21+
- **Human-readable**: Write for humans, not bots. No keyword stuffing.
22+
- **Plugin pages**: Use the human-readable name, not just the code identifier
23+
- Good: `Rate Limiting Plugin (limit-req) | Apache APISIX`
24+
- Bad: `limit-req | Apache APISIX`
25+
26+
### Description Rules
27+
28+
- **Length**: 120-160 characters
29+
- **Content**: Describe the page honestly and include the main topic naturally
30+
- **Action-oriented**: Start with a verb when possible ("Learn how to...", "Configure...", "Compare...")
31+
32+
## Content Structure
33+
34+
### Answer-First Writing
35+
36+
Place the primary answer or definition in the **first 40-60 words** of the page. AI search engines preferentially extract opening paragraphs.
37+
38+
```markdown
39+
## What is an API Gateway?
40+
41+
An API gateway is a server that sits between clients and backend
42+
services, acting as the single entry point for all API traffic.
43+
It handles authentication, rate limiting, and routing so that
44+
individual services don't need to implement these concerns.
45+
46+
[Rest of the detailed content follows...]
47+
```
48+
49+
### Heading Hierarchy
50+
51+
- **One H1 per page** (the `title` in frontmatter)
52+
- Use H2 for major sections, H3 for subsections
53+
- Headings should match developer search queries when possible
54+
- Good: `## How to Configure Rate Limiting in APISIX`
55+
- Bad: `## Configuration`
56+
- Never skip heading levels (H1 → H3 without H2)
57+
58+
### Statistics and Data
59+
60+
Include **at least one statistic or data point every 150-200 words**. Concrete numbers make content more authoritative and more likely to be cited by AI engines.
61+
62+
Examples:
63+
64+
- "Apache APISIX processes 18,000 requests per second per core with 0.2ms latency"
65+
- "Over 147,000 deployments across 5,200+ companies"
66+
- "100+ built-in plugins covering authentication, security, and traffic control"
67+
68+
Always cite the source when referencing external statistics.
69+
70+
### Internal Linking
71+
72+
- Every page should include **at least 2 internal links** to related content
73+
- Use descriptive anchor text, not "click here" or "learn more"
74+
- Good: `[rate limiting plugin documentation](/docs/apisix/plugins/limit-req/)`
75+
- Bad: `[click here](/docs/apisix/plugins/limit-req/)`
76+
- Link from new pages to relevant existing content
77+
- Use relative paths for internal links
78+
79+
### FAQ Sections
80+
81+
For Learning Center articles, include a FAQ section at the end with 3-5 questions:
82+
83+
```markdown
84+
## Frequently Asked Questions
85+
86+
### What is the difference between an API gateway and a load balancer?
87+
88+
[Concise, direct answer in 2-3 sentences]
89+
90+
### Do I need an API gateway for microservices?
91+
92+
[Concise, direct answer]
93+
```
94+
95+
FAQ content is highly valued by AI search engines and can appear as rich results in Google SERPs.
96+
97+
## Images
98+
99+
- **Alt text is mandatory**: Every image must have descriptive alt text
100+
- Good: `alt="Apache APISIX architecture diagram showing request flow from client through gateway to upstream services"`
101+
- Bad: `alt="diagram"` or `alt=""`
102+
- Include explicit `width` and `height` attributes
103+
- Use `loading="lazy"` for below-the-fold images
104+
- Use WebP or AVIF formats when possible
105+
106+
## Blog Posts
107+
108+
### Evergreen Content
109+
110+
- Avoid time-relative phrases like "recently" or "last month"
111+
- Use absolute dates: "In March 2026" instead of "last quarter"
112+
- Update posts when information becomes outdated (and update the `date` in frontmatter)
113+
114+
### Blog Post Metadata
115+
116+
```yaml
117+
---
118+
title: "Descriptive Title With Primary Keyword"
119+
authors:
120+
- name: Author Name
121+
description: "120-160 character description"
122+
tags: [relevant, tags]
123+
image: /path/to/og-image.png # Required for social sharing
124+
---
125+
```
126+
127+
## Technical SEO Checklist
128+
129+
Before submitting a PR that adds or modifies content pages:
130+
131+
- [ ] Title tag is 50-60 characters with primary keyword near the front
132+
- [ ] Meta description is 120-160 characters and accurately describes the page
133+
- [ ] Only one H1 per page
134+
- [ ] Heading hierarchy is logical (H1 > H2 > H3, no skipped levels)
135+
- [ ] At least 2 internal links to related content
136+
- [ ] All images have descriptive alt text
137+
- [ ] Opening paragraph directly answers the page topic (answer-first)
138+
- [ ] At least 1 statistic or data point per 200 words
139+
- [ ] No duplicate content with existing pages
140+
- [ ] Blog posts have an `image` field for social sharing
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: "API Gateway Security: Threats, Best Practices & Implementation"
3+
description: "Learn how to secure your API gateway against common threats. Covers authentication, authorization, rate limiting, WAF, IP filtering, and zero-trust architecture."
4+
slug: api-gateway-security
5+
date: 2026-04-14
6+
tags: [security, api-gateway, best-practices]
7+
hide_table_of_contents: false
8+
---
9+
10+
API gateway security is the practice of protecting your API infrastructure at the edge by enforcing authentication, authorization, rate limiting, and traffic filtering before requests reach backend services. A properly secured gateway reduces attack surface, prevents data breaches, and ensures compliance across every API endpoint in your organization.
11+
12+
## Why API Gateway Security Matters
13+
14+
APIs have become the primary attack vector for modern applications. According to the OWASP API Security Top 10 (2023 edition), broken object-level authorization and broken authentication remain the two most critical API vulnerabilities, affecting organizations across every industry. The explosive growth of API-first architectures has created an equally explosive growth in API-targeted attacks.
15+
16+
The cost of getting API security wrong is substantial, as breaches involving API vulnerabilities tend to take longer to identify and contain and carry significant financial impact. The API gateway sits at a unique vantage point: it processes every inbound request, making it the single most effective location to enforce security policies consistently.
17+
18+
## Common API Threats
19+
20+
Understanding the threat landscape is essential for building an effective defense. The following categories represent the most frequent and damaging attack patterns targeting APIs today.
21+
22+
### Broken Object-Level Authorization (BOLA)
23+
24+
BOLA attacks exploit weak authorization checks to access resources belonging to other users. An attacker modifies object identifiers in API requests (for example, changing `/users/123/orders` to `/users/456/orders`) to retrieve unauthorized data. BOLA remains one of the most exploited API vulnerability classes, particularly in organizations where API management and authorization enforcement have not kept pace with API proliferation.
25+
26+
### Injection Attacks
27+
28+
SQL injection, NoSQL injection, and command injection remain persistent threats. Attackers embed malicious payloads in query parameters, headers, or request bodies. Despite being a well-known vulnerability class, injection attacks continue to appear frequently in web application security assessments.
29+
30+
### Broken Authentication
31+
32+
Weak or improperly implemented authentication mechanisms allow attackers to assume legitimate user identities. Common failures include missing token validation, weak password policies, credential stuffing vulnerabilities, and improper session management. Credential stuffing attacks account for billions of login attempts monthly across the internet.
33+
34+
### Excessive Data Exposure
35+
36+
APIs frequently return more data than the client needs, relying on the frontend to filter sensitive fields. Attackers bypass the frontend and consume raw API responses directly, gaining access to data never intended for display. This over-exposure is especially dangerous in mobile applications where API traffic is easily intercepted.
37+
38+
### Rate Limit Bypass
39+
40+
Without proper rate limiting, attackers can launch brute-force attacks, denial-of-service campaigns, and credential enumeration at scale. Automated bot traffic constitutes a significant portion of all internet traffic, and much of it targets API endpoints specifically.
41+
42+
## Security Layers at the Gateway
43+
44+
A defense-in-depth approach applies multiple security controls at the gateway layer, each addressing a distinct category of risk.
45+
46+
### Authentication
47+
48+
The gateway should verify identity before any request reaches a backend service. Common mechanisms include JWT validation, OAuth 2.0 token introspection, API key verification, and mutual TLS (mTLS) for service-to-service communication. Centralizing authentication at the gateway eliminates the risk of inconsistent enforcement across individual services.
49+
50+
### Authorization
51+
52+
Beyond verifying identity, the gateway must enforce access control. Role-based access control (RBAC), attribute-based access control (ABAC), and scope-based authorization ensure that authenticated users can only access resources and operations they are permitted to use. Fine-grained authorization at the gateway prevents BOLA vulnerabilities at scale.
53+
54+
### Rate Limiting and Throttling
55+
56+
Rate limiting protects backend services from abuse and ensures fair resource allocation. Effective rate limiting operates at multiple granularities: per consumer, per route, per IP address, and globally. A substantial share of traffic on the average website comes from bots, and rate limiting is the first line of defense against automated abuse.
57+
58+
### IP Restriction
59+
60+
IP allowlists and denylists provide coarse-grained access control. While not sufficient as a sole security measure, IP restriction is valuable for restricting administrative endpoints, limiting partner API access to known address ranges, and blocking traffic from regions associated with attack activity.
61+
62+
### WAF and CORS
63+
64+
A Web Application Firewall (WAF) at the gateway layer inspects request payloads for known attack patterns. CORS policies prevent unauthorized cross-origin requests from browser-based clients. Together, they address both server-side injection attacks and client-side cross-origin abuse.
65+
66+
### TLS Termination
67+
68+
TLS termination at the gateway ensures that all client-to-gateway traffic is encrypted. The gateway handles certificate management, cipher suite configuration, and protocol version enforcement, relieving backend services of this operational burden. The vast majority of web traffic now uses HTTPS, and TLS is considered a baseline requirement for any production API.
69+
70+
### Request Validation
71+
72+
Schema-based request validation rejects malformed or oversized payloads before they reach backend services. Validating request structure, data types, and content length at the gateway prevents injection attacks and reduces the attack surface of downstream services.
73+
74+
## Zero-Trust API Architecture
75+
76+
Zero-trust architecture assumes that no request is inherently trustworthy, regardless of its origin. Every API call must be authenticated, authorized, and validated, whether it arrives from the public internet, an internal service, or a trusted partner.
77+
78+
At the gateway layer, zero-trust principles translate into several concrete practices. Every request carries verifiable identity credentials. Authorization is evaluated per request rather than per session. Network location (internal vs. external) does not confer implicit trust. All traffic is encrypted, including east-west service-to-service communication.
79+
The API gateway enables zero-trust by serving as a policy enforcement point. It validates tokens, checks permissions, and applies security policies uniformly across all traffic, creating a consistent security boundary regardless of the underlying network topology.
80+
81+
## Security Best Practices
82+
83+
The following practices represent a comprehensive approach to API gateway security that organizations should adopt incrementally based on risk profile.
84+
85+
1. **Enforce authentication on every endpoint.** No API route should be accessible without verified identity. Use JWTs with short expiration times and validate signatures on every request.
86+
87+
2. **Implement least-privilege authorization.** Grant the minimum permissions required for each consumer. Default to deny and require explicit grants for sensitive operations.
88+
89+
3. **Apply rate limiting at multiple levels.** Configure per-consumer, per-route, and global rate limits. Use sliding window algorithms to prevent burst abuse while accommodating legitimate traffic spikes.
90+
91+
4. **Validate all request inputs.** Enforce request schema validation at the gateway. Reject payloads that exceed expected sizes, contain unexpected fields, or fail type checks.
92+
93+
5. **Use mutual TLS for service-to-service calls.** Encrypt and authenticate all internal traffic. Rotate certificates automatically and enforce certificate validation on every connection.
94+
95+
6. **Enable WAF rules for known attack patterns.** Deploy rulesets targeting SQL injection, XSS, and command injection. Update rules regularly to address emerging attack vectors.
96+
97+
7. **Log and audit all security events.** Capture authentication failures, authorization denials, rate limit triggers, and WAF blocks. Feed security logs into a SIEM for correlation and alerting.
98+
99+
8. **Rotate credentials and secrets regularly.** Automate API key rotation, certificate renewal, and token signing key rotation. Never embed secrets in client-side code or version control.
100+
101+
9. **Restrict administrative API access.** Protect management APIs with strong authentication, IP restrictions, and separate credentials from data-plane APIs.
102+
103+
10. **Conduct regular security assessments.** Perform API-specific penetration testing, not just general web application assessments. The OWASP API Security Testing Guide provides a structured methodology.
104+
105+
## How Apache APISIX Secures APIs
106+
107+
Apache APISIX provides a comprehensive set of security plugins that implement each layer of the defense-in-depth model described above.
108+
109+
For **IP-based access control**, the [ip-restriction plugin](/docs/apisix/plugins/ip-restriction/) supports allowlists and denylists at the route level, enabling fine-grained control over which addresses can reach specific endpoints.
110+
111+
**Cross-origin resource sharing** is managed through the [CORS plugin](/docs/apisix/plugins/cors/), which configures allowed origins, methods, and headers to prevent unauthorized cross-origin requests from browser clients.
112+
113+
**CSRF protection** is available through the [CSRF plugin](/docs/apisix/plugins/csrf/), which generates and validates CSRF tokens to prevent cross-site request forgery attacks on state-changing API operations.
114+
115+
For **mutual TLS**, APISIX supports [mTLS configuration](/docs/apisix/mtls/) for both client-to-gateway and gateway-to-upstream connections, ensuring encrypted and mutually authenticated communication at every hop.
116+
117+
APISIX also supports JWT authentication, key authentication, OpenID Connect, rate limiting with multiple algorithms, and request body validation. The plugin architecture enables security policies to be composed per route, allowing teams to apply exactly the controls each endpoint requires without over- or under-securing traffic.
118+
119+
## FAQ
120+
121+
### What is the difference between API gateway security and API security?
122+
123+
API security is the broad discipline of protecting APIs across their entire lifecycle, including design, development, testing, and runtime. API gateway security specifically refers to the security controls enforced at the gateway layer during runtime, such as authentication, rate limiting, and input validation. The gateway is one component of a comprehensive API security strategy, not a replacement for secure coding practices and security testing.
124+
125+
### Should I terminate TLS at the API gateway or at the backend service?
126+
127+
Terminate TLS at the gateway for client-facing connections. This centralizes certificate management and offloads cryptographic processing from backend services. For traffic between the gateway and upstream services, use mTLS to maintain encryption and mutual authentication throughout the request path. This approach balances operational simplicity with end-to-end security.
128+
129+
### How many rate limiting layers should an API gateway enforce?
130+
131+
Apply at least three layers: a global rate limit to protect overall infrastructure capacity, a per-consumer limit to prevent any single client from monopolizing resources, and per-route limits for endpoints with expensive backend operations. Use sliding window or leaky bucket algorithms rather than fixed windows to provide smoother throttling behavior and prevent burst abuse at window boundaries.

0 commit comments

Comments
 (0)