Skip to content

cloudthinker-ai/CloudSkills / skills/connections/managing-drata

managing-drata

Verified

Use when working with Drata — drata compliance automation platform for SOC 2, ISO 27001, HIPAA, PCI DSS, and GDPR compliance monitoring. Covers control monitoring, evidence collection, personnel management, asset tracking, and audit readiness. Use when reviewing compliance posture, checking control status, tracking evidence collection, managing personnel compliance, or preparing for security audits.

Drata Management Skill

Manage and analyze Drata compliance controls, evidence, personnel, and audit readiness.

API Conventions

Authentication

All API calls use Authorization: Bearer $DRATA_API_TOKEN -- injected automatically. Never hardcode tokens.

Base URL

https://public-api.drata.com

Core Helper Function

#!/bin/bash

drata_api() {
    local method="$1"
    local endpoint="$2"
    local data="${3:-}"

    if [ -n "$data" ]; then
        curl -s -X "$method" \
            -H "Authorization: Bearer $DRATA_API_TOKEN" \
            -H "Content-Type: application/json" \
            "https://public-api.drata.com${endpoint}" \
            -d "$data"
    else
        curl -s -X "$method" \
            -H "Authorization: Bearer $DRATA_API_TOKEN" \
            -H "Content-Type: application/json" \
            "https://public-api.drata.com${endpoint}"
    fi
}

Output Rules

  • TOKEN EFFICIENCY: Extract only needed fields with jq
  • Target <=50 lines per script output
  • Never dump full API responses

Discovery Phase

#!/bin/bash
echo "=== Compliance Frameworks ==="
drata_api GET "/compliance-frameworks" \
    | jq -r '.data[] | "\(.id)\t\(.name)\tenabled:\(.enabled)"' | column -t | head -10

echo ""
echo "=== Control Summary ==="
drata_api GET "/controls?limit=1" \
    | jq '"Total controls: \(.pagination.total)"' -r

echo ""
echo "=== Personnel Count ==="
drata_api GET "/personnel?limit=1" \
    | jq '"Total personnel: \(.pagination.total)"' -r

Analysis Phase

Control Status Overview

#!/bin/bash
echo "=== Controls by Status ==="
drata_api GET "/controls?limit=200" \
    | jq -r '{
        total: (.data | length),
        passing: ([.data[] | select(.status == "PASSING")] | length),
        failing: ([.data[] | select(.status == "FAILING")] | length),
        not_tested: ([.data[] | select(.status == "NOT_TESTED")] | length)
    }'

echo ""
echo "=== Failing Controls ==="
drata_api GET "/controls?limit=200" \
    | jq -r '.data[] | select(.status == "FAILING") | "\(.status)\t\(.name[0:50])\t\(.controlId)"' \
    | column -t | head -20

echo ""
echo "=== Controls by Category ==="
drata_api GET "/controls?limit=200" \
    | jq -r '[.data[].category] | group_by(.) | map({category: .[0], count: length}) | sort_by(.count) | reverse | .[] | "\(.count)\t\(.category)"' | column -t | head -10

Evidence Collection

#!/bin/bash
echo "=== Evidence Status ==="
drata_api GET "/evidence?limit=200" \
    | jq '{
        total: (.data | length),
        collected: ([.data[] | select(.status == "COLLECTED")] | length),
        missing: ([.data[] | select(.status == "MISSING")] | length),
        expired: ([.data[] | select(.status == "EXPIRED")] | length)
    }'

echo ""
echo "=== Missing Evidence ==="
drata_api GET "/evidence?limit=50&status=MISSING" \
    | jq -r '.data[] | "\(.controlName[0:30])\t\(.evidenceName[0:40])\t\(.status)"' \
    | column -t | head -15

Personnel Compliance

#!/bin/bash
echo "=== Personnel Compliance Status ==="
drata_api GET "/personnel?limit=200" \
    | jq '{
        total: (.data | length),
        compliant: ([.data[] | select(.complianceStatus == "COMPLIANT")] | length),
        non_compliant: ([.data[] | select(.complianceStatus == "NON_COMPLIANT")] | length)
    }'

echo ""
echo "=== Non-Compliant Personnel ==="
drata_api GET "/personnel?limit=50&complianceStatus=NON_COMPLIANT" \
    | jq -r '.data[] | "\(.name)\t\(.email[0:30])\t\(.complianceStatus)\treason:\(.nonComplianceReasons[0] // "N/A")"' \
    | column -t | head -15

Asset Inventory

#!/bin/bash
echo "=== Assets by Type ==="
drata_api GET "/assets?limit=200" \
    | jq -r '[.data[].assetType] | group_by(.) | map({type: .[0], count: length}) | sort_by(.count) | reverse | .[] | "\(.count)\t\(.type)"' | column -t

echo ""
echo "=== Unmanaged Assets ==="
drata_api GET "/assets?limit=50&managed=false" \
    | jq -r '.data[] | "\(.name[0:30])\t\(.assetType)\t\(.owner // "No owner")"' | column -t | head -10

Output Format

Present results as a structured report:

Managing Drata Report
═════════════════════
Resources discovered: [count]

Resource       Status    Key Metric    Issues
──────────────────────────────────────────────
[name]         [ok/warn] [value]       [findings]

Summary: [total] resources | [ok] healthy | [warn] warnings | [crit] critical
Action Items: [list of prioritized findings]

Target ≤50 lines of output. Use tables for multi-resource comparisons.

Anti-Hallucination Rules

  1. NEVER assume resource names — always discover via CLI/API in Phase 1 before referencing in Phase 2.
  2. NEVER fabricate metric names or dimensions — verify against the service documentation or --help output.
  3. NEVER mix CLI commands between service versions — confirm which version/API you are targeting.
  4. ALWAYS use the discovery → verify → analyze chain — every resource referenced must have been discovered first.
  5. ALWAYS handle empty results gracefully — an empty response is valid data, not an error to retry.

Counter-Rationalizations

ShortcutCounterWhy
"I'll skip discovery and check known resources"Always run Phase 1 discovery firstResource names change, new resources appear — assumed names cause errors
"The user only asked for a quick check"Follow the full discovery → analysis flowQuick checks miss critical issues; structured analysis catches silent failures
"Default configuration is probably fine"Audit configuration explicitlyDefaults often leave logging, security, and optimization features disabled
"Metrics aren't needed for this"Always check relevant metrics when availableAPI/CLI responses show current state; metrics reveal trends and intermittent issues
"I don't have access to that"Try the command and report the actual errorAssumed permission failures prevent useful investigation; actual errors are informative

Common Pitfalls

  • Pagination: Use limit and page parameters -- check pagination.total for total count
  • Rate limits: 100 requests/minute -- check X-RateLimit-Remaining header
  • Control IDs: Controls have both internal IDs and framework-specific control IDs
  • Evidence auto-collection: Some evidence is auto-collected via integrations -- check connection status
  • Framework scoping: Controls map to multiple frameworks -- filter by framework when needed
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 192kUpdated Claude CodeCodexVerifiedInstall