Audit & Compliance

Complete audit trails and compliance features for Amazon marketplace requirements

Audit & Compliance

Data Border is built from the ground up for compliance with Amazon's SP-API requirements. Every operation is logged, attributed, and auditable.

What Gets Logged

PII Access Events

Every PII access is recorded with comprehensive context:

{
  "type": "pii_access",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "orderId": "123-4567890-1234567",
  "sellerId": "seller_abc123",
  "tenantId": "tenant_xyz789",
  "action": "getPII",
  "success": true,
  "ip": "203.0.113.42",
  "userAgent": "WMS-Client/1.0",
  "accessCount": 1,
  "isBlocked": false
}

Security Events

Security-relevant operations are logged separately:

{
  "type": "security",
  "timestamp": "2024-01-15T10:30:05.000Z",
  "event": "rate_limit_exceeded",
  "ip": "203.0.113.42",
  "endpoint": "/api/pii/getPII",
  "orderId": "123-4567890-1234567",
  "sellerId": "seller_abc123"
}

Authentication Events

{
  "type": "authentication",
  "timestamp": "2024-01-15T10:29:55.000Z",
  "event": "token_validated",
  "tokenType": "seller_access",
  "sellerId": "seller_abc123",
  "tenantId": "tenant_xyz789",
  "ip": "203.0.113.42"
}

Label & Print Operations

{
  "type": "label_proxy",
  "timestamp": "2024-01-15T10:30:10.000Z",
  "amazonOrderId": "123-4567890-1234567",
  "shipmentId": "ship_def456",
  "carrier": "easypost",
  "sellerId": "seller_abc123",
  "tenantId": "tenant_xyz789",
  "documentsCreated": 1
}
{
  "type": "print",
  "timestamp": "2024-01-15T10:31:00.000Z",
  "shipmentId": "ship_def456",
  "printCount": 1,
  "isReprint": false,
  "printerType": "label",
  "printerId": "warehouse-zebra-1",
  "documentsCount": 1
}

Log Categories

All logs include a type field for filtering and SIEM integration:

TypeDescriptionExamples
securityWAF events, violationsRate limits, blocked IPs
authenticationAuth operationsToken validation, OAuth
amazon_apiSP-API interactionsToken generation, API calls
pii_accessPII operationsGet/block/complete PII
label_proxyLabel generationCarrier requests, scrubbing
printPrint operationsDevice Hub jobs, reprints
passthroughAPI proxySP-API passthrough requests
configurationConfig changesSetting updates
health_checkSystem healthDatabase, storage checks
systemApp lifecycleStartup, shutdown

Data Attribution

Amazon requires that data retrieved from SP-API be attributed to its source. Data Border automatically tags all data:

{
  "data_source": "sp-api",
  "retrieved_at": "2024-01-15T10:30:00.000Z",
  "seller_id": "A1B2C3D4E5F6G7",
  "marketplace_id": "ATVPDKIKX0DER"
}

This attribution is:

  • Included in API responses where appropriate
  • Stored with labels and documents
  • Available in audit logs

Rate Limiting & Throttling

Data Border implements multiple layers of rate limiting:

Per-Order PII Limits

LimitValuePurpose
Access per hour1Prevent repeated fetching
After completionBlockedNo access to shipped orders
After manual blockBlockedExplicit access termination

Per-Tenant Limits

LimitValuePurpose
File operations/day50Prevent bulk file extraction
Label requestsCarrier limitsRespect carrier rate limits

Per-IP Limits

EndpointLimitWindow
/auth/*5 requests10 seconds
General APIAdaptiveBased on patterns

WAF Protection (Arcjet)

When enabled, Arcjet provides:

  • SQL injection protection
  • XSS attack prevention
  • Request signature validation
  • Geographic blocking (if configured)

Suspicious Activity Detection

Data Border monitors for and alerts on unusual patterns:

Automatic Detection

  • Shipped order access: Attempting to access PII for orders already marked shipped
  • Bulk access patterns: Unusually high volume of PII requests
  • Off-hours access: Access outside normal business patterns
  • Geographic anomalies: Requests from unexpected locations
  • Failed authentication spikes: Potential credential attacks

Alerting

Suspicious activity generates:

  • Log entries with type: "security"
  • Optional webhook notifications
  • Dashboard alerts (if SIEM integrated)

Compliance Reports

PII Access Report

Query all PII access for a time period:

# Example: Query logs in your SIEM
type:pii_access AND timestamp:[2024-01-01 TO 2024-01-31]

Fields available:

  • orderId - Which order
  • sellerId - Which seller
  • tenantId - Which WMS
  • action - What was done
  • success - Whether it succeeded
  • ip - Source IP
  • timestamp - When

Track label printing:

type:print AND sellerId:seller_abc123

Fields available:

  • shipmentId - Which shipment
  • printCount - How many times
  • isReprint - Was it a reprint
  • printerType - Label or laser
  • printerId - Which printer

Integration with Logging Systems

BetterStack

Data Border logs integrate with BetterStack (or similar) via Fly.io log shipping:

# Deploy log shipper (one-time setup)
cd log-shipper
fly launch --org your-org --no-deploy
fly secrets set BETTER_STACK_SOURCE_TOKEN="your_token"
fly deploy --ha=false

Generic SIEM Integration

All logs are:

  • JSON formatted
  • Include consistent fields (type, timestamp, tenantId, sellerId)
  • Streamable to any log aggregator

Retention & Cleanup

What's Retained

Data TypeRetentionNotes
PII access logsConfigurableRequired for compliance
Security eventsConfigurableCritical for audits
Labels/documentsUntil deletedStored in S3
Amazon tokensUntil revokedEncrypted at rest

What's NOT Retained

  • Customer PII (fetched on-demand)
  • Amazon access tokens (generated per-request)
  • Request/response bodies (only metadata logged)

Compliance Checklist

Use this checklist for Amazon compliance reviews:

PII Access Controls

  • All PII access logged with order ID
  • Access blocked after order completion
  • Rate limiting prevents bulk extraction
  • Manual blocking available

Data Security

  • Amazon tokens encrypted at rest (AES-256-GCM)
  • TLS for all communications
  • WAF protection available
  • IP-based rate limiting

Audit Trail

  • Complete PII access history
  • Security event logging
  • Print/reprint tracking
  • Data attribution

Data Minimization

  • PII fetched on-demand only
  • Scrubbed responses to WMS
  • Labels stored securely, printed directly
  • No unnecessary PII retention

Next Steps

Security Deep Dive

Understand Data Border's encryption and security architecture.

API Reference

Complete API documentation.