Sc api security

From ersinkoc/security-check · View interactive version

Sc api security is an AI agent skill from the GitHub repository ersinkoc/security-check. REST, GraphQL, and gRPC API security audit — authentication, authorization, data exposure, and configuration

How to use this skill

Skill file

SC: API Security Audit

Purpose

Performs a comprehensive security audit of API endpoints covering broken object-level authorization, broken function-level authorization, excessive data exposure, missing rate limiting, mass assignment, security misconfiguration, and injection via API parameters. Covers REST, GraphQL, and gRPC API patterns, aligned with the OWASP API Security Top 10.

Activation

Called by sc-orchestrator during Phase 2 when APIs are detected in the architecture.

Phase 1: Discovery

Keyword Patterns to Search

# REST
"app.get(", "app.post(", "app.put(", "app.delete(", "app.patch(",
"router.get(", "@GetMapping", "@PostMapping", "@app.route(",
"[HttpGet]", "[HttpPost]", "r.GET(", "r.POST("

# GraphQL
"typeDefs", "resolvers", "Mutation", "Query", "Subscription"

# gRPC
".proto", "service ", "rpc ", "grpc.Server"

# API configuration
"swagger", "openapi", "api-docs", "Swashbuckle"

OWASP API Security Top 10 Checks

1. Broken Object Level Authorization (BOLA/IDOR):

2. Broken Authentication:

3. Broken Object Property Level Authorization:

// VULNERABLE: Returning all user fields including sensitive ones
app.get('/api/users/:id', async (req, res) => {
  const user = await User.findById(req.params.id);
  res.json(user);  // Includes passwordHash, internalId, role, etc.
});

// SAFE: Return only needed fields
app.get('/api/users/:id', async (req, res) => {
  const user = await User.findById(req.params.id).select('name email avatar');
  res.json(user);
});

4. Unrestricted Resource Consumption:

5. Broken Function Level Authorization:

6. Server-Side Request Forgery:

7. Security Misconfiguration:

// Check for exposed API documentation in production
// /swagger, /api-docs, /graphql (introspection), /openapi.json
// Check for verbose error messages in API responses
// Check for missing security headers

8. Lack of Protection from Automated Threats:

REST-Specific Checks

GraphQL-Specific Checks

gRPC-Specific Checks

Severity Classification

Output Format

Finding: API-{NNN}

Common False Positives

  1. Public APIs — intentionally open endpoints (health checks, public product listings)
  2. Gateway-level auth — authentication enforced at API gateway, not application code
  3. Internal microservice APIs — service-to-service communication with network-level security
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.