From 88744cb0e665d2bb05ac467b186d98585ce80960 Mon Sep 17 00:00:00 2001 From: Ved misra <47312748+misraved@users.noreply.github.com> Date: Tue, 12 Dec 2023 22:51:38 +0530 Subject: [PATCH] Improve table docs (#33) Co-authored-by: Madhushree Ray --- .github/workflows/steampipe-anywhere.yml | 12 + README.md | 24 +- docs/LICENSE | 402 +++++++++++++++++++++++ docs/index.md | 6 +- docs/tables/virustotal_domain.md | 30 +- docs/tables/virustotal_file.md | 81 ++++- docs/tables/virustotal_ip.md | 49 ++- docs/tables/virustotal_search.md | 33 +- docs/tables/virustotal_url.md | 63 +++- 9 files changed, 654 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/steampipe-anywhere.yml create mode 100644 docs/LICENSE diff --git a/.github/workflows/steampipe-anywhere.yml b/.github/workflows/steampipe-anywhere.yml new file mode 100644 index 0000000..05092d6 --- /dev/null +++ b/.github/workflows/steampipe-anywhere.yml @@ -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 diff --git a/README.md b/README.md index 8bf5f34..1e528a4 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,18 @@ where path = '/full/path/to/file' ``` +## 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: @@ -68,11 +80,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-virustotal/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) - [VirusTotal Plugin](https://github.com/turbot/steampipe-plugin-virustotal/labels/help%20wanted) diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 0000000..236ac28 --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,402 @@ +Attribution-NonCommercial-NoDerivatives 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 +International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-NoDerivatives 4.0 International Public +License ("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + c. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + d. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + e. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + f. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + g. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + h. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce and reproduce, but not Share, Adapted Material + for NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material, You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + For the avoidance of doubt, You do not have permission under + this Public License to Share Adapted Material. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only and provided You do not Share Adapted Material; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 94dc523..9c8ed34 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,13 +8,14 @@ short_name: "virustotal" description: "Steampipe plugin to query file, domain, URL and IP scanning results from VirusTotal." og_description: "Query VirusTotal with SQL! Open source CLI. No DB required." og_image: "/images/plugins/turbot/virustotal-social-graphic.png" +engines: ["steampipe", "sqlite", "postgres", "export"] --- # VirusTotal + Steampipe [VirusTotal](https://virustotal.com) is an Internet security, file and URL analyzer. -[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. Get VirusTotal scan data for a local file: @@ -70,7 +71,4 @@ connection "virustotal" { - `api_key` - Your VirusTotal API key. -## Get involved -- Open source: https://github.com/turbot/steampipe-plugin-virustotal -- Community: [Join #steampipe on Slack →](https://turbot.com/community/join) diff --git a/docs/tables/virustotal_domain.md b/docs/tables/virustotal_domain.md index f4f8223..1314022 100644 --- a/docs/tables/virustotal_domain.md +++ b/docs/tables/virustotal_domain.md @@ -1,18 +1,38 @@ -# Table: virustotal_domain +--- +title: "Steampipe Table: virustotal_domain - Query VirusTotal Domain Reports using SQL" +description: "Allows users to query Domain Reports in VirusTotal, specifically providing detailed information about a domain, including the detection of potentially malicious activities." +--- -Get information about a domain including WHOIS, popularity, DNS and more. +# Table: virustotal_domain - Query VirusTotal Domain Reports using SQL -Note: An `id` (registered domain name) must be provided in all queries to this table. +VirusTotal is a free online service that analyzes files and URLs for viruses, worms, trojans and other kinds of malicious content. It aggregates many antivirus products and online scan engines to check for viruses that the user's own antivirus solution may have missed, or to verify against any false positives. Domain Reports in VirusTotal provide detailed information about a domain, including the detection of potentially malicious activities. + +## Table Usage Guide + +The `virustotal_domain` table provides insights into Domain Reports within VirusTotal. As a cybersecurity analyst, explore domain-specific details through this table, including detections, resolutions, and subdomains. Utilize it to uncover information about domains, such as those linked with malicious activities, the resolved IPs, and the detection of potentially harmful subdomains. + +**Important Notes** +- You must specify the `id` (registered domain name) in the `where` clause to query this table. ## Examples ### Get domain information +Explore the detailed information associated with a specific domain to understand its characteristics and potential security risks. This can be particularly useful for cybersecurity analysis and threat detection. -```sql +```sql+postgres select * from virustotal_domain where - id = 'steampipe.io' + id = 'steampipe.io'; ``` + +```sql+sqlite +select + * +from + virustotal_domain +where + id = 'steampipe.io'; +``` \ No newline at end of file diff --git a/docs/tables/virustotal_file.md b/docs/tables/virustotal_file.md index 4f50c15..5708acd 100644 --- a/docs/tables/virustotal_file.md +++ b/docs/tables/virustotal_file.md @@ -1,42 +1,73 @@ -# Table: virustotal_file +--- +title: "Steampipe Table: virustotal_file - Query VirusTotal File Reports using SQL" +description: "Allows users to query VirusTotal File Reports, specifically the detailed file scan reports, providing insights into file's safety information." +--- -Get information about a file including scan results, names often used for the file and more. +# Table: virustotal_file - Query VirusTotal File Reports using SQL -Note: A `path` (local path to a file) or `id` (hash of the file) must be provided in all queries to this table. +VirusTotal is a free service that analyzes suspicious files and URLs to detect types of malware, including viruses, worms, and trojans. It aggregates numerous antivirus products and online scan engines to check for viruses that the user's own antivirus solution may have missed, or to verify against any false positives. VirusTotal inspects items with over 70 antivirus scanners and URL/domain blacklisting services. + +## Table Usage Guide + +The `virustotal_file` table provides insights into file reports within VirusTotal. As a security analyst, explore file-specific details through this table, including scan results, positives found, and scan date. Utilize it to uncover information about files, such as those with potential threats, the detection ratio, and the verification of scan results. + +**Important Notes** +- You must specify either the `path` (ocal path to a file) or the `id` (hash of the file) in the `where` clause to query this table. ## Examples ### Get VirusTotal information for a local file - +Determine the safety of a local file by analyzing it with VirusTotal. This is useful for verifying downloaded files and avoiding potential security threats. Uses a local file to generate the hash to query VirusTotal for information about the file. The file will not be uploaded for scanning, but just used to generate the hash to search existing results. -```sql + +```sql+postgres +select + * +from + virustotal_file +where + path = '/Users/michael/Downloads/terraform_1.0.1_darwin_amd64.zip'; +``` + +```sql+sqlite select * from virustotal_file where - path = '/Users/michael/Downloads/terraform_1.0.1_darwin_amd64.zip' + path = '/Users/michael/Downloads/terraform_1.0.1_darwin_amd64.zip'; ``` ### Get file information by ID +This query allows you to pinpoint the specific details of a file using its unique identifier. It is particularly useful when you need to analyze a file's properties or assess its integrity in a security-focused scenario. -```sql +```sql+postgres select * from virustotal_file where - id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' + id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85'; +``` + +```sql+sqlite +select + * +from + virustotal_file +where + id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85'; ``` ### List alternate names for a file +This query helps you uncover the alternate names associated with a specific file, which can be useful in identifying potential risks or anomalies associated with that file. This can aid in cybersecurity efforts, ensuring that files are properly identified and assessed for potential threats. -```sql +```sql+postgres select jsonb_array_elements_text(names) as name from @@ -44,12 +75,25 @@ from where id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' order by - name + name; +``` + +```sql+sqlite +select + json_each.value as name +from + virustotal_file, + json_each(names) +where + id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' +order by + name; ``` ### Find all scanner results by engine +Explore the variety of scanner results associated with a specific file. This query is useful in identifying and understanding the different categories of analysis results generated by various engines, aiding in comprehensive security assessment. -```sql +```sql+postgres select analysis.key as engine, analysis.value ->> 'category' as result @@ -59,5 +103,18 @@ from where id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' order by - engine + engine; ``` + +```sql+sqlite +select + analysis.key as engine, + json_extract(analysis.value, '$.category') as result +from + virustotal.virustotal_file, + json_each(last_analysis_results) as analysis +where + id = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' +order by + engine; +``` \ No newline at end of file diff --git a/docs/tables/virustotal_ip.md b/docs/tables/virustotal_ip.md index 695ebc0..dbe89af 100644 --- a/docs/tables/virustotal_ip.md +++ b/docs/tables/virustotal_ip.md @@ -1,25 +1,46 @@ -# Table: virustotal_ip +--- +title: "Steampipe Table: virustotal_ip - Query VirusTotal IP Addresses using SQL" +description: "Allows users to query IP Addresses in VirusTotal, providing insights into the detection of URLs, downloadable files, and additional information related to IP addresses." +--- -Get information about an IP including WHOIS, popularity, DNS and more. +# Table: virustotal_ip - Query VirusTotal IP Addresses using SQL -Note: An `id` (IP address) must be provided in all queries to this table. +VirusTotal is a service that analyzes files and URLs for viruses, worms, trojans, and other kinds of malicious content. It aggregates many antivirus products and online scan engines to check for viruses that the user's own antivirus may have missed. VirusTotal also provides information regarding IP addresses, including the detection of URLs, downloadable files, and additional data. + +## Table Usage Guide + +The `virustotal_ip` table provides insights into IP addresses within VirusTotal. As a cybersecurity analyst, explore IP-specific details through this table, including detections of URLs, downloadable files, and additional information. Utilize it to uncover information about IP addresses, such as those associated with malicious activities, and to verify the safety of certain IPs. + +**Important Notes** +- You must specify the `id` (IP address) in the `where` clause to query this table. ## Examples ### Get IP information +Discover the details of a specific IP address to understand its associated risks and behavior. This can be particularly useful in cybersecurity investigations or network monitoring. -```sql +```sql+postgres select * from virustotal_ip where - id = '76.76.21.21' + id = '76.76.21.21'; +``` + +```sql+sqlite +select + * +from + virustotal_ip +where + id = '76.76.21.21'; ``` ### Find all scanner results where result was not clean +Explore scanner results that identified potential threats or issues, providing a valuable tool for cyber security assessments and threat detection. -```sql +```sql+postgres select analysis.key as scanner, analysis.value ->> 'result' as result @@ -30,5 +51,19 @@ where id = '76.76.21.21' and analysis.value ->> 'result' != 'clean' order by - scanner + scanner; ``` + +```sql+sqlite +select + analysis.key as scanner, + json_extract(analysis.value, '$.result') as result +from + virustotal.virustotal_ip, + json_each(last_analysis_results) as analysis +where + id = '76.76.21.21' + and json_extract(analysis.value, '$.result') != 'clean' +order by + scanner; +``` \ No newline at end of file diff --git a/docs/tables/virustotal_search.md b/docs/tables/virustotal_search.md index ec66ede..3c868a7 100644 --- a/docs/tables/virustotal_search.md +++ b/docs/tables/virustotal_search.md @@ -1,24 +1,45 @@ -# Table: virustotal_search +--- +title: "Steampipe Table: virustotal_search - Query VirusTotal Search Results using SQL" +description: "Allows users to query VirusTotal search results. This table provides a comprehensive view of the antivirus scan results, website scanning, and URL/domain blacklisting." +--- -Perform simple searches for VirusTotal. +# Table: virustotal_search - Query VirusTotal Search Results using SQL -Note: A search `query` must be provided in all queries to this table. +VirusTotal is a service that analyzes files and URLs for viruses, worms, trojans, and other kinds of malicious content. It aggregates information from many antivirus and URL scanners to provide a comprehensive view of antivirus scan results, website scanning, and URL/domain blacklisting. This service is useful for detecting malicious content and understanding the security landscape. + +## Table Usage Guide + +The `virustotal_search` table provides insights into the search results from VirusTotal. As a security analyst, explore the details of antivirus scan results, website scanning, and URL/domain blacklisting through this table. Utilize it to uncover information about potential security threats, such as malware, trojans, and other malicious content. + +**Important Notes** +- You must specify the `query` in the `where` clause to query this table. ## Examples ### Simple searches (free tier) - +Explore various internet entities like websites, IP addresses, and file hashes for potential security threats by cross-referencing them with the VirusTotal database. This is useful for identifying potential risks associated with these entities, helping to maintain cybersecurity. The free tier only supports simple search terms for hashes and IDs. This example combines simple searches of different types into a single consistent result set. -```sql + +```sql+postgres select * from virustotal_search where query = 'github.com' union select * from virustotal_search where query = 'https://turbot.com' union select * from virustotal_search where query = '76.76.21.21' union -select * from virustotal_search where query = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85' +select * from virustotal_search where query = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85'; ``` + +```sql+sqlite +select * from virustotal_search where query = 'github.com' +union +select * from virustotal_search where query = 'https://turbot.com' +union +select * from virustotal_search where query = '76.76.21.21' +union +select * from virustotal_search where query = '8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85'; +``` \ No newline at end of file diff --git a/docs/tables/virustotal_url.md b/docs/tables/virustotal_url.md index 67e8ad9..427f88e 100644 --- a/docs/tables/virustotal_url.md +++ b/docs/tables/virustotal_url.md @@ -1,36 +1,67 @@ -# Table: virustotal_url +--- +title: "Steampipe Table: virustotal_url - Query VirusTotal URL Reports using SQL" +description: "Allows users to query URL reports in VirusTotal, providing insights into URL scanning and detection data." +--- -Get information about an URL including WHOIS, popularity, DNS and more. +# Table: virustotal_url - Query VirusTotal URL Reports using SQL -Note: A `url` (URL address) or `id` (hash of the URL) must be provided in all queries to this table. +VirusTotal is a service that analyzes files and URLs for viruses, worms, trojans, and other kinds of malicious content. It uses an array of antivirus engines and website scanners, as well as a comprehensive dataset that is updated in real time. VirusTotal's URL reports provide detailed information about the URLs analyzed, including the scan results, detection ratios, and the time of the last analysis. + +## Table Usage Guide + +The `virustotal_url` table provides insights into URL reports within VirusTotal. As a cybersecurity analyst, explore URL-specific details through this table, including scan dates, detection ratios, and scan results. Utilize it to uncover information about URLs, such as their safety status, the details of the scans performed on them, and the detection ratios associated with each URL. + +**Important Notes** +- You must specify either the `url` (URL address) or the `id` (hash of the URL) in the `where` clause to query this table. ## Examples ### Get URL information +Discover the segments that are associated with a specific website by analyzing its URL. This can be beneficial for identifying potential security risks or understanding the website's online footprint. -```sql +```sql+postgres select * from virustotal_url where - url = 'https://github.com' + url = 'https://github.com'; +``` + +```sql+sqlite +select + * +from + virustotal_url +where + url = 'https://github.com'; ``` ### Get URL information by ID +Discover the specifics of a particular URL by using its unique ID. This can be particularly useful when investigating potentially harmful or suspicious URLs for cybersecurity purposes. + +```sql+postgres +select + * +from + virustotal_url +where + id = '09a8b930c8b79e7c313e5e741e1d59c39ae91bc1f10cdefa68b47bf77519be57'; +``` -```sql +```sql+sqlite select * from virustotal_url where - id = '09a8b930c8b79e7c313e5e741e1d59c39ae91bc1f10cdefa68b47bf77519be57' + id = '09a8b930c8b79e7c313e5e741e1d59c39ae91bc1f10cdefa68b47bf77519be57'; ``` ### Find all scanner results where result was not clean +Identify instances where the scan results were not clean for a specific URL. This could be used to assess the security and safety of the website, highlighting any potential threats or issues. -```sql +```sql+postgres select analysis.key as scanner, analysis.value ->> 'result' as result @@ -41,5 +72,19 @@ where url = 'https://github.com' and analysis.value ->> 'result' != 'clean' order by - scanner + scanner; ``` + +```sql+sqlite +select + analysis.key as scanner, + json_extract(analysis.value, '$.result') as result +from + virustotal.virustotal_url, + json_each(last_analysis_results) as analysis +where + url = 'https://github.com' + and json_extract(analysis.value, '$.result') != 'clean' +order by + scanner; +``` \ No newline at end of file