modules

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QueryTemplates = map[string]map[string]string{
	"aws": {

		"ec2_running_count":   `SELECT COUNT(*) as count FROM aws_ec2_instance WHERE instance_state = 'running'`,
		"ec2_running_list":    `SELECT instance_id, instance_type, instance_state, region, vpc_id FROM aws_ec2_instance WHERE instance_state = 'running'`,
		"ec2_all_list":        `SELECT instance_id, instance_type, instance_state, region, vpc_id FROM aws_ec2_instance`,
		"ec2_by_type":         `SELECT instance_type, COUNT(*) as count FROM aws_ec2_instance GROUP BY instance_type`,
		"ec2_security_groups": `SELECT i.instance_id, sg->>'GroupId' as group_id, sg->>'GroupName' as group_name FROM aws_ec2_instance i, jsonb_array_elements(i.security_groups) as sg`,

		"s3_bucket_count":   `SELECT COUNT(*) as count FROM aws_s3_bucket`,
		"s3_bucket_list":    `SELECT name, region, creation_date FROM aws_s3_bucket`,
		"s3_public_buckets": `SELECT name FROM aws_s3_bucket WHERE bucket_policy_is_public = true`,

		"rds_instance_list":    `SELECT db_instance_identifier, engine, db_instance_class, publicly_accessible FROM aws_rds_db_instance`,
		"rds_public_instances": `SELECT db_instance_identifier FROM aws_rds_db_instance WHERE publicly_accessible = true`,

		"lambda_function_list": `SELECT name, runtime, timeout, memory_size FROM aws_lambda_function`,
		"lambda_by_runtime":    `SELECT runtime, COUNT(*) as count FROM aws_lambda_function GROUP BY runtime`,

		"iam_users_no_mfa": `SELECT name, create_date FROM aws_iam_user WHERE NOT mfa_enabled`,
		"iam_role_list":    `SELECT name, arn FROM aws_iam_role`,

		"vpc_list":            `SELECT vpc_id, cidr_block, is_default FROM aws_vpc`,
		"security_group_open": `SELECT group_id, group_name FROM aws_vpc_security_group WHERE jsonb_array_length(ingress_rules) > 0`,
	},
}

QueryTemplates provides tested, working Steampipe queries

Functions

func FixSteampipeQuery added in v0.4.0

func FixSteampipeQuery(query string, provider string) string

FixSteampipeQuery attempts to fix common AI-generated query mistakes

func GetQueryForPrompt added in v0.4.0

func GetQueryForPrompt(prompt string, provider string) []string

GetQueryForPrompt returns a appropriate query based on the prompt

func NewInfraMapService

func NewInfraMapService(client *dagger.Client) *dagger.Service

InfraMapService exposes infrastructure diagram generation as a service

func NewOpenInfraQuoteService

func NewOpenInfraQuoteService(client *dagger.Client) *dagger.Service

OpenInfraQuoteService exposes cost analysis as a service

func NewSteampipeService

func NewSteampipeService(client *dagger.Client) *dagger.Service

SteampipeService exposes Steampipe as an HTTP API service

func NewTerraformDocsService

func NewTerraformDocsService(client *dagger.Client) *dagger.Service

TerraformDocsService exposes documentation generation as a service

func NewToolRegistryService

func NewToolRegistryService(client *dagger.Client, services map[string]*dagger.Service) *dagger.Service

ToolRegistryService provides a registry of all available tools for the LLM

func ValidateQuery added in v0.4.0

func ValidateQuery(query string) error

ValidateQuery does basic validation

Types

type CheckovModule

type CheckovModule struct {
	// contains filtered or unexported fields
}

CheckovModule runs Checkov for multi-cloud security scanning

func NewCheckovModule

func NewCheckovModule(client *dagger.Client) *CheckovModule

NewCheckovModule creates a new Checkov module

func (*CheckovModule) GetVersion

func (m *CheckovModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of Checkov

func (*CheckovModule) ScanDirectory

func (m *CheckovModule) ScanDirectory(ctx context.Context, dir string) (string, error)

ScanDirectory scans a directory for security issues

func (*CheckovModule) ScanFile

func (m *CheckovModule) ScanFile(ctx context.Context, filePath string) (string, error)

ScanFile scans a specific file for security issues

func (*CheckovModule) ScanMultiFramework

func (m *CheckovModule) ScanMultiFramework(ctx context.Context, dir string, frameworks []string) (string, error)

ScanMultiFramework scans for multiple cloud frameworks

func (*CheckovModule) ScanWithPolicy

func (m *CheckovModule) ScanWithPolicy(ctx context.Context, dir string, policyPath string) (string, error)

ScanWithPolicy scans using custom policies

func (*CheckovModule) ScanWithSeverity

func (m *CheckovModule) ScanWithSeverity(ctx context.Context, dir string, severities []string) (string, error)

ScanWithSeverity scans filtering by severity levels

func (*CheckovModule) ScanWithSkips

func (m *CheckovModule) ScanWithSkips(ctx context.Context, dir string, skipChecks []string) (string, error)

ScanWithSkips scans while skipping specific checks

type InfraMapModule

type InfraMapModule struct {
	// contains filtered or unexported fields
}

InfraMapModule generates infrastructure diagrams from Terraform

func NewInfraMapModule

func NewInfraMapModule(client *dagger.Client) *InfraMapModule

NewInfraMapModule creates a new InfraMap module instance

func (*InfraMapModule) GenerateFromHCL

func (m *InfraMapModule) GenerateFromHCL(ctx context.Context, directory string, format string) (string, error)

GenerateFromHCL generates an infrastructure diagram from Terraform HCL files

func (*InfraMapModule) GenerateFromState

func (m *InfraMapModule) GenerateFromState(ctx context.Context, stateFile string, format string) (string, error)

GenerateFromState generates an infrastructure diagram from a Terraform state file

func (*InfraMapModule) GenerateWithOptions

func (m *InfraMapModule) GenerateWithOptions(ctx context.Context, input string, options InfraMapOptions) (string, error)

GenerateWithOptions generates a diagram with custom options

func (*InfraMapModule) PruneState

func (m *InfraMapModule) PruneState(ctx context.Context, stateFile string) (string, error)

PruneState removes unnecessary information from Terraform state

type InfraMapOptions

type InfraMapOptions struct {
	// Raw shows all resources without InfraMap logic
	Raw bool
	// Clean removes unconnected nodes (default: true)
	Clean bool
	// Provider filters by specific provider (aws, google, azurerm, etc.)
	Provider string
	// Format output format (png, svg, pdf, dot)
	Format string
}

InfraMapOptions contains options for diagram generation

type InfraScanModule

type InfraScanModule struct {
	// contains filtered or unexported fields
}

InfraScanModule runs Trivy for security scanning of Terraform code Using Trivy instead of InfraScan as it provides better Terraform security scanning

func NewInfraScanModule

func NewInfraScanModule(client *dagger.Client) *InfraScanModule

NewInfraScanModule creates a new InfraScan module (using Trivy)

func (*InfraScanModule) GetVersion

func (m *InfraScanModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of Trivy

func (*InfraScanModule) ScanDirectory

func (m *InfraScanModule) ScanDirectory(ctx context.Context, dir string) (string, error)

ScanDirectory scans a directory for security issues

func (*InfraScanModule) ScanFile

func (m *InfraScanModule) ScanFile(ctx context.Context, filePath string) (string, error)

ScanFile scans a specific Terraform file

func (*InfraScanModule) ScanWithRules

func (m *InfraScanModule) ScanWithRules(ctx context.Context, dir string, rulesFile string) (string, error)

ScanWithRules scans using custom rule set

type InfracostModule

type InfracostModule struct {
	// contains filtered or unexported fields
}

InfracostModule runs Infracost for cloud cost estimation

func NewInfracostModule

func NewInfracostModule(client *dagger.Client) *InfracostModule

NewInfracostModule creates a new Infracost module

func (*InfracostModule) BreakdownDirectory

func (m *InfracostModule) BreakdownDirectory(ctx context.Context, dir string) (string, error)

BreakdownDirectory generates cost breakdown for a directory

func (*InfracostModule) BreakdownPlan

func (m *InfracostModule) BreakdownPlan(ctx context.Context, planFile string) (string, error)

BreakdownPlan generates cost breakdown from a Terraform plan

func (*InfracostModule) BreakdownWithConfig

func (m *InfracostModule) BreakdownWithConfig(ctx context.Context, configFile string) (string, error)

BreakdownWithConfig runs breakdown using a config file

func (*InfracostModule) Diff

func (m *InfracostModule) Diff(ctx context.Context, dir string) (string, error)

Diff compares costs between current and planned state

func (*InfracostModule) GenerateHTMLReport

func (m *InfracostModule) GenerateHTMLReport(ctx context.Context, dir string) (string, error)

GenerateHTMLReport generates an HTML cost report

func (*InfracostModule) GenerateTableReport

func (m *InfracostModule) GenerateTableReport(ctx context.Context, dir string) (string, error)

GenerateTableReport generates a table format cost report

func (*InfracostModule) GetVersion

func (m *InfracostModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of Infracost

type LLMWithServiceTools

type LLMWithServiceTools struct {
	// contains filtered or unexported fields
}

LLMWithServiceTools creates an LLM that can call services as tools

func NewLLMWithServiceTools

func NewLLMWithServiceTools(client *dagger.Client, model string) *LLMWithServiceTools

NewLLMWithServiceTools creates an LLM with access to tool services

func (*LLMWithServiceTools) InvestigateWithServices

func (m *LLMWithServiceTools) InvestigateWithServices(ctx context.Context, task string) (*ServiceInvestigationReport, error)

InvestigateWithServices performs investigation using service-based tools

type OpenInfraQuoteModule

type OpenInfraQuoteModule struct {
	// contains filtered or unexported fields
}

OpenInfraQuoteModule runs OpenInfraQuote for Terraform cost analysis

func NewOpenInfraQuoteModule

func NewOpenInfraQuoteModule(client *dagger.Client) *OpenInfraQuoteModule

NewOpenInfraQuoteModule creates a new OpenInfraQuote module

func (*OpenInfraQuoteModule) AnalyzeDirectory

func (m *OpenInfraQuoteModule) AnalyzeDirectory(ctx context.Context, dir string, region string) (string, error)

AnalyzeDirectory analyzes all Terraform files in a directory

func (*OpenInfraQuoteModule) AnalyzePlan

func (m *OpenInfraQuoteModule) AnalyzePlan(ctx context.Context, planFile string, region string) (string, error)

AnalyzePlan analyzes a Terraform plan JSON file for cost estimation

func (*OpenInfraQuoteModule) GetVersion

func (m *OpenInfraQuoteModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of OpenInfraQuote

type ServiceInvestigationReport

type ServiceInvestigationReport struct {
	Task         string
	ServicesUsed []string
	Results      string
}

ServiceInvestigationReport contains results from service-based investigation

type TFLintModule

type TFLintModule struct {
	// contains filtered or unexported fields
}

TFLintModule runs TFLint for Terraform linting

func NewTFLintModule

func NewTFLintModule(client *dagger.Client) *TFLintModule

NewTFLintModule creates a new TFLint module

func (*TFLintModule) GetVersion

func (m *TFLintModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of TFLint

func (*TFLintModule) InitPlugins

func (m *TFLintModule) InitPlugins(ctx context.Context, dir string) error

InitPlugins initializes TFLint plugins

func (*TFLintModule) LintDirectory

func (m *TFLintModule) LintDirectory(ctx context.Context, dir string) (string, error)

LintDirectory lints all Terraform files in a directory

func (*TFLintModule) LintFile

func (m *TFLintModule) LintFile(ctx context.Context, filePath string) (string, error)

LintFile lints a specific Terraform file

func (*TFLintModule) LintWithConfig

func (m *TFLintModule) LintWithConfig(ctx context.Context, dir string, configFile string) (string, error)

LintWithConfig lints using a custom configuration file

func (*TFLintModule) LintWithRules

func (m *TFLintModule) LintWithRules(ctx context.Context, dir string, enableRules []string, disableRules []string) (string, error)

LintWithRules runs TFLint with specific rule sets enabled

type TerraformDocsModule

type TerraformDocsModule struct {
	// contains filtered or unexported fields
}

TerraformDocsModule runs terraform-docs for documentation generation

func NewTerraformDocsModule

func NewTerraformDocsModule(client *dagger.Client) *TerraformDocsModule

NewTerraformDocsModule creates a new terraform-docs module

func (*TerraformDocsModule) GenerateJSON

func (m *TerraformDocsModule) GenerateJSON(ctx context.Context, dir string) (string, error)

GenerateJSON generates JSON documentation for Terraform modules

func (*TerraformDocsModule) GenerateMarkdown

func (m *TerraformDocsModule) GenerateMarkdown(ctx context.Context, dir string) (string, error)

GenerateMarkdown generates markdown documentation for Terraform modules

func (*TerraformDocsModule) GenerateTable

func (m *TerraformDocsModule) GenerateTable(ctx context.Context, dir string) (string, error)

GenerateTable generates a markdown table of inputs and outputs

func (*TerraformDocsModule) GenerateWithConfig

func (m *TerraformDocsModule) GenerateWithConfig(ctx context.Context, dir string, configFile string) (string, error)

GenerateWithConfig generates documentation using a config file

func (*TerraformDocsModule) GetVersion

func (m *TerraformDocsModule) GetVersion(ctx context.Context) (string, error)

GetVersion returns the version of terraform-docs

type ToolService

type ToolService struct {
	// contains filtered or unexported fields
}

ToolService wraps a module as an HTTP service that the LLM can call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL