
AWS、Azure、GCP、K8s、tencent向けのユニバーサルなGraphQL APIおよびCSPMツール
CloudGraphは、AWS、Azure、GCP、K8s向けの無料のオープンソースユニバーサル GraphQL API および Cloud Security Posture Management (CSPM) ツールです。CloudGraphを使用すると、以下の機能が得られます。
CloudGraphを使用すると、5分でクラウドを把握できます。❤️ AutoCloud ❤️のチームが愛情を込めて構築・メンテナンスしています。
🌐 Website
💰 Get paid to build CloudGraph providers
** 使用は推薦を意味するものではありません
AWS、Azure、GCPは、私たちエンジニアが相互接続が進む世界を支えるシステムを構築できるようにするソリューションを開発する素晴らしい仕事をしてきました。過去15年にわたり、EC2、S3、RDS、Lambdaなどの製品は、コンピューティング、ストレージ、データベースに関する考え方を根本的に変えてきました。
ここ5年ほどの間のKubernetesとサーバーレスの普及により、クラウドサービスは物理サーバーのラックの上でますます抽象化されてきました。エンドユーザーにとって、クラウド上のすべては単なるAPIであり、Lambda関数やEKSが内部でどのように動作するかを知らなくても、アプリケーション構築に使用することは可能です。少しのドキュメント、APIまたはコンソールへのアクセス、チュートリアルがあれば、誰でも必要なものを作成できます。
これらの抽象化により、CSPサービスの提供における全体的な利便性と幅が大幅に向上しました。かつては骨の折れる時間のかかるエラーの多いプロセスだった新しいサーバー、データベース、ファイルシステムのプロビジョニングが、今ではボタンをクリックするかIACをデプロイするだけで数秒で完了します。すべてが単なるAPIの抽象化であるため、CAPが新しい「製品」を導入する準備ができたら、新しいAPIを公開するだけで済みます。もちろん、少し単純化していますが。
CSPに詳しい人なら誰でも、サービスAPIはほとんどの場合、モジュール化された名前空間に分割されており、単一のリソースに対して数十、いや数百もの個別のAPIメソッドを含んでいることを知っています。例えば、AWS EC2サービスには500以上の異なるAPIメソッドがあり、時折新しいものが追加されます。CSP上で大規模なシステムを構築している企業は、おそらく非常に多くの異なるサービスを使用しています。
データセンターアーキテクチャの傑作ではあるものの、何百ものサービスと構成オプションというこの選択は、これらのサービスを適切に使用する方法に関する知識の負担を私たちエンジニアに直接課しています。その結果、私たちは常に最新情報を把握し、すべてのサービス提供や新しい変更について学ばなければならないことに気づきます。これにはかなりの時間と精神力が必要です。開発者として、AWS CLIを使用して、例えばAWS ECSクラスター、そのサービス、タスク定義、タスク、コンテナ定義などを記述するために5つの異なるAPIコールを行うことは、難しく、時間がかかり、イライラすることがあります。私たちはしばしばドキュメントに迷い込み、「このVPCでは実際に何が実行されているのか?」といった質問に対する答えを得るために、半ダースものAPIを使用しなければなりません。
これは、AWS、Azure、GCPが、経験豊富なクラウドアーキテクトでさえすぐに圧倒されてしまう可能性があることを意味します。
AWSのCloud Control APIのような新しいソリューションは、多くの異なるタイプのAWSリソースをクエリするための標準化されたインターフェースを作成しようと試みています。残念ながら、Cloud Control APIの使用は厳しく制限されており、ユーザーは依然としてデータを正しくクエリする方法を知っておく必要があります。つまり、ドキュメントを読んだり、サービスがどのように機能し互いに関連しているかを理解するためにより多くの時間を費やすことになります。
CSP APIのモジュール性は優れた論理的な組織システムであり理にかなっていますが、認知的なオーバーヘッドと学習曲線の点でエンドユーザーにとって負担となっています。常に変化する何百ものサービスがどのように機能し接続されているかを覚えなければならないことは、カフェイン中毒と探偵ごっこに時間を浪費することにつながります。
もしDevOps/クラウドエンジニアである私たちが、AWS、Azure、GCPなどからデータを取得するより簡単な方法を持っていたら素晴らしいと思いませんか?ドキュメントやスタックオーバーフローに何時間も費やすことなく、任意のアカウントの任意のサービスに関するデータを簡単にクエリできる方法です。
これらの理由から、私たちはあらゆるクラウドのためのGraphQL APIであるCloudGraphを構築しました。CloudGraphは、クラウドデータを抽出、正規化、処理、強化し、複数のプロバイダーにわたる深い洞察に簡単にアクセスできるようにします。詳細については、ブログ記事「あらゆるもののためのGraphQL API」をご覧ください。
CloudGraphの実行には読み取り専用権限が必要であり、そのため実際のクラウドインフラストラクチャを決して変更することはできません。また、お客様のクラウド環境情報がCloudGraph、AutoCloud、またはその他の第三者に送信されたり共有されたりすることは決してありません。
内部的には、CloudGraphはクラウドプロバイダーに接続し、すべての構成データを吸い上げ、処理し、このデータのコピーをDgraphに保存します。その後、http://localhost:8997でエンドポイントを公開し、保存されたデータに対してGraphQLクエリを作成できるようにします。これらのクエリを使用すると、AWS SDK/CLIなどで行うことだけでなく、はるかに強力なクエリも実行できます。CloudGraphにはGraphQL PlaygroundやAltairなどのパッケージ化されたGraphQLクエリツールが同梱されていますが、独自のものを自由に使用することもできます。また、エンティティ間の関係を理解できるようにするスキーマ可視化ツールVoyagerも含まれています。
CloudGraphは現在、AWS、Azure、GCP、K8s、Tencentをサポートしています(他にもいくつか近日公開予定)。CloudGraphはデータを取り込むために読み取り権限が必要です。簡単にするために、AutoCloudを動かすためにCloudGraphを実行する際に内部で使用しているのと同じ権限を使用できます。各プロバイダーの認証情報を生成するための認証ガイドと詳細は以下の通りです(AutoCloud固有の設定は省略しても構いません)。
システム要件
CloudGraph CLIをインストールするには2つの方法があります。
以下のコマンドでhomebrewを使用してCloudGraphをインストールできます:
brew install cloudgraphdev/tap/cg
以下のコマンドを使用してCloudGraphをインストールし、最新バージョンに更新します。```bash npm i -g @cloudgraph/cli
<p align="center">
<a href="https://github.com/cloudgraphdev/cli/raw/main/docs/images/install.gif">
<img alt="install" src="https://raw.githubusercontent.com/cloudgraphdev/cli/main/docs/images/install.gif" width="95%" style="display: block; margin: auto"/>
</a>
</p>
<br/>
次に、必要なプロバイダーを追加できます(プロバイダーリポジトリへのリンク:[AWS](https://github.com/cloudgraphdev/cloudgraph-provider-aws)、[Azure](https://github.com/cloudgraphdev/cloudgraph-provider-azure)、[GCP](https://github.com/cloudgraphdev/cloudgraph-provider-gcp)、[K8s](https://github.com/cloudgraphdev/cloudgraph-provider-k8s)、[Tencent Docs](https://github.com/cloudgraphdev/cloudgraph-provider-tencent)):```bash
cg init aws
cg init azure
cg init gcp
cg init k8s
cg init tencent
一度に好きなだけ追加することもできます```bash cg init aws azure gcp k8s tencent
そして、コンプライアンスポリシーパックを追加して、データを即座のセキュリティインサイトで補完します:```bash
cg policy add gcp-cis-1.2.0
cg policy add azure-cis-1.3.1
cg policy add aws-cis-1.2.0
cg policy add aws-cis-1.3.0
cg policy add aws-cis-1.2.0
cg policy add aws-pci-dss-3.2.1
cg policy add aws-nist-800-53-rev4
現在サポートされているポリシーパックの一覧は、Policy Packs リポジトリ にあります。
3つの簡単なコマンドですぐに使い始められます。
cg init
1. これはCloudGraphの設定を初期化します。このコマンドは、使用しているプロバイダーと、CloudGraphをどのように設定したいかについて、一連の質問を行います。
<p align="center">
<a href="https://github.com/cloudgraphdev/cli/raw/main/docs/images/init.gif">
<img alt="init" src="https://raw.githubusercontent.com/cloudgraphdev/cli/main/docs/images/init.gif" width="95%" style="display: block; margin: auto"/>
</a>
</p>
<br/>
---
<br/>```bash
cg launch
cg launch便利コマンドを使用することです。このコマンドを使用したくない場合、たとえばDgraphコンテナをインタラクティブモードで起動したい場合は、以下のdockerコマンドを使用できることに注意してください。```bash docker run -it -p 8995:5080 -p 8996:6080 -p 8997:8080 -p 8998:9080 -p 8999:8000 --label cloudgraph-cli-dgraph-standalone -v ~/dgraph:/dgraph --name dgraph dgraph/standalone:v21.03.1
---
<br/>```bash
cg scan
cg scanコマンドの実行中に警告やエラーが表示されるのは完全に正常であり、これらは通常、権限の問題によるものであることに注意してください。ただし、CloudGraphの実行中に問題のあるエラーが発生した場合は、コマンドの先頭にCG_DEBUG=5を追加して、CG_DEBUG=5 cg scanのように実行できます。これにより、より詳細な情報を含む詳細ログが表示され、出力がcg-debug.logに保存されます。ログは、GitHubでイシューを開くか、Slackワークスペースでお知らせください。これで完了です。クエリを開始する準備が整いました! cg initコマンドで選択したクエリツールが、好みのブラウザで開かれ、すべてのクラウドインフラストラクチャに対するクエリ、ミューテーション、可視化を実行できます! AWS CIS 1.2などのポリシーパックをインストールした場合、ポリシーパックのインサイトデータが自動的にクラウドデータに追加されることに注意してください。
また、http://localhost:8997/graphqlに接続することで、**任意の** GraphQLクエリツールを使用できることにも注意してください。
Dgraphインスタンスを停止する(dgraphコンテナを停止する)には、次のように実行します:
```bash
cg teardown
<br />
さらに、コンテナを停止した後に削除する場合は、実行:
<br />```bash
cg teardown --delete-image
CloudGraphは、cg init コマンドで設定した数の過去バージョンデータを保存します。過去バージョンのデータを読み込んでクエリするには、cg load コマンドを実行し、調査したいデータのバージョンを以下のように選択します。
各プロバイダーで現在サポートされているサービスの一覧は、以下のプロバイダリポジトリで確認できます。
完全なドキュメントへのリンク: https://docs.cloudgraph.dev/overview。
CloudGraphを使用するには、GraphQL に精通している必要があります。このセクションには、すぐに使い始めるためのいくつかのクエリ例が含まれていますが、決して網羅的ではありません。思いつくものは何でもクエリできます! ドキュメント には、さらに数百のクエリ例があります。
注: このセクションでは AWS に焦点を当てますが、同じ考え方は Azure や GCP などの他のプロバイダーにも適用されます。
CloudGraph の仕組みを説明するために、単一の EC2 instance の ID と ARN を取得するために実行できる次のクエリを考えてみます。これらの例では簡潔にするために AWS リソースの IDs と ARNs のみをリクエストしますが、任意の属性をクエリできます。
```graphql
query {
getawsEc2(
arn: "arn:aws:ec2:us-east-1:123445678997:instance/i-12345567889012234"
) {
id
arn
}
}
<br />
このクエリは、`JSON` ペイロードを返します。以下の例はすべて同様です。
<br />```json
{
"data": {
"getawsEc2": {
"id": "i-12345567889012234",
"arn": "arn:aws:ec2:us-east-1:123445678997:instance/i-12345567889012234"
}
},
"extensions": {
"touched_uids": 4
}
}
スキャンしたすべてのAWSアカウント内の各EC2のIDとARNを取得します:```graphql
query {
queryawsEc2 {
id
arn
}
}
<br />
`ID` と `ARN` を **1つの** AWSアカウント内の全 `EC2` インスタンスの accountId でフィルタリングして取得する:```graphql
query {
queryawsEc2(filter: { accountId: { eq: "123456" } }) {
id
arn
}
}
"us-east-1"内の各EC2のIDとARNを取得し、正規表現を使用してARNを検索します:```graphql
query {
queryawsEc2(filter: { arn: { regexp: "/.us-east-1./" } }) {
id
arn
}
}
<br />
同じことを行いますが、正規表現を使用する代わりに、`region` が `"us-east-1"` に等しいかどうかを確認します:```graphql
query {
queryawsEc2(filter: { region: { eq: "us-east-1" } }) {
id
arn
}
}
同じことを行いますが、region の名前に "us-east-1" が含まれていることを確認し、eq は使用しません:```graphql
query {
queryawsEc2(filter: { region: { in: "us-east-1" } }) {
id
arn
}
}
各 `M5` シリーズの `EC2 instance` の `ID` と `ARN` を `\"us-east-1\"` で取得する```graphql
query {
queryawsEc2(
filter: { region: { eq: "us-east-1" }, instanceType: { regexp: "/^m5a*/" } }
) {
id
arn
}
}
同じことを行いますが、最初に見つかった結果をスキップし(つまり offset: 1)、その後最初の2つの結果のみを返し(つまり first: 2)、それらの結果をAZの昇順で並べ替えます(order: { asc: availabilityZone })。これにより、"us-east-1a" にあるインスタンスがリストの先頭に返されます。```graphql
query {
queryawsEc2(
filter: { region: { eq: "us-east-1" }, instanceType: { regexp: "/^m5a*/" } }
order: { asc: availabilityZone }
first: 2
offset: 1
) {
id
arn
}
}
<br />
同じことを行いますが、各`EC2 instance`のブートディスクである`EBS Volume`も含めてください:```graphql
query {
queryawsEc2(
filter: { region: { eq: "us-east-1" }, instanceType: { regexp: "/^m5a*/" } }
order: { asc: availabilityZone }
first: 2
offset: 1
) {
id
arn
ebs(filter: { isBootDisk: true }, first: 1) {
id
arn
isBootDisk
}
}
}
同じことを行いますが、各EC2のSGsとALBsも含めます。ALBsについては、それらが接続されているEC2sを、見つかった各EC2インスタンスのIDおよびARNとともに取得します(つまり、循環クエリ)。```graphql
query {
queryawsEc2(
filter: { region: { eq: "us-east-1" }, instanceType: { regexp: "/^m5a*/" } }
order: { asc: availabilityZone }
first: 2
offset: 1
) {
id
arn
ebs(filter: { isBootDisk: true }, first: 1) {
id
arn
isBootDisk
}
securityGroups {
id
arn
}
alb {
id
arn
ec2Instance {
id
arn
}
}
}
}
<br />
各`VPC`、その`VPC`内の`ALB`と`Lambda`、さらにその下の大量のネストされたサブデータを取得します。また、`us-east-1`内の各`S3バケット`も取得します。さらに、`ARN`が`arn:aws:sqs:us-east-1:8499274828484:autocloud.fifo`の`SQS`キューを取得し、`approximateNumberOfMessages`を確認します。要するに、CloudGraphは**非常に**強力です。```graphql
query {
queryawsVpc {
id
arn
alb {
id
arn
ec2Instance {
id
arn
ebs(filter: { isBootDisk: true }) {
id
arn
}
}
}
lambda {
id
arn
kms {
id
arn
}
}
}
queryawsS3(filter: { region: { eq: "us-east-1" } }) {
id
arn
}
getawsSqs(arn: "arn:aws:sqs:us-east-1:8499274828484:autocloud.fifo") {
approximateNumberOfMessages
}
}
CloudGraphポリシーパックは、特定のクラウドプロバイダーの既存インフラストラクチャ全体のコンプライアンスを保証します。パックは、Center for Internet Securityなどのセキュリティ組織が提供するルール/ベンチマークのセットに基づいており、インフラストラクチャを業界のセキュリティ基準に最新の状態に保つことを目的としています。cg policy addコマンド(例:cg policy add aws-cis-1.2.0)を使用してポリシーパックを追加すると、スキャンを実行するたびにCloudGraphが設定されたポリシーを_自動的に_実行します。その結果はDgraphに保存され、既存のリソースにリンクされるため、リソースと一緒にコンプライアンス結果を簡単にクエリできます。
現在利用可能なポリシーパックの詳細については、ポリシーパックリポジトリをご覧ください。
AWS CIS 1.2用のCloudGraphポリシーパックを使用して、すべてのAWSアカウントのCIS調査結果をクエリします。```graphql query { queryawsCISFindings { id resourceId result rule { id description severity } } }
<br />
特定のプロバイダ(AWSなど)に関する複数の異なるコンプライアンス検出結果を一度にクエリしたい場合は、次のようにリクエストできます:```graphql
query {
queryawsFindings {
CISFindings {
id
resourceId
result
rule {
id
description
severity
}
}
AutoCloudFindings {
id
resourceId
result
rule {
id
description
severity
}
}
}
}
各CISルールについて、そのルールに関連するリソースを取得します。この場合、IAMユーザーのデータをクエリして、合格と不合格を確認しています。```graphql query { queryawsCISFindings { id resourceId result rule { id description severity } iamUser { id arn name } } }
<br />
特定のIAMユーザーに適用されるCISルールを理解したい場合は、次のクエリを使用できます:```graphql
query {
getawsIamUser(id: "123456789") {
name
CISFindings {
id
resourceId
result
rule {
id
description
severity
}
}
}
}
ポリシーパックがインストールされていなくても、次のように強力なセキュリティクエリを作成して、暗号化されていない EBS Volumes をすべて見つけることができます:```graphql
query {
queryawsEbs(filter: { encrypted: false }) {
id
arn
availabilityZone
encrypted
}
}
<br />
すべてのパブリック `S3 Buckets` を見つける:```graphql
query {
queryawsS3(filter: { access: { eq: "Public" } }) {
id
arn
access
}
}
それ自体が公開されているか、またはその中に公開されたオブジェクトを持つことができるすべてのS3 Bucketsを見つけてください:```graphql
query {
queryawsS3(filter: { not: { access: { eq: "Private" } } }) {
id
arn
access
}
}
<br />
`"us-east-1"`にある`KMS`キーをすべて見つける:```graphql
query {
queryawsKms(filter: { arn: { regexp: "/.*us-east-1.*/" } }) {
id
arn
description
keyRotationEnabled
tags {
key
value
}
}
}
すべてのバースト可能なTシリーズインスタンスを見つける:```graphql
query {
queryawsEc2(filter: { instanceType: { regexp: "/^t.*/" } }) {
id
arn
availabilityZone
instanceType
}
}
<br />
デフォルトの `VPCs` を見つける:```graphql
query {
queryawsVpc(filter: { defaultVpc: true }) {
id
arn
defaultVpc
state
}
}
公開している ALBsを見つける:```graphql
query {
queryawsAlb(filter: { scheme: { eq: "internet-facing" } }) {
id
arn
dnsName
createdAt
tags {
key
value
}
}
}
<br />
`Tag` 値が `"Production"` であるすべての `EC2s`、`Lambdas`、`VPCs` を見つけてください:```graphql
query {
queryawsTag(filter: { value: { eq: "Production" } }) {
key
value
ec2Instance {
id
arn
}
lambda {
id
arn
}
vpc {
id
arn
}
}
}
同じことを行いますが、key と value の両方を探してください:```graphql
query {
queryawsTag(
filter: { key: { eq: "Environment" }, value: { eq: "Production" } }
) {
key
value
ec2Instance {
id
arn
}
lambda {
id
arn
}
vpc {
id
arn
}
}
}
<br />
`queryawsTag` の代わりに `getawsTag` を使用して同じことを行います。`getawsTag` を使用してタグを検索する場合、以下のように `"Environment:Production"` で行われているように、`key` と `value` の **両方** を `id` として指定する必要があることに注意してください:```graphql
query {
getawsTag(id: "Environment:Production") {
key
value
ec2Instance {
id
arn
}
lambda {
id
arn
}
vpc {
id
arn
}
}
}
現在、請求データはAWSでのみ利用可能です。FinOps関連データを正常に取り込むには、AWSアカウントでCost Explorer APIを有効にする必要があります。その方法はこちら
AWSアカウントの過去30日間の総コスト、AWSアカウントの月初から現在までの総コスト、過去30日間の各サービスとそのコストの内訳、月初から現在までの各サービスとそのコストの内訳、および月平均と月初から現在までの平均コストを取得します。```graphql
query {
queryawsBilling {
totalCostLast30Days {
cost
currency
formattedCost
}
totalCostMonthToDate {
cost
currency
formattedCost
}
monthToDate {
name
cost
currency
formattedCost
}
last30Days {
name
cost
currency
formattedCost
}
monthToDateDailyAverage {
name
cost
currency
formattedCost
}
last30DaysDailyAverage {
name
cost
currency
formattedCost
}
}
}
<br />
このクエリは、次のような`JSON`ペイロードを返します:```json
{
"data": {
"queryawsBilling": [
{
"totalCostLast30Days": {
"cost": 7088.87,
"currency": "USD",
"formattedCost": "$7088.87"
},
"totalCostMonthToDate": {
"cost": 7089.28,
"currency": "USD",
"formattedCost": "$7089.28"
},
"monthToDate": [
{
"name": "Amazon Relational Database Service",
"cost": 548.68,
"currency": "USD",
"formattedCost": "$548.68"
},
{
"name": "Amazon Managed Streaming for Apache Kafka",
"cost": 67.49,
"currency": "USD",
"formattedCost": "$67.49"
},
{
"name": "Amazon OpenSearch Service",
"cost": 1155.04,
"currency": "USD",
"formattedCost": "$1155.04"
}
...More Services
],
"last30Days": [
{
"name": "AWS Step Functions",
"cost": 330.20,
"currency": "USD",
"formattedCost": "$330.20"
},
{
"name": "Amazon Elastic Container Service for Kubernetes",
"cost": 194.40,
"currency": "USD",
"formattedCost": "$194.40"
},
{
"name": "AmazonCloudWatch",
"cost": 310.54,
"currency": "USD",
"formattedCost": "$310.54"
}
...More Services
],
"monthToDateDailyAverage": [
{
"name": "Amazon Relational Database Service",
"cost": 54.86,
"currency": "USD",
"formattedCost": "$54.86"
},
{
"name": "Amazon Managed Streaming for Apache Kafka",
"cost": 6.74,
"currency": "USD",
"formattedCost": "$6.74"
},
{
"name": "Amazon OpenSearch Service",
"cost": 115.50,
"currency": "USD",
"formattedCost": "$115.50"
}
...More Services
],
"last30DaysDailyAverage": [
{
"name": "AWS Step Functions",
"cost": 33.01,
"currency": "USD",
"formattedCost": "$33.01"
},
{
"name": "Amazon Elastic Container Service for Kubernetes",
"cost": 19.44,
"currency": "USD",
"formattedCost": "$19.44"
},
{
"name": "AmazonCloudWatch",
"cost": 31.05,
"currency": "USD",
"formattedCost": "$31.05"
}
...More Services
],
}
]
},
"extensions": {
"touched_uids": 212
}
}
あなたのAWSアカウント内の各 EC2 instance とその日次コストを取得する:```graphql
query {
queryawsEc2 {
arn
dailyCost {
cost
currency
formattedCost
}
}
}
<br />
このクエリは、次のような `JSON` ペイロードを返します。以下のすべての例も同様です:```json
{
{
"data": {
"queryawsEc2": [
{
"arn": "arn:aws:ec2:us-east-1:12345678910:instance/i-0c8b3vhfgf8df923f",
"dailyCost": {
"cost": 2.06,
"currency": "USD",
"formattedCost": "$2.06"
}
},
{
"arn": "arn:aws:ec2:us-east-1:12345678910:instance/i-060b3dsfds7sdf62e3",
"dailyCost": {
"cost": 2.06,
"currency": "USD",
"formattedCost": "$2.06"
}
},
...More EC2 Instances
]
},
"extensions": {
"touched_uids": 28
}
}
AWSアカウント内の各 NAT Gateway とその1日あたりのコストを取得します:```graphql
query {
queryawsNatGateway {
arn
dailyCost {
cost
currency
formattedCost
}
}
}
<br />
## AWS CloudWatch の例:
CloudGraph は CloudWatch メトリクスデータを取り込み、特定の AWS サービスと共に保存します。この機能は現在ベータ版であり、EC2 でのみ動作します:```graphql
query {
queryawsEc2 {
arn
cloudWatchMetricData {
lastWeek {
cpuUtilizationAverage
networkInAverage
networkOutAverage
networkPacketsInAverage
networkPacketsOutAverage
statusCheckFailedSum
statusCheckFailedInstanceSum
statusCheckFailedSystemSum
diskReadOpsAverage
diskWriteOpsAverage
diskReadBytesAverage
diskWriteBytesAverage
}
lastMonth {
cpuUtilizationAverage
networkInAverage
networkOutAverage
networkPacketsInAverage
networkPacketsOutAverage
statusCheckFailedSum
statusCheckFailedInstanceSum
statusCheckFailedSystemSum
diskReadOpsAverage
diskWriteOpsAverage
diskReadBytesAverage
diskWriteBytesAverage
}
last6Hours {
cpuUtilizationAverage
networkInAverage
networkOutAverage
networkPacketsInAverage
networkPacketsOutAverage
statusCheckFailedSum
statusCheckFailedInstanceSum
statusCheckFailedSystemSum
diskReadOpsAverage
diskWriteOpsAverage
diskReadBytesAverage
diskWriteBytesAverage
}
last24Hours {
cpuUtilizationAverage
networkInAverage
networkOutAverage
networkPacketsInAverage
networkPacketsOutAverage
statusCheckFailedSum
statusCheckFailedInstanceSum
statusCheckFailedSystemSum
diskReadOpsAverage
diskWriteOpsAverage
diskReadBytesAverage
diskWriteBytesAverage
}
}
}
}
「グラフで考える」という考え方をすると、CloudGraph を使ってほとんど何でもできるようになります。例えば、どの Lamba 関数が VPC に属していないか(つまり VPC ネットワークを活用していないか)を知りたいとします。CloudGraph は VPC の親とその Lambda の子といった関係性を持つすべてのリソースを接続するため、この質問に簡単に答えることができます。VPC が「接続」している Lambda 関数を確認し、それをすべての Lambda 関数のリストと比較するだけです。```graphql query { queryawsVpc { id arn lambda { id arn } } queryawsLambda { id arn } }
<br />
## 制限事項
<br />
現在、CloudGraphとクエリ機能における最大の制限は、子属性に基づくネストされたフィルタリングをサポートしていないことです。つまり、以下のようなことができれば理想的ですが、まだ実現できていません:
<br />```graphql
query {
# This won't work just yet...
queryawsEc2(filter: { ebs: { isBootDisk: true } }) {
id
arn
ebs {
id
arn
}
}
# So you have to do this instead :(
queryawsEc2 {
id
arn
ebs(filter: { isBootDisk: true }) {
id
arn
}
}
}
これは実際にはCloudGraphの制限ではなく、Dgraphでまだ実装する必要がある機能です。こちらのディスカッションスレッドで閲覧・コメントできます
CloudGraphには2つの素晴らしいクエリツールとGraphQLスキーマエクスプローラが付属しています。別のオプションが必要な場合は任意のGraphQLクエリツールを使用でき、公開された/graphqlエンドポイントに接続するだけです。
GraphQL Playgroundは流動的で魅力的なUXを備えており、GraphQLスキーマを迅速かつ簡単にクエリするのに最適です。自動生成されたドキュメントと入力中のオートコンプリート機能が組み込まれています。Playgroundにアクセスするには、initコマンドで優先クエリツールとして選択するか、CGが起動するサーバーの/playgroundにアクセスしてください。
Altairもまた素晴らしいGraphQLクエリツールで、パワーユーザー向けの多数の機能を備えています。クエリのオートコンプリート、フラグメントの動的追加、クエリコレクションのエクスポート/インポートなどが可能です。Altairにアクセスするには、initコマンドで優先クエリツールとして選択するか、CGが起動するサーバーの/altairにアクセスしてください。
GraphQL VoyagerはCGプロバイダのスキーマを探索する素晴らしい方法です。すべてのタイプとクエリを含む双方向チャートを提供します。エンティティや矢印をクリックして接続を発見したり、特定のものを検索したり、スキーマをより深く理解できます。Voyagerにアクセスするには、CGが起動するサーバーの/voyagerにアクセスしてください。
コメント、質問、フィードバックはありますか?Slackワークスペースに参加してください。ご意見をお待ちしています。
CloudGraphへのコントリビューションに興味がある場合は、コントリビューションガイドラインをご確認ください。
CloudGraphはローカルで実行するか、任意のクラウドプロバイダにデプロイできます。クラウドデプロイ用のTerraformモジュールとガイドは近日公開予定です。
3D可視化機能、自動スキャン、数百の追加コンプライアンスチェックが組み込まれた、フルマネージドのSaaS/セルフホスト版CloudGraphに興味がありますか?詳細はAutoCloudをご覧ください。
CloudGraphの実行中にエラーが発生した場合は、コマンドの先頭にCG_DEBUG=5を追加します(例:CG_DEBUG=5 cg scan)。これにより、詳細情報を含む詳細ログが出力されるため、GitHubでIssueを開くか、Slackワークスペースでお知らせいただけます。
CloudGraphの実行時に発生する可能性のあるよくあるエラーは、通常、権限または接続の問題に関連しています。
⚠️ unable to make some connections - このスキャンレポートの警告は、CGが2つのリソース間の接続を試みて失敗した場合に表示されます。CGが公式にサポートしているプロバイダのいずれかを使用してこれが発生した場合は、新しいIssueを作成してください。このエラーの最も一般的な原因は、基盤となるプロバイダのリソース接続ロジックのバグです。
🚫 unable to store data in Dgraph - このスキャンレポートのエラーは、CGがクラウドプロバイダデータをグラフDBに挿入しようとして失敗した場合に表示されます。このエラーが発生したサービスは、GraphQLクエリツールでクエリできなくなります。これは通常、CGがプロバイダSDKの呼び出し時にエラー(多くの場合、認可不足が原因)により、リソースの必要なデータ(arnなど)を取得できない場合に発生します。
Provider {name}@${version} requires cli version {version} but cli version is ${version} - この警告は、CGと使用しようとしているプロバイダのバージョンに互換性がないことを意味します。CGをnpm install -g @cloudgraphdev/cliで更新し、プロバイダモジュールをcg provider updateで更新して、両方を最新バージョンにしてください。また、プロバイダのpacakge.jsonをチェックして、サポートされているCGのバージョンを確認することもできます。
Manager failed to install plugin for {provider} - このエラーは、CGのプラグインマネージャーが使用したいプロバイダモジュールを見つけられない場合に発生します。マネージャーは公開NPMレジストリからプロバイダモジュールを検索します。公式にサポートされているプロバイダの場合は、プロバイダ名CG init awsを渡すだけです。コミュニティサポートのプロバイダの場合は、名前空間もCG init @{providerNamespace}/{provider}として渡す必要があります。
cg help [COMMAND]cg init [PROVIDER]cg launch [PROVIDER]cg load [PROVIDER]cg policy [PROVIDER]cg policy add [PROVIDER]cg policy install [PROVIDER]cg policy list [PROVIDER]cg policy remove [PROVIDER]cg policy update [PROVIDER]cg provider [PROVIDER]cg help [COMMAND]cgのヘルプを表示します。``` USAGE $ cg help [COMMAND] [-n]
ARGUMENTS COMMAND Command to show help for.
FLAGS -n, --nested-commands Include all nested commands in the output.
DESCRIPTION Display help for cg.
_コードを参照: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
## `cg init [PROVIDER]`
プロバイダーの初期設定を行います```
USAGE
$ cg init [PROVIDER] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p <value>]
[-q playground|altair] [-l <value>] [--use-roles] [-P <value>] [-r]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-r, --resources
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Set initial configuration for providers
EXAMPLES
$ cg init
$ cg init aws [Initialize AWS provider]
$ cg init aws -r [Specify resources to crawl]
コードを参照: src/commands/init.ts
cg launch [PROVIDER]データを保存するためにDgraphのインスタンスを起動します``` USAGE $ cg launch [PROVIDER] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Launch an instance of Dgraph to store data
EXAMPLES $ cg launch
_コードを参照: [src/commands/launch.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.1/src/commands/launch.ts)_
## `cg load [PROVIDER]`
CloudGraphデータの特定のバージョンを読み込みます```
USAGE
$ cg load [PROVIDER] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p <value>]
[-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Load a specific version of your CloudGraph data
EXAMPLES
$ cg load [Load data for all providers configured]
$ cg load aws [Load data for AWS]
コードを参照: src/commands/load.ts
cg policy [PROVIDER]ポリシーパックモジュールを管理するコマンドです。詳細は $ cg policy を実行してください。``` USAGE $ cg policy [PROVIDER] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Commands to manage policy pack modules, run $ cg policy for more info.
_コードを参照: [src/commands/policy/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.1/src/commands/policy/index.ts)_
## `cg policy add [PROVIDER]`
新しいポリシーパックを追加```
USAGE
$ cg policy add [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Add new policy packs
ALIASES
$ cg add policy
EXAMPLES
$ cg policy add aws-cis-1.2.0
$ cg policy add [email protected]
cg policy install [PROVIDER]ロックファイルに基づいてポリシーパックをインストールします``` USAGE $ cg policy install [PROVIDER] [--no-save] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-save Set to not alter lock file, just delete plugin --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Install policy packs based on the lock file
ALIASES $ cg install policy
EXAMPLES $ cg policy install
## `cg policy list [PROVIDER]`
現在インストールされているポリシーパックとバージョンを一覧表示します。```
USAGE
$ cg policy list [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
List currently installed policy packs and versions
ALIASES
$ cg ls policy
$ cg list policy
EXAMPLES
$ cg policy list
$ cg policy list aws
cg policy remove [PROVIDER]現在インストールされているポリシーパックを削除します``` USAGE $ cg policy remove [PROVIDER] [--no-save] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-save Set to not alter lock file, just delete plugin --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Remove currently installed policy pack
ALIASES $ cg remove policy $ cg policy remove $ cg policy rm $ cg del policy $ cg rm policy
EXAMPLES $ cg policy remove
$ cg policy remove aws-cis-1.2.0
$ cg policy remove aws-cis-1.2.0 --no-save
## `cg policy update [PROVIDER]`
現在インストールされているポリシーパックを更新します```
USAGE
$ cg policy update [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Update currently installed policy packs
EXAMPLES
$ cg policy update
$ cg policy update aws-cis-1.2.0
$ cg policy update [email protected]
cg provider [PROVIDER]プロバイダモジュールを管理するコマンドです。詳細は $ cg provider を実行してください。``` USAGE $ cg provider [PROVIDER] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Commands to manage provider modules, run $ cg provider for more info.
_コードを参照: [src/commands/provider/index.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.1/src/commands/provider/index.ts)_
## `cg provider add [PROVIDER]`
新しいプロバイダーを追加```
USAGE
$ cg provider add [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Add new providers
ALIASES
$ cg add provider
EXAMPLES
$ cg provider add aws
$ cg provider add [email protected]
cg provider install [PROVIDER]ロックファイルに基づいてプロバイダをインストールします``` USAGE $ cg provider install [PROVIDER] [--no-save] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-save Set to not alter lock file, just delete plugin --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Install providers based on the lock file
ALIASES $ cg install provider
EXAMPLES $ cg provider install
## `cg provider list [PROVIDER]`
現在インストールされているプロバイダーとバージョンを一覧表示します```
USAGE
$ cg provider list [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
List currently installed providers and versions
ALIASES
$ cg ls provider
$ cg list provider
EXAMPLES
$ cg provider list
$ cg provider list aws
cg provider remove [PROVIDER]現在インストールされているプロバイダを削除します``` USAGE $ cg provider remove [PROVIDER] [--no-save] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-save Set to not alter lock file, just delete plugin --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Remove currently installed provider
ALIASES $ cg remove provider $ cg provider remove $ cg provider rm $ cg del provider $ cg rm provider
EXAMPLES $ cg provider remove
$ cg provider remove aws
$ cg provider remove aws --no-save
## `cg provider update [PROVIDER]`
現在インストールされているプロバイダーを更新します```
USAGE
$ cg provider update [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Update currently installed providers
EXAMPLES
$ cg provider update
$ cg provider update aws
$ cg provider update [email protected]
cg scan [PROVIDER]1つ以上のプロバイダデータをスキャンして、Dgraphを介してクエリ可能にします。``` USAGE $ cg scan [PROVIDER] [--dev] [-d ] [-s dgraph] [--directory ] [--no-serve] [-p ] [-q playground|altair] [-l ] [--use-roles] [-P ]
FLAGS -P, --policies= Policy Packs to execute during scan -d, --dgraph= Set where dgraph is running (default localhost:8997) -l, --version-limit= Limit the amount of version folders stored on the filesystem (default 10) -p, --port= Set port to serve query engine -q, --query-engine= Query engine to launch <options: playground|altair> -s, --storage= Select a storage engine to use. Currently only supports Dgraph <options: dgraph> --dev Turn on developer mode --directory= Set the folder where CloudGraph will store data. (default cg) --no-serve Set to not serve a query engine --use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION Scan one or multiple providers data to be queried through Dgraph
EXAMPLES $ cg scan
$ cg scan aws
$ cg scan aws --dgraph http://localhost:1000 [Save data in dgraph running on port 1000]
$ cg scan aws --no-serve [Do not start the query engine]
_コードを参照: [src/commands/scan.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.1/src/commands/scan.ts)_
## `cg serve [PROVIDER]`
CloudGraphデータをクエリするためのGraphQLクエリツールを提供します。```
USAGE
$ cg serve [PROVIDER] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p <value>]
[-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Serve a GraphQL query tool to query your CloudGraph data.
EXAMPLES
$ cg serve
コードを参照: src/commands/serve.ts
cg teardown [PROVIDER]Stops the Dgraph Docker container.``` USAGE $ cg teardown [PROVIDER] [--delete-image]
FLAGS --delete-image Remove dgraph docker image after stopping it
DESCRIPTION Stops the Dgraph Docker container.
EXAMPLES $ cg teardown
$ cg teardown --delete-image
_コードを参照: [src/commands/teardown.ts](https://github.com/cloudgraphdev/cli/blob/v0.25.1/src/commands/teardown.ts)_
## `cg update [PROVIDER]`
現在インストールされているプラグインをアップグレードします。```
USAGE
$ cg update [PROVIDER] [--no-save] [--dev] [-d <value>] [-s dgraph] [--directory <value>] [--no-serve] [-p
<value>] [-q playground|altair] [-l <value>] [--use-roles] [-P <value>]
FLAGS
-P, --policies=<value> Policy Packs to execute during scan
-d, --dgraph=<value> Set where dgraph is running (default localhost:8997)
-l, --version-limit=<value> Limit the amount of version folders stored on the filesystem (default 10)
-p, --port=<value> Set port to serve query engine
-q, --query-engine=<option> Query engine to launch
<options: playground|altair>
-s, --storage=<option> Select a storage engine to use. Currently only supports Dgraph
<options: dgraph>
--dev Turn on developer mode
--directory=<value> Set the folder where CloudGraph will store data. (default cg)
--no-save Set to not alter lock file, just delete plugin
--no-serve Set to not serve a query engine
--use-roles Set to true to use roleARNs instead of profiles for AWS credentials
DESCRIPTION
Upgrade currently installed plugins.
ALIASES
$ cg update
EXAMPLES
$ cg update
コードを参照: src/commands/update.ts