API Documentation

This document provides detailed information about the Securelog API, including endpoints, request/response schemas, and authentication requirements.

Base URL

All API requests should be made to: https://api.securelog.com

Authentication

The Securelog API uses API key authentication. Include your API key in the x-api-key header for all requests.

Example:

GET /auth HTTP/1.1
Host: api.securelog.com
x-api-key: YOUR_API_KEY

API Key Authentication

GET /auth

Validates the provided API key.

Response:

{
  "status": "success",
  "message": "API key is valid"
}

Analyze

POST /analyze

Analyzes a repository for secrets and vulnerabilities.

Request Body:

{
  "url": "https://github.com/user/repo"
}

Response:

{
  "result": "success",
  "total": 5,
  "gitSecrets": 3,
  "codeSecrets": 2
}

Mask Secret

POST /mask-secret

Masks sensitive information in the provided text.

Request Body:

{
  "text": "This is a secret: 12345",
  "maskedValue": "*****",
  "visibleChars": 2,
  "customDetectors": [
    {
      "regex": "\\d{5}",
      "keywords": ["secret"],
      "detectorType": "custom"
    }
  ]
}

Response:

{
  "status": true,
  "maskedText": "This is a secret: **345",
  "secrets": [
    {
      "detectorType": "custom",
      "rawValue": "12345",
      "verified": true,
      "position": 18,
      "extras": {}
    }
  ]
}