From afcdc0749ac848724dbb0c44dd240892d83050e2 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 13 Jan 2026 13:35:30 +0545 Subject: [PATCH 1/2] feat: SKILL to create config scraper --- skills/create-config-scraper/SKILL.md | 52 ++ .../references/schemas/config_aws.schema.json | 553 +++++++++++++ .../schemas/config_azure.schema.json | 610 ++++++++++++++ .../schemas/config_azuredevops.schema.json | 500 +++++++++++ .../schemas/config_exec.schema.json | 776 ++++++++++++++++++ .../schemas/config_file.schema.json | 418 ++++++++++ .../references/schemas/config_gcp.schema.json | 541 ++++++++++++ .../schemas/config_githubactions.schema.json | 503 ++++++++++++ .../schemas/config_http.schema.json | 571 +++++++++++++ .../schemas/config_kubernetes.schema.json | 749 +++++++++++++++++ .../schemas/config_kubernetesfile.schema.json | 632 ++++++++++++++ .../schemas/config_logs.schema.json | 668 +++++++++++++++ .../schemas/config_slack.schema.json | 638 ++++++++++++++ .../references/schemas/config_sql.schema.json | 507 ++++++++++++ .../schemas/config_terraform.schema.json | 560 +++++++++++++ .../schemas/config_trivy.schema.json | 463 +++++++++++ 16 files changed, 8741 insertions(+) create mode 100644 skills/create-config-scraper/SKILL.md create mode 100644 skills/create-config-scraper/references/schemas/config_aws.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_azure.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_azuredevops.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_exec.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_file.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_gcp.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_githubactions.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_http.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_kubernetes.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_kubernetesfile.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_logs.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_slack.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_sql.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_terraform.schema.json create mode 100644 skills/create-config-scraper/references/schemas/config_trivy.schema.json diff --git a/skills/create-config-scraper/SKILL.md b/skills/create-config-scraper/SKILL.md new file mode 100644 index 0000000..e93f3d3 --- /dev/null +++ b/skills/create-config-scraper/SKILL.md @@ -0,0 +1,52 @@ +--- +name: config-scraper-yaml +description: Generate Mission Control ScrapeConfig YAML from natural language. Use when users ask to build a scraper, create a config scraper, or want YAML to scrape Kubernetes/AWS/GCP/Azure/SQL/HTTP/File/Exec/Logs/Slack/GitHub Actions/Trivy/Terraform sources. +--- + +# Config Scraper YAML Skill + +## Goal + +Turn a user request into a valid ScrapeConfig YAML that can be applied in Mission Control. + +## How to Use + +1. Identify the scraper type(s) the user needs (kubernetes, exec, http, file, sql, logs, aws, gcp, azure, githubActions, slack, trivy, terraform). +2. Ask only the minimum clarifying questions required to produce correct YAML (cluster/region, credentials source, namespace, schedule, filters, and output mapping). +3. Produce a single ScrapeConfig YAML in a fenced code block. Keep it minimal and runnable. +4. If the user mentions secrets, always use secret references (do not inline sensitive values). +5. If a request cannot be expressed in a scraper type, explain the limitation and provide the closest working YAML (often via exec). + +## Inputs Checklist + +- Target system and scraper type +- Credentials source (secret name + key, or connection name) +- Schedule (optional; omit if not specified) + +## Output Rules + +- Output YAML only, in a single code block. +- Use `apiVersion: configs.flanksource.com/v1` and `kind: ScrapeConfig`. +- Set `metadata.name` to a short, unique slug. + +## Reference + +# Scraper Schema Map (Bundled) + +Use the bundled per-scraper schemas below. Only open the schema for the requested scraper type(s). + +- Kubernetes: `@skills/create-config-scraper/references/schemas/config_kubernetes.schema.json` +- Kubernetes file: `@skills/create-config-scraper/references/schemas/config_kubernetesfile.schema.json` +- Exec: `@skills/create-config-scraper/references/schemas/config_exec.schema.json` +- HTTP: `@skills/create-config-scraper/references/schemas/config_http.schema.json` +- File: `@skills/create-config-scraper/references/schemas/config_file.schema.json` +- SQL: `@skills/create-config-scraper/references/schemas/config_sql.schema.json` +- Logs: `@skills/create-config-scraper/references/schemas/config_logs.schema.json` +- AWS: `@skills/create-config-scraper/references/schemas/config_aws.schema.json` +- GCP: `@skills/create-config-scraper/references/schemas/config_gcp.schema.json` +- Azure: `@skills/create-config-scraper/references/schemas/config_azure.schema.json` +- Azure DevOps: `@skills/create-config-scraper/references/schemas/config_azuredevops.schema.json` +- GitHub Actions: `@skills/create-config-scraper/references/schemas/config_githubactions.schema.json` +- Slack: `@skills/create-config-scraper/references/schemas/config_slack.schema.json` +- Trivy: `@skills/create-config-scraper/references/schemas/config_trivy.schema.json` +- Terraform: `@skills/create-config-scraper/references/schemas/config_terraform.schema.json` diff --git a/skills/create-config-scraper/references/schemas/config_aws.schema.json b/skills/create-config-scraper/references/schemas/config_aws.schema.json new file mode 100644 index 0000000..4281907 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_aws.schema.json @@ -0,0 +1,553 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/aws", + "$ref": "#/$defs/AWS", + "$defs": { + "AWS": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "region": { + "items": { + "type": "string" + }, + "type": "array" + }, + "compliance": { + "type": "boolean" + }, + "cloudtrail": { + "$ref": "#/$defs/CloudTrail" + }, + "include": { + "items": { + "type": "string" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + }, + "costReporting": { + "$ref": "#/$defs/CostReporting" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CloudTrail": { + "properties": { + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + }, + "maxAge": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CostReporting": { + "properties": { + "s3BucketPath": { + "type": "string" + }, + "table": { + "type": "string" + }, + "database": { + "type": "string" + }, + "region": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_azure.schema.json b/skills/create-config-scraper/references/schemas/config_azure.schema.json new file mode 100644 index 0000000..09f989c --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_azure.schema.json @@ -0,0 +1,610 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/azure", + "$ref": "#/$defs/Azure", + "$defs": { + "Azure": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "subscriptionID": { + "type": "string" + }, + "clientID": { + "$ref": "#/$defs/EnvVar" + }, + "clientSecret": { + "$ref": "#/$defs/EnvVar" + }, + "tenantID": { + "type": "string" + }, + "include": { + "items": { + "type": "string" + }, + "type": "array" + }, + "exclusions": { + "$ref": "#/$defs/AzureExclusions" + }, + "entra": { + "$ref": "#/$defs/Entra" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "subscriptionID" + ] + }, + "AzureExclusions": { + "properties": { + "activityLogs": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Entra": { + "properties": { + "users": { + "items": { + "$ref": "#/$defs/ResourceSelector" + }, + "type": "array" + }, + "groups": { + "items": { + "$ref": "#/$defs/ResourceSelector" + }, + "type": "array" + }, + "appRegistrations": { + "items": { + "$ref": "#/$defs/ResourceSelector" + }, + "type": "array" + }, + "enterpriseApps": { + "items": { + "$ref": "#/$defs/ResourceSelector" + }, + "type": "array" + }, + "appRoleAssignments": { + "items": { + "$ref": "#/$defs/ResourceSelector" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Items": { + "items": { + "type": "string" + }, + "type": "array" + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ResourceSelector": { + "properties": { + "agent": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "cache": { + "type": "string" + }, + "search": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "includeDeleted": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "tagSelector": { + "type": "string" + }, + "labelSelector": { + "type": "string" + }, + "fieldSelector": { + "type": "string" + }, + "health": { + "type": "string" + }, + "types": { + "$ref": "#/$defs/Items" + }, + "statuses": { + "$ref": "#/$defs/Items" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_azuredevops.schema.json b/skills/create-config-scraper/references/schemas/config_azuredevops.schema.json new file mode 100644 index 0000000..e1c3560 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_azuredevops.schema.json @@ -0,0 +1,500 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/azure-devops", + "$ref": "#/$defs/AzureDevops", + "$defs": { + "AzureDevops": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "personalAccessToken": { + "$ref": "#/$defs/EnvVar" + }, + "projects": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pipelines": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "projects", + "pipelines" + ] + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_exec.schema.json b/skills/create-config-scraper/references/schemas/config_exec.schema.json new file mode 100644 index 0000000..b3d0048 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_exec.schema.json @@ -0,0 +1,776 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/exec", + "$ref": "#/$defs/Exec", + "$defs": { + "AWSConnection": { + "properties": { + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "sessionToken": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "region": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Artifact": { + "properties": { + "path": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "path" + ] + }, + "AzureConnection": { + "properties": { + "connection": { + "type": "string" + }, + "clientID": { + "$ref": "#/$defs/EnvVar" + }, + "clientSecret": { + "$ref": "#/$defs/EnvVar" + }, + "tenantID": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CNRMConnection": { + "properties": { + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "clusterResource": { + "type": "string" + }, + "clusterResourceNamespace": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "gke", + "clusterResource", + "clusterResourceNamespace" + ] + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EKSConnection": { + "properties": { + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "sessionToken": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "region": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "cluster" + ] + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Exec": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "script": { + "type": "string" + }, + "connections": { + "$ref": "#/$defs/ExecConnections" + }, + "checkout": { + "$ref": "#/$defs/GitConnection" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "artifacts": { + "items": { + "$ref": "#/$defs/Artifact" + }, + "type": "array" + }, + "setup": { + "$ref": "#/$defs/ExecSetup" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "script" + ] + }, + "ExecConnections": { + "properties": { + "fromConfigItem": { + "type": "string" + }, + "eksPodIdentity": { + "type": "boolean" + }, + "serviceAccount": { + "type": "boolean" + }, + "kubernetes": { + "$ref": "#/$defs/KubernetesConnection" + }, + "aws": { + "$ref": "#/$defs/AWSConnection" + }, + "gcp": { + "$ref": "#/$defs/GCPConnection" + }, + "azure": { + "$ref": "#/$defs/AzureConnection" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ExecSetup": { + "properties": { + "bun": { + "$ref": "#/$defs/RuntimeSetup" + }, + "python": { + "$ref": "#/$defs/RuntimeSetup" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GCPConnection": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GKEConnection": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "projectID": { + "type": "string" + }, + "zone": { + "type": "string" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "projectID", + "zone", + "cluster" + ] + }, + "GitConnection": { + "properties": { + "url": { + "type": "string" + }, + "connection": { + "type": "string" + }, + "username": { + "$ref": "#/$defs/EnvVar" + }, + "password": { + "$ref": "#/$defs/EnvVar" + }, + "certificate": { + "$ref": "#/$defs/EnvVar" + }, + "type": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "depth": { + "type": "integer" + }, + "destination": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "KubernetesConnection": { + "properties": { + "connection": { + "type": "string" + }, + "kubeconfig": { + "$ref": "#/$defs/EnvVar" + }, + "eks": { + "$ref": "#/$defs/EKSConnection" + }, + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "cnrm": { + "$ref": "#/$defs/CNRMConnection" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "RuntimeSetup": { + "properties": { + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_file.schema.json b/skills/create-config-scraper/references/schemas/config_file.schema.json new file mode 100644 index 0000000..e4e209c --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_file.schema.json @@ -0,0 +1,418 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/file", + "$ref": "#/$defs/File", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "File": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "url": { + "type": "string" + }, + "paths": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ignore": { + "items": { + "type": "string" + }, + "type": "array" + }, + "icon": { + "type": "string" + }, + "connection": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_gcp.schema.json b/skills/create-config-scraper/references/schemas/config_gcp.schema.json new file mode 100644 index 0000000..b241569 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_gcp.schema.json @@ -0,0 +1,541 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/gcp", + "$ref": "#/$defs/GCP", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GCP": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "include": { + "items": { + "type": "string" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + }, + "auditLogs": { + "$ref": "#/$defs/GCPAuditLogs" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "project" + ] + }, + "GCPAuditLogs": { + "properties": { + "dataset": { + "type": "string" + }, + "since": { + "type": "string" + }, + "userAgents": { + "$ref": "#/$defs/MatchExpressions" + }, + "principalEmails": { + "$ref": "#/$defs/MatchExpressions" + }, + "permissions": { + "$ref": "#/$defs/MatchExpressions" + }, + "serviceNames": { + "$ref": "#/$defs/MatchExpressions" + }, + "methods": { + "$ref": "#/$defs/MatchExpressions" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "MatchExpressions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_githubactions.schema.json b/skills/create-config-scraper/references/schemas/config_githubactions.schema.json new file mode 100644 index 0000000..ba83a01 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_githubactions.schema.json @@ -0,0 +1,503 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/git-hub-actions", + "$ref": "#/$defs/GitHubActions", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GitHubActions": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "owner": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "personalAccessToken": { + "$ref": "#/$defs/EnvVar" + }, + "workflows": { + "items": { + "type": "string" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "actor": { + "type": "string" + }, + "branch": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "owner", + "repository" + ] + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_http.schema.json b/skills/create-config-scraper/references/schemas/config_http.schema.json new file mode 100644 index 0000000..eda8d40 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_http.schema.json @@ -0,0 +1,571 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/http", + "$ref": "#/$defs/HTTP", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HTTP": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "username": { + "$ref": "#/$defs/EnvVar" + }, + "password": { + "$ref": "#/$defs/EnvVar" + }, + "ntlm": { + "type": "boolean" + }, + "ntlmv2": { + "type": "boolean" + }, + "digest": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "bearer": { + "$ref": "#/$defs/EnvVar" + }, + "oauth": { + "$ref": "#/$defs/OAuth" + }, + "tls": { + "$ref": "#/$defs/TLSConfig" + }, + "env": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" + }, + "method": { + "type": "string" + }, + "body": { + "type": "string" + }, + "headers": { + "additionalProperties": { + "$ref": "#/$defs/EnvVar" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "OAuth": { + "properties": { + "clientID": { + "$ref": "#/$defs/EnvVar" + }, + "clientSecret": { + "$ref": "#/$defs/EnvVar" + }, + "scope": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tokenURL": { + "type": "string" + }, + "params": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "TLSConfig": { + "properties": { + "insecureSkipVerify": { + "type": "boolean" + }, + "handshakeTimeout": { + "type": "integer" + }, + "ca": { + "$ref": "#/$defs/EnvVar" + }, + "cert": { + "$ref": "#/$defs/EnvVar" + }, + "key": { + "$ref": "#/$defs/EnvVar" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_kubernetes.schema.json b/skills/create-config-scraper/references/schemas/config_kubernetes.schema.json new file mode 100644 index 0000000..a047930 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_kubernetes.schema.json @@ -0,0 +1,749 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/kubernetes", + "$ref": "#/$defs/Kubernetes", + "$defs": { + "CNRMConnection": { + "properties": { + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "clusterResource": { + "type": "string" + }, + "clusterResourceNamespace": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "gke", + "clusterResource", + "clusterResourceNamespace" + ] + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EKSConnection": { + "properties": { + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "sessionToken": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "region": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "cluster" + ] + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GKEConnection": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "projectID": { + "type": "string" + }, + "zone": { + "type": "string" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "projectID", + "zone", + "cluster" + ] + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Kubernetes": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "kubeconfig": { + "$ref": "#/$defs/EnvVar" + }, + "eks": { + "$ref": "#/$defs/EKSConnection" + }, + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "cnrm": { + "$ref": "#/$defs/CNRMConnection" + }, + "clusterName": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "useCache": { + "type": "boolean" + }, + "allowIncomplete": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "since": { + "type": "string" + }, + "selector": { + "type": "string" + }, + "fieldSelector": { + "type": "string" + }, + "maxInflight": { + "type": "integer" + }, + "watch": { + "items": { + "$ref": "#/$defs/KubernetesResourceToWatch" + }, + "type": "array" + }, + "event": { + "$ref": "#/$defs/KubernetesEventConfig" + }, + "exclusions": { + "$ref": "#/$defs/KubernetesExclusionConfig" + }, + "relationships": { + "items": { + "$ref": "#/$defs/KubernetesRelationshipSelectorTemplate" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "clusterName" + ] + }, + "KubernetesEventConfig": { + "properties": { + "exclusions": { + "$ref": "#/$defs/KubernetesEventExclusions" + }, + "severityKeywords": { + "$ref": "#/$defs/SeverityKeywords" + } + }, + "additionalProperties": false, + "type": "object" + }, + "KubernetesEventExclusions": { + "properties": { + "name": { + "items": { + "type": "string" + }, + "type": "array" + }, + "namespace": { + "items": { + "type": "string" + }, + "type": "array" + }, + "reason": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "KubernetesExclusionConfig": { + "properties": { + "name": { + "items": { + "type": "string" + }, + "type": "array" + }, + "kind": { + "items": { + "type": "string" + }, + "type": "array" + }, + "namespace": { + "items": { + "type": "string" + }, + "type": "array" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "KubernetesRelationshipSelectorTemplate": { + "properties": { + "kind": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "kind", + "name", + "namespace" + ] + }, + "KubernetesResourceToWatch": { + "properties": { + "apiVersion": { + "type": "string" + }, + "kind": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "apiVersion", + "kind" + ] + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "SeverityKeywords": { + "properties": { + "warn": { + "items": { + "type": "string" + }, + "type": "array" + }, + "error": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_kubernetesfile.schema.json b/skills/create-config-scraper/references/schemas/config_kubernetesfile.schema.json new file mode 100644 index 0000000..74f8608 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_kubernetesfile.schema.json @@ -0,0 +1,632 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/kubernetes-file", + "$ref": "#/$defs/KubernetesFile", + "$defs": { + "CNRMConnection": { + "properties": { + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "clusterResource": { + "type": "string" + }, + "clusterResourceNamespace": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "gke", + "clusterResource", + "clusterResourceNamespace" + ] + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EKSConnection": { + "properties": { + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "sessionToken": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "region": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "cluster" + ] + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GKEConnection": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "projectID": { + "type": "string" + }, + "zone": { + "type": "string" + }, + "cluster": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "projectID", + "zone", + "cluster" + ] + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "KubernetesFile": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "kubeconfig": { + "$ref": "#/$defs/EnvVar" + }, + "eks": { + "$ref": "#/$defs/EKSConnection" + }, + "gke": { + "$ref": "#/$defs/GKEConnection" + }, + "cnrm": { + "$ref": "#/$defs/CNRMConnection" + }, + "selector": { + "$ref": "#/$defs/ResourceSelector" + }, + "container": { + "type": "string" + }, + "files": { + "items": { + "$ref": "#/$defs/PodFile" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "selector" + ] + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "PodFile": { + "properties": { + "path": { + "items": { + "type": "string" + }, + "type": "array" + }, + "format": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ResourceSelector": { + "properties": { + "namespace": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "labelSelector": { + "type": "string" + }, + "fieldSelector": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_logs.schema.json b/skills/create-config-scraper/references/schemas/config_logs.schema.json new file mode 100644 index 0000000..43ee80d --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_logs.schema.json @@ -0,0 +1,668 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/logs", + "$ref": "#/$defs/Logs", + "$defs": { + "BigQueryConfig": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "FieldMappingConfig": { + "properties": { + "id": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "items": { + "type": "string" + }, + "type": "array" + }, + "host": { + "items": { + "type": "string" + }, + "type": "array" + }, + "severity": { + "items": { + "type": "string" + }, + "type": "array" + }, + "source": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ignore": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GCPCloudLoggingConfig": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "start": { + "type": "string" + }, + "end": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Logs": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "loki": { + "$ref": "#/$defs/LokiConfig" + }, + "gcpCloudLogging": { + "$ref": "#/$defs/GCPCloudLoggingConfig" + }, + "openSearch": { + "$ref": "#/$defs/OpenSearchConfig" + }, + "bigQuery": { + "$ref": "#/$defs/BigQueryConfig" + }, + "fieldMapping": { + "$ref": "#/$defs/FieldMappingConfig" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LokiConfig": { + "properties": { + "connection": { + "type": "string" + }, + "url": { + "type": "string" + }, + "username": { + "$ref": "#/$defs/EnvVar" + }, + "password": { + "$ref": "#/$defs/EnvVar" + }, + "start": { + "type": "string" + }, + "end": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "query": { + "type": "string" + }, + "since": { + "type": "string" + }, + "step": { + "type": "string" + }, + "interval": { + "type": "string" + }, + "direction": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "OpenSearchConfig": { + "properties": { + "connection": { + "type": "string" + }, + "address": { + "type": "string" + }, + "username": { + "$ref": "#/$defs/EnvVar" + }, + "password": { + "$ref": "#/$defs/EnvVar" + }, + "index": { + "type": "string" + }, + "query": { + "type": "string" + }, + "limit": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "index", + "query" + ] + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_slack.schema.json b/skills/create-config-scraper/references/schemas/config_slack.schema.json new file mode 100644 index 0000000..eb4e94c --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_slack.schema.json @@ -0,0 +1,638 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/slack", + "$ref": "#/$defs/Slack", + "$defs": { + "ChangeExtractionMapping": { + "properties": { + "createdAt": { + "$ref": "#/$defs/ValueExpression" + }, + "severity": { + "$ref": "#/$defs/ValueExpression" + }, + "summary": { + "$ref": "#/$defs/ValueExpression" + }, + "type": { + "$ref": "#/$defs/ValueExpression" + }, + "details": { + "$ref": "#/$defs/ValueExpression" + }, + "timeFormat": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarResourceSelector": { + "properties": { + "agent": { + "$ref": "#/$defs/ValueExpression" + }, + "scope": { + "type": "string" + }, + "cache": { + "type": "string" + }, + "id": { + "$ref": "#/$defs/ValueExpression" + }, + "name": { + "$ref": "#/$defs/ValueExpression" + }, + "namespace": { + "$ref": "#/$defs/ValueExpression" + }, + "types": { + "items": { + "$ref": "#/$defs/ValueExpression" + }, + "type": "array" + }, + "statuses": { + "items": { + "$ref": "#/$defs/ValueExpression" + }, + "type": "array" + }, + "healths": { + "items": { + "$ref": "#/$defs/ValueExpression" + }, + "type": "array" + }, + "tagSelector": { + "$ref": "#/$defs/ValueExpression" + }, + "labelSelector": { + "$ref": "#/$defs/ValueExpression" + }, + "fieldSelector": { + "$ref": "#/$defs/ValueExpression" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "MatchExpressions": { + "items": { + "type": "string" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Slack": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "token": { + "$ref": "#/$defs/EnvVar" + }, + "since": { + "type": "string" + }, + "channels": { + "$ref": "#/$defs/MatchExpressions" + }, + "rules": { + "items": { + "$ref": "#/$defs/SlackChangeExtractionRule" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "token", + "rules" + ] + }, + "SlackChangeAcceptanceFilter": { + "properties": { + "bot": { + "type": "string" + }, + "user": { + "$ref": "#/$defs/SlackUserFilter" + }, + "expr": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SlackChangeExtractionRule": { + "properties": { + "regexp": { + "type": "string" + }, + "mapping": { + "$ref": "#/$defs/ChangeExtractionMapping" + }, + "config": { + "items": { + "$ref": "#/$defs/EnvVarResourceSelector" + }, + "type": "array" + }, + "filter": { + "$ref": "#/$defs/SlackChangeAcceptanceFilter" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "config" + ] + }, + "SlackUserFilter": { + "properties": { + "name": { + "type": "string" + }, + "displayName": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ValueExpression": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_sql.schema.json b/skills/create-config-scraper/references/schemas/config_sql.schema.json new file mode 100644 index 0000000..2a39d1a --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_sql.schema.json @@ -0,0 +1,507 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/sql", + "$ref": "#/$defs/SQL", + "$defs": { + "Authentication": { + "properties": { + "username": { + "$ref": "#/$defs/EnvVar" + }, + "password": { + "$ref": "#/$defs/EnvVar" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "username", + "password" + ] + }, + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SQL": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "connection": { + "type": "string" + }, + "auth": { + "$ref": "#/$defs/Authentication" + }, + "driver": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "connection", + "query" + ] + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_terraform.schema.json b/skills/create-config-scraper/references/schemas/config_terraform.schema.json new file mode 100644 index 0000000..ed066ba --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_terraform.schema.json @@ -0,0 +1,560 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/terraform", + "$ref": "#/$defs/Terraform", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigMapKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVar": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "valueFrom": { + "$ref": "#/$defs/EnvVarSource" + } + }, + "additionalProperties": false, + "type": "object" + }, + "EnvVarSource": { + "properties": { + "serviceAccount": { + "type": "string" + }, + "helmRef": { + "$ref": "#/$defs/HelmRefKeySelector" + }, + "configMapKeyRef": { + "$ref": "#/$defs/ConfigMapKeySelector" + }, + "secretKeyRef": { + "$ref": "#/$defs/SecretKeySelector" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GCSConnection": { + "properties": { + "connection": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "credentials": { + "$ref": "#/$defs/EnvVar" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "project": { + "type": "string" + }, + "bucket": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HelmRefKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "S3Connection": { + "properties": { + "connection": { + "type": "string" + }, + "accessKey": { + "$ref": "#/$defs/EnvVar" + }, + "secretKey": { + "$ref": "#/$defs/EnvVar" + }, + "sessionToken": { + "$ref": "#/$defs/EnvVar" + }, + "assumeRole": { + "type": "string" + }, + "region": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "skipTLSVerify": { + "type": "boolean" + }, + "bucket": { + "type": "string" + }, + "objectPath": { + "type": "string" + }, + "usePathStyle": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SecretKeySelector": { + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "key" + ] + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Terraform": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "state": { + "$ref": "#/$defs/TerraformStateSource" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name", + "state" + ] + }, + "TerraformStateSource": { + "properties": { + "s3": { + "$ref": "#/$defs/S3Connection" + }, + "gcs": { + "$ref": "#/$defs/GCSConnection" + }, + "local": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file diff --git a/skills/create-config-scraper/references/schemas/config_trivy.schema.json b/skills/create-config-scraper/references/schemas/config_trivy.schema.json new file mode 100644 index 0000000..958a494 --- /dev/null +++ b/skills/create-config-scraper/references/schemas/config_trivy.schema.json @@ -0,0 +1,463 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/flanksource/config-db/api/v1/trivy", + "$ref": "#/$defs/Trivy", + "$defs": { + "ChangeMapping": { + "properties": { + "filter": { + "type": "string" + }, + "severity": { + "type": "string" + }, + "type": { + "type": "string" + }, + "action": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ConfigFieldExclusion": { + "properties": { + "types": { + "items": { + "type": "string" + }, + "type": "array" + }, + "jsonpath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "jsonpath" + ] + }, + "ConfigProperties": { + "properties": { + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "color": { + "type": "string" + }, + "order": { + "type": "integer" + }, + "headline": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "text": { + "type": "string" + }, + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "lastTransition": { + "type": "string" + }, + "links": { + "items": { + "$ref": "#/$defs/Link" + }, + "type": "array" + }, + "filter": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "JSONStringMap": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "Link": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "text": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LocationOrAlias": { + "properties": { + "type": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "withParent": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "type" + ] + }, + "Lookup": { + "properties": { + "expr": { + "type": "string" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Mask": { + "properties": { + "selector": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MaskList": { + "items": { + "$ref": "#/$defs/Mask" + }, + "type": "array" + }, + "RelationshipConfig": { + "properties": { + "id": { + "$ref": "#/$defs/Lookup" + }, + "external_id": { + "$ref": "#/$defs/Lookup" + }, + "name": { + "$ref": "#/$defs/Lookup" + }, + "namespace": { + "$ref": "#/$defs/Lookup" + }, + "type": { + "$ref": "#/$defs/Lookup" + }, + "agent": { + "$ref": "#/$defs/Lookup" + }, + "scope": { + "$ref": "#/$defs/Lookup" + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "expr": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "parent": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Tag": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ] + }, + "Tags": { + "items": { + "$ref": "#/$defs/Tag" + }, + "type": "array" + }, + "Transform": { + "properties": { + "gotemplate": { + "type": "string" + }, + "jsonpath": { + "type": "string" + }, + "expr": { + "type": "string" + }, + "javascript": { + "type": "string" + }, + "exclude": { + "items": { + "$ref": "#/$defs/ConfigFieldExclusion" + }, + "type": "array" + }, + "mask": { + "$ref": "#/$defs/MaskList" + }, + "relationship": { + "items": { + "$ref": "#/$defs/RelationshipConfig" + }, + "type": "array" + }, + "changes": { + "$ref": "#/$defs/TransformChange" + }, + "locations": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + }, + "aliases": { + "items": { + "$ref": "#/$defs/LocationOrAlias" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TransformChange": { + "properties": { + "mapping": { + "items": { + "$ref": "#/$defs/ChangeMapping" + }, + "type": "array" + }, + "exclude": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Trivy": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "string" + }, + "type": { + "type": "string" + }, + "class": { + "type": "string" + }, + "format": { + "type": "string" + }, + "status": { + "type": "string" + }, + "health": { + "type": "string" + }, + "timestampFormat": { + "type": "string" + }, + "createFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deleteFields": { + "items": { + "type": "string" + }, + "type": "array" + }, + "transform": { + "$ref": "#/$defs/Transform" + }, + "labels": { + "$ref": "#/$defs/JSONStringMap" + }, + "tags": { + "$ref": "#/$defs/Tags" + }, + "properties": { + "items": { + "$ref": "#/$defs/ConfigProperties" + }, + "type": "array" + }, + "version": { + "type": "string" + }, + "compliance": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ignoredLicenses": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ignoreUnfixed": { + "type": "boolean" + }, + "licenseFull": { + "type": "boolean" + }, + "severity": { + "items": { + "type": "string" + }, + "type": "array" + }, + "vulnType": { + "items": { + "type": "string" + }, + "type": "array" + }, + "scanners": { + "items": { + "type": "string" + }, + "type": "array" + }, + "timeout": { + "type": "string" + }, + "kubernetes": { + "$ref": "#/$defs/TrivyK8sOptions" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TrivyK8sOptions": { + "properties": { + "components": { + "items": { + "type": "string" + }, + "type": "array" + }, + "context": { + "type": "string" + }, + "kubeconfig": { + "type": "string" + }, + "namespace": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file From 92c5ae91319ff4148e25e532817df499c209b4ff Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 13 Jan 2026 15:10:05 +0545 Subject: [PATCH 2/2] link to https://flanksource.com/docs/guide/config-db/llms.txt --- skills/create-config-scraper/SKILL.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skills/create-config-scraper/SKILL.md b/skills/create-config-scraper/SKILL.md index e93f3d3..1d6f8d9 100644 --- a/skills/create-config-scraper/SKILL.md +++ b/skills/create-config-scraper/SKILL.md @@ -50,3 +50,7 @@ Use the bundled per-scraper schemas below. Only open the schema for the requeste - Slack: `@skills/create-config-scraper/references/schemas/config_slack.schema.json` - Trivy: `@skills/create-config-scraper/references/schemas/config_trivy.schema.json` - Terraform: `@skills/create-config-scraper/references/schemas/config_terraform.schema.json` + +# Config Scraper + +Read: https://flanksource.com/docs/guide/config-db/llms.txt