Spaces:
Running
Running
Produce a one-page landing section that targets seed-stage founders. Headline: From config chaos to investor confidence in forty-eight hours. Sections: pain points, how the audit works, deliverables, pricing tiers (Audit, Pulse, Sprint), social proof placeholder. Suggest a minimal visual layout with call-to-action buttons. Return as Markdown with HTML-class hints for easy styling. - Initial Deployment
92aef33 verified Download index.html from clearpathit/clear-path-it: direct link, hf CLI and curl.
- Browser
- Download file 30.9 kB
-
https://huggingface.co/spaces/clearpathit/clear-path-it/resolve/main/index.html
- Command line
-
hf download hf://spaces/clearpathit/clear-path-it/index.html
-
curl -L -o index.html https://huggingface.co/spaces/clearpathit/clear-path-it/resolve/main/index.html
30.9 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Rapid IT Health Audit - ER Diagram</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> | |
| <style> | |
| .mermaid { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| .entity-card { | |
| transition: all 0.3s ease; | |
| } | |
| .entity-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); | |
| } | |
| .prose ol { | |
| counter-reset: list-counter; | |
| } | |
| .prose ol li { | |
| position: relative; | |
| padding-left: 1.75em; | |
| } | |
| .prose ol li:before { | |
| content: counter(list-counter) "."; | |
| counter-increment: list-counter; | |
| position: absolute; | |
| left: 0; | |
| font-weight: 600; | |
| color: #4f46e5; | |
| } | |
| @media (max-width: 768px) { | |
| .mermaid { | |
| zoom: 0.7; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <div class="container mx-auto px-4 py-8"> | |
| <header class="mb-12 text-center"> | |
| <h1 class="text-4xl font-bold text-indigo-800 mb-2">Rapid IT Health Audit</h1> | |
| <p class="text-xl text-gray-600">Data Pipeline Entity Relationship Diagram</p> | |
| <div class="mt-6"> | |
| <span class="inline-block bg-indigo-100 text-indigo-800 px-4 py-2 rounded-full text-sm font-medium"> | |
| SaaS Architecture | |
| </span> | |
| </div> | |
| </header> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Entity Relationship Diagram</h2> | |
| <p class="text-gray-600 mt-2">Visual representation of the core data model</p> | |
| </div> | |
| <div class="p-6 bg-gray-50"> | |
| <div class="mermaid"> | |
| erDiagram | |
| ASSET ||--o{ CONTROL : "has" | |
| CONTROL ||--o{ EVIDENCE : "requires" | |
| CONTROL ||--o{ COST_ITEM : "incurs" | |
| CONTROL ||--o{ RISK : "mitigates" | |
| ASSET { | |
| string asset_id PK | |
| string name | |
| string type | |
| string location | |
| string owner | |
| date purchase_date | |
| boolean is_critical | |
| } | |
| CONTROL { | |
| string control_id PK | |
| string name | |
| string description | |
| string standard | |
| string implementation_status | |
| date last_review_date | |
| } | |
| EVIDENCE { | |
| string evidence_id PK | |
| string control_id FK | |
| string type | |
| string file_path | |
| date collection_date | |
| string collected_by | |
| boolean is_valid | |
| } | |
| COST_ITEM { | |
| string cost_id PK | |
| string control_id FK | |
| decimal amount | |
| string currency | |
| string category | |
| date incurred_date | |
| string justification | |
| } | |
| RISK { | |
| string risk_id PK | |
| string control_id FK | |
| string description | |
| string impact | |
| string likelihood | |
| string mitigation_strategy | |
| date identified_date | |
| } | |
| </div> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12"> | |
| <div class="entity-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg"> | |
| <div class="bg-indigo-600 p-4"> | |
| <h3 class="text-white text-lg font-semibold">Asset</h3> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 mb-4">Represents IT infrastructure components (hardware, software, network devices) that need to be audited.</p> | |
| <div class="bg-gray-100 p-3 rounded"> | |
| <p class="text-sm font-medium text-gray-800">Fields:</p> | |
| <ul class="text-xs text-gray-600 mt-1 space-y-1"> | |
| <li>asset_id (PK): string</li> | |
| <li>name: string</li> | |
| <li>type: string</li> | |
| <li>location: string</li> | |
| <li>owner: string</li> | |
| <li>purchase_date: date</li> | |
| <li>is_critical: boolean</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="entity-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg"> | |
| <div class="bg-green-600 p-4"> | |
| <h3 class="text-white text-lg font-semibold">Control</h3> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 mb-4">Security controls or compliance measures applied to assets to mitigate risks and meet standards.</p> | |
| <div class="bg-gray-100 p-3 rounded"> | |
| <p class="text-sm font-medium text-gray-800">Fields:</p> | |
| <ul class="text-xs text-gray-600 mt-1 space-y-1"> | |
| <li>control_id (PK): string</li> | |
| <li>name: string</li> | |
| <li>description: string</li> | |
| <li>standard: string</li> | |
| <li>implementation_status: string</li> | |
| <li>last_review_date: date</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="entity-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg"> | |
| <div class="bg-purple-600 p-4"> | |
| <h3 class="text-white text-lg font-semibold">Evidence</h3> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 mb-4">Documentation proving that controls are properly implemented (screenshots, logs, config files).</p> | |
| <div class="bg-gray-100 p-3 rounded"> | |
| <p class="text-sm font-medium text-gray-800">Fields:</p> | |
| <ul class="text-xs text-gray-600 mt-1 space-y-1"> | |
| <li>evidence_id (PK): string</li> | |
| <li>control_id (FK): string</li> | |
| <li>type: string</li> | |
| <li>file_path: string</li> | |
| <li>collection_date: date</li> | |
| <li>collected_by: string</li> | |
| <li>is_valid: boolean</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="entity-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg"> | |
| <div class="bg-yellow-600 p-4"> | |
| <h3 class="text-white text-lg font-semibold">CostItem</h3> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 mb-4">Financial aspects associated with implementing and maintaining controls.</p> | |
| <div class="bg-gray-100 p-3 rounded"> | |
| <p class="text-sm font-medium text-gray-800">Fields:</p> | |
| <ul class="text-xs text-gray-600 mt-1 space-y-1"> | |
| <li>cost_id (PK): string</li> | |
| <li>control_id (FK): string</li> | |
| <li>amount: decimal</li> | |
| <li>currency: string</li> | |
| <li>category: string</li> | |
| <li>incurred_date: date</li> | |
| <li>justification: string</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="entity-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg"> | |
| <div class="bg-red-600 p-4"> | |
| <h3 class="text-white text-lg font-semibold">Risk</h3> | |
| </div> | |
| <div class="p-4"> | |
| <p class="text-gray-700 mb-4">Potential threats or vulnerabilities that controls aim to mitigate.</p> | |
| <div class="bg-gray-100 p-3 rounded"> | |
| <p class="text-sm font-medium text-gray-800">Fields:</p> | |
| <ul class="text-xs text-gray-600 mt-1 space-y-1"> | |
| <li>risk_id (PK): string</li> | |
| <li>control_id (FK): string</li> | |
| <li>description: string</li> | |
| <li>impact: string</li> | |
| <li>likelihood: string</li> | |
| <li>mitigation_strategy: string</li> | |
| <li>identified_date: date</li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Relationship Summary</h2> | |
| </div> | |
| <div class="p-6"> | |
| <div class="space-y-4"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 h-10 w-10 rounded-full bg-indigo-100 flex items-center justify-center"> | |
| <span class="text-indigo-600 font-bold">1</span> | |
| </div> | |
| <div class="ml-4"> | |
| <h3 class="text-lg font-medium text-gray-900">Asset to Control</h3> | |
| <p class="text-gray-600 mt-1">One-to-many relationship where each asset can have multiple controls applied to it (e.g., a server might have access controls, patch management, and monitoring controls).</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-100 flex items-center justify-center"> | |
| <span class="text-green-600 font-bold">2</span> | |
| </div> | |
| <div class="ml-4"> | |
| <h3 class="text-lg font-medium text-gray-900">Control to Evidence</h3> | |
| <p class="text-gray-600 mt-1">One-to-many relationship where each control requires multiple pieces of evidence to demonstrate its proper implementation (e.g., firewall rules, access logs).</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 h-10 w-10 rounded-full bg-purple-100 flex items-center justify-center"> | |
| <span class="text-purple-600 font-bold">3</span> | |
| </div> | |
| <div class="ml-4"> | |
| <h3 class="text-lg font-medium text-gray-900">Control to CostItem</h3> | |
| <p class="text-gray-600 mt-1">One-to-many relationship tracking the financial investment in each control (e.g., license costs, implementation hours, maintenance expenses).</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 h-10 w-10 rounded-full bg-red-100 flex items-center justify-center"> | |
| <span class="text-red-600 font-bold">4</span> | |
| </div> | |
| <div class="ml-4"> | |
| <h3 class="text-lg font-medium text-gray-900">Control to Risk</h3> | |
| <p class="text-gray-600 mt-1">One-to-many relationship showing which risks each control mitigates, allowing for risk-based prioritization of control implementation.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mt-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Automated Workflow</h2> | |
| <p class="text-gray-600 mt-2">Containerized data pipeline execution flow</p> | |
| </div> | |
| <div class="p-6"> | |
| <div class="prose max-w-none"> | |
| <ol class="list-decimal pl-5 space-y-3"> | |
| <li><strong>Container Initialization</strong>: Docker container starts with temporary read-only credentials passed as environment variables</li> | |
| <li><strong>Credential Validation</strong>: Verify all supplied credentials can establish basic API connections</li> | |
| <li><strong>Parallel API Harvesting</strong>: Simultaneously collect data from all connected systems using their respective APIs</li> | |
| <li><strong>JSON Normalization</strong>: Transform all collected data into standardized JSON format matching our data model</li> | |
| <li><strong>Database Population</strong>: Upsert normalized data into Postgres tables (Asset, Control, Evidence, CostItem, Risk)</li> | |
| <li><strong>Evidence Manifest Generation</strong>: Create CSV mapping each JSON evidence file to its associated Control record</li> | |
| <li><strong>Log Finalization</strong>: Write execution summary and any errors to timestamped log file</li> | |
| </ol> | |
| </div> | |
| <div class="mt-8 mermaid"> | |
| sequenceDiagram | |
| participant Docker as Docker Container | |
| participant Cloud as Cloud/SaaS APIs | |
| participant Postgres as Postgres DB | |
| Docker->>Docker: Initialize with ENV credentials | |
| Docker->>Cloud: Validate credentials | |
| par Parallel Execution | |
| Docker->>Cloud: Harvest API Data (Asset) | |
| Docker->>Cloud: Harvest API Data (Control) | |
| Docker->>Cloud: Harvest API Data (Evidence) | |
| end | |
| Docker->>Docker: Normalize JSON data | |
| Docker->>Postgres: Upsert Asset records | |
| Docker->>Postgres: Upsert Control records | |
| Docker->>Postgres: Upsert related entities | |
| Docker->>Docker: Generate evidence manifest (CSV) | |
| Docker->>Docker: Write execution logs | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mt-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Compliance Data Serializers</h2> | |
| <p class="text-gray-600 mt-2">Transformations for standards and tool integrations</p> | |
| </div> | |
| <div class="p-6"> | |
| <div class="prose max-w-none"> | |
| <h3 class="text-lg font-medium text-gray-900">OSCAL SSP JSON</h3> | |
| <p>Mappings from core tables to NIST SP 800-53 controls:</p> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>{ | |
| "mappings": { | |
| "Control": { | |
| "control_id β implemented-requirements/uuid", | |
| "name β implemented-requirements/description", | |
| "standard β implemented-requirements/control-id" | |
| }, | |
| "Evidence": { | |
| "file_path β implemented-requirements/links/href", | |
| "collection_date β implemented-requirements/props/value" | |
| } | |
| }, | |
| "required_namespaces": [ | |
| "http://csrc.nist.gov/ns/oscal/1.0", | |
| "http://csrc.nist.gov/ns/oscal/metaschema/1.0" | |
| ], | |
| "example": { | |
| "system-security-plan": { | |
| "uuid": "a0e48328-...", | |
| "implemented-requirements": [{ | |
| "uuid": "CTL-2024-001", | |
| "control-id": "AC-2", | |
| "description": "Server Access Control" | |
| }] | |
| } | |
| } | |
| }</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">OpenControl YAML</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>mappings: | |
| Control: | |
| control_id: id | |
| name: name | |
| description: narrative | |
| Evidence: | |
| file_path: documentation | |
| collected_by: referenced_by | |
| collection_date: date | |
| namespaces: | |
| - opencontrol/schemas/1.0.0 | |
| example: | | |
| standards: | |
| - name: NIST-800-53 | |
| controls: | |
| - id: CTL-2024-001 | |
| name: Patch Management | |
| narrative: "Ensures timely..."</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">CSV Bundles</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>Vanta/Drata CSV Mappings: | |
| Asset: | |
| asset_id β Device ID | |
| name β Asset Name | |
| is_critical β Critical (true/false) | |
| Control: | |
| control_id β Control ID | |
| implementation_status β Status | |
| last_review_date β Last Tested | |
| Example: | |
| Device ID,Asset Name,Critical | |
| ASSET-001,Web Server,true</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">XBRL Cost Data</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>Mappings: | |
| CostItem: | |
| amount β xbrli:monetaryItemType | |
| currency β iso4217:currency | |
| category β audit:costCategory | |
| Namespaces: | |
| - http://www.xbrl.org/2003/instance | |
| - http://www.xbrl.org/dtr/type/numeric | |
| Example: | |
| <xbrl> | |
| <cost:cybersecurityCost | |
| contextRef="current" | |
| unitRef="USD" | |
| decimals="2">45000</cost:cybersecurityCost> | |
| </xbrl></code></pre> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mt-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Evidence Storage Automation</h2> | |
| <p class="text-gray-600 mt-2">Secure S3 bucket configuration with presigned URLs for auditor access</p> | |
| </div> | |
| <div class="p-6"> | |
| <div class="prose max-w-none"> | |
| <h3 class="text-lg font-medium text-gray-900">Terraform S3 Configuration</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>resource "aws_s3_bucket" "evidence_store" { | |
| bucket = "audit-evidence-${var.account_id}" | |
| object_lock_configuration { | |
| object_lock_enabled = "Enabled" | |
| } | |
| lifecycle_rule { | |
| id = "auto-expire" | |
| enabled = true | |
| expiration { | |
| days = 90 | |
| } | |
| } | |
| } | |
| resource "aws_s3_bucket_policy" "read_only" { | |
| bucket = aws_s3_bucket.evidence_store.id | |
| policy = jsonencode({ | |
| Version = "2012-10-17" | |
| Statement = [{ | |
| Effect = "Allow" | |
| Principal = {"AWS": "arn:aws:iam::${var.auditor_account_id}:root"} | |
| Action = ["s3:GetObject"] | |
| Resource = "${aws_s3_bucket.evidence_store.arn}/*" | |
| }] | |
| }) | |
| }</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">Python Upload Script</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>import boto3 | |
| from datetime import datetime, timedelta | |
| def upload_evidence(file_path, control_id): | |
| s3 = boto3.client('s3') | |
| bucket = 'audit-evidence-123456789012' | |
| key = f"{control_id}/{datetime.now().isoformat()}_{file_path.split('/')[-1]}" | |
| # Upload file with object lock retention | |
| s3.upload_file(file_path, bucket, key, ExtraArgs={ | |
| 'ObjectLockMode': 'GOVERNANCE', | |
| 'ObjectLockRetainUntilDate': datetime.now() + timedelta(days=90) | |
| }) | |
| # Generate presigned URL | |
| url = s3.generate_presigned_url( | |
| 'get_object', | |
| Params={'Bucket': bucket, 'Key': key}, | |
| ExpiresIn=432000 # 5 days in seconds | |
| ) | |
| return url</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">Auditor Access Process</h3> | |
| <p>Auditors receive time-limited presigned URLs that:</p> | |
| <ol class="list-decimal pl-5 space-y-2"> | |
| <li>Provide read-only access to specific evidence files</li> | |
| <li>Automatically expire after 5 days to limit exposure</li> | |
| <li>Don't require AWS credentials (works through URL signature)</li> | |
| <li>Track which evidence was accessed via CloudTrail logs</li> | |
| </ol> | |
| <p class="mt-4 font-medium">Workflow:</p> | |
| <ol class="list-decimal pl-5 space-y-2"> | |
| <li>System generates URL during evidence collection</li> | |
| <li>URL gets embedded in compliance reports</li> | |
| <li>Auditor clicks link to verify evidence directly</li> | |
| <li>Access automatically revoked after expiration</li> | |
| </ol> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mt-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Serverless Data Collection Scheduler</h2> | |
| <p class="text-gray-600 mt-2">Automated 90-day refresh cycle with observability</p> | |
| </div> | |
| <div class="p-6"> | |
| <div class="prose max-w-none"> | |
| <h3 class="text-lg font-medium text-gray-900">Terraform Configuration</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>resource "aws_cloudwatch_event_rule" "quarterly_audit" { | |
| name = "quarterly-audit-data-collection" | |
| description = "Triggers audit data collection every 90 days" | |
| schedule_expression = "rate(90 days)" | |
| } | |
| resource "aws_iam_role" "lambda_exec" { | |
| name = "audit-data-collector-lambda" | |
| assume_role_policy = jsonencode({ | |
| Version = "2012-10-17" | |
| Statement = [{ | |
| Action = "sts:AssumeRole" | |
| Effect = "Allow" | |
| Principal = { | |
| Service = "lambda.amazonaws.com" | |
| } | |
| }] | |
| }) | |
| } | |
| resource "aws_iam_role_policy" "lambda_policy" { | |
| name = "least-privilege-audit-collector" | |
| role = aws_iam_role.lambda_exec.id | |
| policy = jsonencode({ | |
| Version = "2012-10-17" | |
| Statement = [ | |
| { | |
| Effect = "Allow" | |
| Action = [ | |
| "logs:CreateLogGroup", | |
| "logs:CreateLogStream", | |
| "logs:PutLogEvents" | |
| ] | |
| Resource = "arn:aws:logs:*:*:*" | |
| }, | |
| { | |
| Effect = "Allow" | |
| Action = [ | |
| "cloudwatch:PutMetricData" | |
| ] | |
| Resource = "*" | |
| } | |
| ] | |
| }) | |
| } | |
| resource "aws_lambda_function" "data_collector" { | |
| filename = "data-collector.zip" | |
| function_name = "audit-data-collector" | |
| role = aws_iam_role.lambda_exec.arn | |
| handler = "lambda_function.lambda_handler" | |
| runtime = "python3.9" | |
| timeout = 900 # 15 minutes | |
| environment { | |
| variables = { | |
| DB_HOST = var.database_host | |
| DB_PASSWORD = var.database_password | |
| OPENAI_KEY = var.openai_key | |
| } | |
| } | |
| } | |
| resource "aws_cloudwatch_event_target" "trigger_lambda" { | |
| rule = aws_cloudwatch_event_rule.quarterly_audit.name | |
| target_id = "TriggerLambda" | |
| arn = aws_lambda_function.data_collector.arn | |
| } | |
| resource "aws_lambda_permission" "allow_cloudwatch" { | |
| statement_id = "AllowExecutionFromCloudWatch" | |
| action = "lambda:InvokeFunction" | |
| function_name = aws_lambda_function.data_collector.function_name | |
| principal = "events.amazonaws.com" | |
| source_arn = aws_cloudwatch_event_rule.quarterly_audit.arn | |
| }</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">Python Lambda Function</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>import os | |
| import boto3 | |
| from datetime import datetime | |
| import psycopg2 | |
| import openai | |
| cloudwatch = boto3.client('cloudwatch') | |
| def lambda_handler(event, context): | |
| # Connect to database using env vars | |
| conn = psycopg2.connect( | |
| host=os.environ['DB_HOST'], | |
| database="audit", | |
| user="collector", | |
| password=os.environ['DB_PASSWORD'] | |
| ) | |
| try: | |
| start_time = datetime.now() | |
| # 1. Collect data from APIs | |
| collect_assets() | |
| collect_controls() | |
| # 2. Process with OpenAI for risk analysis | |
| analyze_risks() | |
| # 3. Publish metrics | |
| publish_metrics( | |
| duration=(datetime.now() - start_time).total_seconds(), | |
| assets_collected=100, # example value | |
| controls_processed=50 # example value | |
| ) | |
| return {"status": "success"} | |
| except Exception as e: | |
| publish_error_metric() | |
| raise e | |
| def publish_metrics(duration, assets_collected, controls_processed): | |
| cloudwatch.put_metric_data( | |
| Namespace='AuditDataCollection', | |
| MetricData=[ | |
| { | |
| 'MetricName': 'ExecutionTime', | |
| 'Value': duration, | |
| 'Unit': 'Seconds' | |
| }, | |
| { | |
| 'MetricName': 'AssetsCollected', | |
| 'Value': assets_collected, | |
| 'Unit': 'Count' | |
| }, | |
| { | |
| 'MetricName': 'ControlsProcessed', | |
| 'Value': controls_processed, | |
| 'Unit': 'Count' | |
| } | |
| ] | |
| ) | |
| def publish_error_metric(): | |
| cloudwatch.put_metric_data( | |
| Namespace='AuditDataCollection', | |
| MetricData=[{ | |
| 'MetricName': 'CollectionErrors', | |
| 'Value': 1, | |
| 'Unit': 'Count' | |
| }] | |
| )</code></pre> | |
| <h3 class="mt-6 text-lg font-medium text-gray-900">Key CloudWatch Metrics</h3> | |
| <ol class="list-decimal pl-5 space-y-2"> | |
| <li><strong>ExecutionTime</strong>: Duration of data collection in seconds</li> | |
| <li><strong>AssetsCollected</strong>: Count of IT assets inventoried</li> | |
| <li><strong>ControlsProcessed</strong>: Number of security controls evaluated</li> | |
| <li><strong>CollectionErrors</strong>: Count of failed executions (alarm when >0)</li> | |
| <li><strong>APICallLatency</strong>: Response times from external APIs</li> | |
| <li><strong>RecordsProcessed</strong>: Total database records created/updated</li> | |
| </ol> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden mt-12"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h2 class="text-2xl font-semibold text-gray-800">Control Failure Narrative Generator</h2> | |
| <p class="text-gray-600 mt-2">Template for converting failed controls into actionable insights</p> | |
| </div> | |
| <div class="p-6"> | |
| <div class="prose max-w-none mb-6"> | |
| <h3 class="text-lg font-medium text-gray-900">Prompt Template:</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>Transform this failed control data into a concise risk narrative in JSON format: | |
| 1. Business Risk Summary: One sentence describing the business impact | |
| 2. Control Reference: Include the control_id | |
| 3. Actionable Fix: One practical recommendation (β€40 words) | |
| 4. Format: Strict JSON with keys summary, control_id, recommendation | |
| Example Input: | |
| { | |
| "control_name": "Server Patch Management", | |
| "control_id": "CTL-2024-001", | |
| "failure_details": "30% of servers missing critical security patches" | |
| } | |
| Required Output Format: | |
| { | |
| "summary": "[business risk statement]", | |
| "control_id": "[control identifier]", | |
| "recommendation": "[concrete action item]" | |
| }</code></pre> | |
| </div> | |
| <div class="prose max-w-none"> | |
| <h3 class="text-lg font-medium text-gray-900">Example Output:</h3> | |
| <pre class="bg-gray-100 p-4 rounded-md"><code>{ | |
| "summary": "Unpatched servers create vulnerabilities for ransomware attacks and data breaches", | |
| "control_id": "CTL-2024-001", | |
| "recommendation": "Deploy automated patching system with 72-hour SLA for critical updates" | |
| }</code></pre> | |
| </div> | |
| </div> | |
| </div> | |
| <footer class="mt-12 text-center text-gray-500 text-sm"> | |
| <p>Rapid IT Health Audit - Data Pipeline Model v1.0</p> | |
| <p class="mt-1">Β© 2023 SaaS Audit Solutions. All rights reserved.</p> | |
| </footer> | |
| </div> | |
| <script> | |
| mermaid.initialize({ | |
| startOnLoad: true, | |
| theme: 'default', | |
| flowchart: { | |
| useMaxWidth: true, | |
| htmlLabels: true, | |
| curve: 'basis' | |
| }, | |
| er: { | |
| diagramPadding: 20, | |
| layoutDirection: 'TB', | |
| useMaxWidth: true | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 𧬠<a href="https://enzostvs-deepsite.hf.space?remix=clearpathit/clear-path-it" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |