turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.84k stars 264 forks source link

Mod fails if it requires a plugin that is installed but not configured #2129

Closed e-gineer closed 9 months ago

e-gineer commented 2 years ago

Describe the bug

Expected behavior

We should detect that no connections of the desired plugin version are available and refuse to run.

Additional context

/tmp $ steampipe --version
steampipe version 0.14.6
/tmp $ steampipe query
Welcome to Steampipe v0.14.6
For more information, type .help
> .inspect
+------------+-----------------------------------------------+
| connection | plugin                                        |
+------------+-----------------------------------------------+
| github     | hub.steampipe.io/plugins/turbot/github@latest |
| trivy      | hub.steampipe.io/plugins/turbot/trivy@latest  |
+------------+-----------------------------------------------+

To get information about the tables in a connection, run .inspect {connection}
To get information about the columns in a table, run .inspect {connection}.{table}

> 

/tmp $ 
/tmp $ steampipe plugin list
+----------------------------------------------------+---------+-------------+
| Name                                               | Version | Connections |
+----------------------------------------------------+---------+-------------+
| hub.steampipe.io/plugins/turbot/algolia@latest     | local   |             |
| hub.steampipe.io/plugins/turbot/aws@latest         | 0.60.0  |             |
| hub.steampipe.io/plugins/turbot/buildkite@latest   | local   |             |
| hub.steampipe.io/plugins/turbot/code@latest        | local   |             |
| hub.steampipe.io/plugins/turbot/config@latest      | local   |             |
| hub.steampipe.io/plugins/turbot/crtsh@latest       | local   |             |
| hub.steampipe.io/plugins/turbot/csv@latest         | 0.3.1   |             |
| hub.steampipe.io/plugins/turbot/duo@latest         | local   |             |
| hub.steampipe.io/plugins/turbot/git@latest         | local   |             |
| hub.steampipe.io/plugins/turbot/github@latest      | 0.15.0  | github      |
| hub.steampipe.io/plugins/turbot/hackernews@latest  | 0.3.1   |             |
| hub.steampipe.io/plugins/turbot/imap@latest        | local   |             |
| hub.steampipe.io/plugins/turbot/ipstack@latest     | 0.6.0   |             |
| hub.steampipe.io/plugins/turbot/linkedin@latest    | local   |             |
| hub.steampipe.io/plugins/turbot/net@latest         | 0.3.0   |             |
| hub.steampipe.io/plugins/turbot/panos@latest       | local   |             |
| hub.steampipe.io/plugins/turbot/planetscale@latest | local   |             |
| hub.steampipe.io/plugins/turbot/reddit@latest      | local   |             |
| hub.steampipe.io/plugins/turbot/rss@latest         | 0.2.1   |             |
| hub.steampipe.io/plugins/turbot/slack@latest       | 0.4.1   |             |
| hub.steampipe.io/plugins/turbot/terraform@latest   | 0.1.0   |             |
| hub.steampipe.io/plugins/turbot/trivy@latest       | local   | trivy       |
| hub.steampipe.io/plugins/turbot/twitter@latest     | 0.1.0   |             |
+----------------------------------------------------+---------+-------------+
/tmp $ 
/tmp $ cd ~/src/steampipe-mod-aws-compliance/
~/src/steampipe-mod-aws-compliance $ 
~/src/steampipe-mod-aws-compliance $ cat mod.sp 
// Benchmarks and controls for specific services should override the "service" tag
locals {
  aws_compliance_common_tags = {
    category = "Compliance"
    plugin   = "aws"
    service  = "AWS"
  }
}

mod "aws_compliance" {
  # hub metadata
  title         = "AWS Compliance"
  description   = "Run individual configuration, compliance and security controls or full compliance benchmarks for CIS, PCI, NIST, HIPAA, RBI CSF, GDPR, SOC 2, Audit Manager Control Tower and AWS Foundational Security Best Practices controls across all your AWS accounts using Steampipe."
  color         = "#FF9900"
  documentation = file("./docs/index.md")
  icon          = "/images/mods/turbot/aws-compliance.svg"
  categories    = ["aws", "cis", "compliance", "pci dss", "public cloud", "security"]

  opengraph {
    title       = "Steampipe Mod for AWS Compliance"
    description = "Run individual configuration, compliance and security controls or full compliance benchmarks for CIS, PCI, NIST, HIPAA, RBI CSF, GDPR, SOC 2, Audit Manager Control Tower and AWS Foundational Security Best Practices controls across all your AWS accounts using Steampipe."
    image       = "/images/mods/turbot/aws-compliance-social-graphic.png"
  }

  require {
    plugin "aws" {
      version = "0.59.0"
    }
  }
}
~/src/steampipe-mod-aws-compliance $ 
~/src/steampipe-mod-aws-compliance $ steampipe query
Welcome to Steampipe v0.14.6
For more information, type .help
> 
Warning: failed to create prepared statement for aws_compliance.control.elasticache_redis_cluster_automatic_backup_retention_15_days: ERROR: relation "aws_elasticache_replication_group" does not exist (SQLSTATE 42P01)
Warning: failed to create prepared statement for aws_compliance.control.cis_v130_1_18: ERROR: relation "aws_account" does not exist (SQLSTATE 42P01)
Warning: failed to create prepared statement for aws_compliance.control.cis_v140_5_2: ERROR: relation "aws_vpc_security_group_rule" does not exist (SQLSTATE 42P01)
Warning: failed to create prepared statement for aws_compliance.control.foundational_security_secretsmanager_4: ERROR: relation "aws_secretsmanager_secret" does not exist (SQLSTATE 42P01)
Warning: failed to create prepared statement for aws_compliance.control.cis_v130_4_7: ERROR: relation "aws_cloudtrail_trail" does not exist (SQLSTATE 42P01)
<snipped>
Warning: failed to create prepared statement for aws_compliance.control.autoscaling_group_with_lb_use_health_check: ERROR: relation "aws_ec2_autoscaling_group" does not exist (SQLSTATE 42P01)
> 
github-actions[bot] commented 10 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 9 months ago

This issue was closed because it has been stalled for 90 days with no activity.