Skip to content

Commit

Permalink
Improve table docs (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Madhushree Ray <madhushree@turbot.com>
  • Loading branch information
misraved and madhushreeray30 authored Dec 12, 2023
1 parent 264929e commit ac484f4
Show file tree
Hide file tree
Showing 16 changed files with 950 additions and 81 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/steampipe-anywhere.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release Steampipe Anywhere Components

on:
push:
tags:
- 'v*'


jobs:
anywhere_publish_workflow:
uses: turbot/steampipe-workflows/.github/workflows/steampipe-anywhere.yml@main
secrets: inherit
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ from
tfe_workspace;
```

## Engines

This plugin is available for the following engines:

| Engine | Description
|---------------|------------------------------------------
| [Steampipe](https://steampipe.io/docs) | The Steampipe CLI exposes APIs and services as a high-performance relational database, giving you the ability to write SQL-based queries to explore dynamic data. Mods extend Steampipe's capabilities with dashboards, reports, and controls built with simple HCL. The Steampipe CLI is a turnkey solution that includes its own Postgres database, plugin management, and mod support.
| [Postgres FDW](https://steampipe.io/docs/steampipe_postgres/overview) | Steampipe Postgres FDWs are native Postgres Foreign Data Wrappers that translate APIs to foreign tables. Unlike Steampipe CLI, which ships with its own Postgres server instance, the Steampipe Postgres FDWs can be installed in any supported Postgres database version.
| [SQLite Extension](https://steampipe.io/docs//steampipe_sqlite/overview) | Steampipe SQLite Extensions provide SQLite virtual tables that translate your queries into API calls, transparently fetching information from your API or service as you request it.
| [Export](https://steampipe.io/docs/steampipe_export/overview) | Steampipe Plugin Exporters provide a flexible mechanism for exporting information from cloud services and APIs. Each exporter is a stand-alone binary that allows you to extract data using Steampipe plugins without a database.
| [Turbot Pipes](https://turbot.com/pipes/docs) | Turbot Pipes is the only intelligence, automation & security platform built specifically for DevOps. Pipes provide hosted Steampipe database instances, shared dashboards, snapshots, and more.

## Developing

Prerequisites:
Expand Down Expand Up @@ -67,11 +79,17 @@ Further reading:
- [Writing plugins](https://steampipe.io/docs/develop/writing-plugins)
- [Writing your first table](https://steampipe.io/docs/develop/writing-your-first-table)

## Contributing
## Open Source & Contributing

This repository is published under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) (source code) and [CC BY-NC-ND](https://creativecommons.org/licenses/by-nc-nd/2.0/) (docs) licenses. Please see our [code of conduct](https://github.com/turbot/.github/blob/main/CODE_OF_CONDUCT.md). We look forward to collaborating with you!

[Steampipe](https://steampipe.io) is a product produced from this open source software, exclusively by [Turbot HQ, Inc](https://turbot.com). It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our [Open Source FAQ](https://turbot.com/open-source).

## Get Involved

Please see the [contribution guidelines](https://github.com/turbot/steampipe/blob/main/CONTRIBUTING.md) and our [code of conduct](https://github.com/turbot/steampipe/blob/main/CODE_OF_CONDUCT.md). All contributions are subject to the [Apache 2.0 open source license](https://github.com/turbot/steampipe-plugin-tfe/blob/main/LICENSE).
**[Join #steampipe on Slack →](https://turbot.com/community/join)**

`help wanted` issues:
Want to help but don't know where to start? Pick up one of the `help wanted` issues:

- [Steampipe](https://github.com/turbot/steampipe/labels/help%20wanted)
- [Terraform Enterprise Plugin](https://github.com/turbot/steampipe-plugin-tfe/labels/help%20wanted)
402 changes: 402 additions & 0 deletions docs/LICENSE

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ short_name: "tfe"
description: "Steampipe plugin to query resources, users and more from Terraform Enterprise."
og_description: "Query Terraform Enterprise with SQL! Open source CLI. No DB required."
og_image: "/images/plugins/turbot/tfe-social-graphic.png"
engines: ["steampipe", "sqlite", "postgres", "export"]
---

# Terraform Enterprise + Steampipe

[Terraform Enterprise](https://www.terraform.io/cloud) is a cloud hosting company that provides virtual private servers and other infrastructure services.

[Steampipe](https://steampipe.io) is an open source CLI to instantly query cloud APIs using SQL.
[Steampipe](https://steampipe.io) is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

List workspaces in your Terraform Enterprise organization:

Expand Down Expand Up @@ -80,11 +81,6 @@ connection "tfe" {
}
```

## Get involved

- Open source: https://github.com/turbot/steampipe-plugin-tfe
- Community: [Join #steampipe on Slack →](https://turbot.com/community/join)

## Multi-Organization Connections

You may create multiple tfe connections:
Expand Down
38 changes: 32 additions & 6 deletions docs/tables/tfe_current_user.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
# Table: tfe_current_user
---
title: "Steampipe Table: tfe_current_user - Query Terraform Enterprise Current User using SQL"
description: "Allows users to query Current Users in Terraform Enterprise, specifically to retrieve detailed information about the authenticated user."
---

Get information about the current user making the request.
# Table: tfe_current_user - Query Terraform Enterprise Current User using SQL

Terraform Enterprise is an advanced version of Terraform that provides collaboration and governance features. It acts as a shared platform for teams to collaborate on infrastructure as code, providing a workspace for sharing and storing Terraform configurations. It also includes a private registry for sharing Terraform modules.

## Table Usage Guide

The `tfe_current_user` table provides insights into the authenticated users within Terraform Enterprise. As a system administrator, you can explore user-specific details through this table, including user's ID, username, email, and other associated metadata. Utilize it to uncover information about users, such as their verification status, two-factor authentication status, and whether they are a site administrator.

## Examples

### Get user information
Explore your current user profile details in Terraform Enterprise. This could be useful for auditing or troubleshooting purposes.

```sql
```sql+postgres
select
*
from
tfe_current_user
tfe_current_user;
```

```sql+sqlite
select
*
from
tfe_current_user;
```

### Check if this is a service account
Determine if the current user is a service account. This is useful for managing user access and identifying potential security risks.

```sql
```sql+postgres
select
username,
is_service_account
from
tfe_current_user
tfe_current_user;
```

```sql+sqlite
select
username,
is_service_account
from
tfe_current_user;
```
49 changes: 44 additions & 5 deletions docs/tables/tfe_oauth_client.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
# Table: tfe_oauth_client
---
title: "Steampipe Table: tfe_oauth_client - Query Terraform Enterprise OAuth Clients using SQL"
description: "Allows users to query OAuth Clients in Terraform Enterprise, specifically the client credentials, providing insights into OAuth client configurations and associated details."
---

List OAuth clients in a Terraform Enterprise organization.
# Table: tfe_oauth_client - Query Terraform Enterprise OAuth Clients using SQL

An OAuth Client in Terraform Enterprise is a fundamental building block when working with OAuth-based connections in the platform. It represents the applications that are registered to use the OAuth 2.0 authorization framework. OAuth Clients are responsible for managing the OAuth tokens and their associated scopes, providing a secure way to authenticate users and interact with the Terraform Enterprise API.

## Table Usage Guide

The `tfe_oauth_client` table provides insights into OAuth Clients within Terraform Enterprise. As a security administrator, explore OAuth client-specific details through this table, including client credentials, token details, and associated metadata. Utilize it to uncover information about OAuth clients, such as those with specific permissions, the relationships between clients, and the verification of token scopes.

## Examples

### Basic info
Explore the OAuth client details within your infrastructure to gain insights into their configuration and usage. This can be useful in understanding the client's behavior and identifying any potential issues or areas for improvement.

```sql
```sql+postgres
select
*
from
tfe_oauth_client;
```

```sql+sqlite
select
*
from
tfe_oauth_client;
```

### Get OAuth client by ID
Explore which OAuth client corresponds to a specific ID to manage access and permissions more effectively. This can be useful in scenarios where you need to understand the access granted to a particular client or troubleshoot issues related to client permissions.

```sql
```sql+postgres
select
*
from
tfe_oauth_client
where
id = 'oc-JM8tnPzgdo1wM3jy';
```

```sql+sqlite
select
*
from
Expand All @@ -25,8 +52,9 @@ where
```

### List OAuth clients sorted by age
Analyze the settings to understand the age of your OAuth clients, allowing you to prioritize updates or maintenance based on their age. This can be useful in managing the lifecycle of your OAuth clients and ensuring older clients are still functioning properly.

```sql
```sql+postgres
select
id,
created_at,
Expand All @@ -36,3 +64,14 @@ from
order by
age_days desc;
```

```sql+sqlite
select
id,
created_at,
julianday('now') - julianday(created_at) as age_days
from
tfe_oauth_client
order by
age_days desc;
```
40 changes: 34 additions & 6 deletions docs/tables/tfe_organization.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,54 @@
# Table: tfe_organization
---
title: "Steampipe Table: tfe_organization - Query Terraform Enterprise Organizations using SQL"
description: "Allows users to query Terraform Enterprise Organizations, specifically retrieving details about each organization, including its name, email, and session timeout."
---

List organizations the user has permission to see.
# Table: tfe_organization - Query Terraform Enterprise Organizations using SQL

A Terraform Enterprise Organization represents a collection of users, teams, and workspaces. Within an organization, users can collaborate and manage workspaces together. The organization also provides a context in which resources such as Sentinel policies and SSH keys can be shared.

## Table Usage Guide

The `tfe_organization` table provides insights into organizations within Terraform Enterprise. As a DevOps engineer, explore organization-specific details through this table, including membership, collaboration status, and associated workspaces. Utilize it to uncover information about organizations, such as those with specific team access, the collaboration status between teams, and the management of workspaces.

## Examples

### List organizations
Explore the different organizations within your network. This allows for better management and understanding of the various groups interacting with your systems.

```sql
```sql+postgres
select
*
from
tfe_organization
tfe_organization;
```

```sql+sqlite
select
*
from
tfe_organization;
```

### Organizations that do not require two factor
Discover the organizations that do not comply with two-factor authentication. This can be useful for assessing security measures and identifying potential vulnerabilities within your organization.

```sql
```sql+postgres
select
name,
two_factor_conformant
from
tfe_organization
where
not two_factor_conformant
not two_factor_conformant;
```

```sql+sqlite
select
name,
two_factor_conformant
from
tfe_organization
where
not two_factor_conformant;
```
34 changes: 30 additions & 4 deletions docs/tables/tfe_organization_member.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
# Table: tfe_organization_member
---
title: "Steampipe Table: tfe_organization_member - Query Terraform Enterprise Organization Members using SQL"
description: "Allows users to query Terraform Enterprise Organization Members, specifically their access levels, user details, and associated organization information."
---

List organizations the user has permission to see.
# Table: tfe_organization_member - Query Terraform Enterprise Organization Members using SQL

Terraform Enterprise is a collaborative, scalable, and enterprise-grade version of Terraform that enables teams to work together on infrastructure as code. It provides a centralized workspace for managing Terraform runs, state, and modules, as well as access control and policy enforcement. An Organization Member in Terraform Enterprise refers to a user who is part of a specific organization, with assigned permissions and roles within that organization.

## Table Usage Guide

The `tfe_organization_member` table provides insights into the members of an organization within Terraform Enterprise. As a system administrator or DevOps engineer, explore member-specific details through this table, including their access levels, user details, and associated organization information. Utilize it to manage and monitor user roles and permissions within your organization, ensuring security and compliance.

## Examples

### List all users who are members of the organization
Discover the segments that involve all users who are part of an organization. This could be beneficial in understanding the distribution of users across different organizational structures.

```sql+postgres
select
*
from
tfe_organization_member;
```

```sql
```sql+sqlite
select
*
from
tfe_organization_member;
```

### Check two factor authentication status for each org member
Determine the status of two-factor authentication for each member of an organization. This can help enhance security by identifying members who have not yet enabled this feature.

```sql
```sql+postgres
select
username,
(member -> 'TwoFactor' ->> 'Enabled')::bool as two_factor_enabled
from
tfe_organization_member;
```

```sql+sqlite
select
username,
json_extract(member, '$.TwoFactor.Enabled') as two_factor_enabled
from
tfe_organization_member;
```
Loading

0 comments on commit ac484f4

Please sign in to comment.