Git Product home page Git Product logo

turbot / steampipe-plugin-microsoft365 Goto Github PK

View Code? Open in Web Editor NEW
8.0 9.0 4.0 355 KB

Use SQL to instantly query calendars, contacts, drives, mailboxes and more from Microsoft 365. Open source CLI. No DB required.

Home Page: https://hub.steampipe.io/plugins/turbot/microsoft365

License: Apache License 2.0

Makefile 0.13% PLSQL 0.94% Go 98.93%
msgraph office365 postgresql postgresql-fdw sql steampipe steampipe-plugin microsoft365 msgraph-api hacktoberfest

steampipe-plugin-microsoft365's Introduction

image

Microsoft 365 Plugin for Steampipe

Use SQL to query calendars, contacts, drives, mailboxes and more from Microsoft 365.

Quick start

Install the plugin with Steampipe:

steampipe plugin install microsoft365

Run a query:

select
  subject,
  online_meeting_url,
  start_time,
  end_time
from
  microsoft365_calendar_event
where
  user_id = '[email protected]'
  and start_time >= current_date
  and end_time <= (current_date + interval '1 day');

Engines

This plugin is available for the following engines:

Engine Description
Steampipe 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 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 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 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 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:

Clone:

git clone https://github.com/turbot/steampipe-plugin-microsoft365.git
cd steampipe-plugin-microsoft365

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
vi ~/.steampipe/config/microsoft365.spc

Try it!

steampipe query
> .inspect microsoft365

Further reading:

Open Source & Contributing

This repository is published under the Apache 2.0 (source code) and CC BY-NC-ND (docs) licenses. Please see our code of conduct. We look forward to collaborating with you!

Steampipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. 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.

Get Involved

Join #steampipe on Slack →

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

steampipe-plugin-microsoft365's People

Contributors

cbruno10 avatar dependabot[bot] avatar khushboo9024 avatar madhushreeray30 avatar misraved avatar subhajit97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steampipe-plugin-microsoft365's Issues

Validate the `Resource Not Found` error handling

Describe the bug
Some of the tables (i.e. drive, calendar, contact) are failing if the queried resource is not present.

Steampipe version (steampipe -v)
Example: v0.17.4

Plugin version (steampipe plugin list)
Example: v0.0.1

To reproduce
Query any resources which is not present.

Expected behavior
Query should return empty row, if the resource is not present.

Additional context
Add any other context about the problem here.

delegated permission its not working

For my microsoft365_via_sp_secret: I want to my application to access only the data of the signed-in user and not allow access to the data of other users, I need to use delegated permissions instead of application permissions. Application permissions typically grant access to all users in the organization, while delegated permissions are tied to the signed-in user's content.
when I use deligated permission it's not working, when I use application permissions, it's worked for me. Is there any other solution for this? deligated permission is supported or not?????

Show better error message when the authentication is invalid

Is your feature request related to a problem? Please describe.
While using tenant/client_secret authentication mechanism, if you give a wrong client_secret in the config file and then try to run queries, you get a vague error message that does not describe what the error is.

Eg:

> select
  name,
  id,
  drive_type,
  created_date_time,
  web_url
from
  microsoft365_drive
where
  user_id = '[email protected]';

Error: null (SQLSTATE HV000)

+------+----+------------+-------------------+---------+
| name | id | drive_type | created_date_time | web_url |
+------+----+------------+-------------------+---------+
+------+----+------------+-------------------+---------+

Describe the solution you'd like
If authentication fails, I'd like to see that error message show up when I run the queries.

Describe alternatives you've considered
None.

Additional context
Versions:

Plugin version: v0.0.1
Steampipe CLI: v0.17.4

Add SharePoint Online (SPO) specific tables for Site, Lists, and Drives (document libraries)

Background: https://www.reddit.com/r/Office365/comments/y3vfx7/use_sql_to_query_microsoft_365_drive_files_mail/
Id like to see permissions lists and their contents Libraries and their contents (file names,size,id,created and modified by and dates) List of Sites

Graph API Docs;
https://learn.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0
https://github.com/microsoftgraph/msgraph-sdk-go supports Sites and Lists, and additional Drive information that could be considered below.

For Sites
https://learn.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-1.0

Also for the request to look are permission lists -- these are for the DriveItem but in the Sites resource: https://learn.microsoft.com/en-us/graph/api/resources/permission?view=graph-rest-1.0#:~:text=permission%20resource%20type Not clear on the best way to represent it on the site table, drive resource, or its own table.

For Lists
https://learn.microsoft.com/en-us/graph/api/resources/list?view=graph-rest-1.0

For Drives:
Believe https://hub.steampipe.io/plugins/turbot/microsoft365/tables/microsoft365_drive captures Drives information but can be extended for more relationship data:
The table already supports the documentType column would provide whether its a documentLibrary value. Maybe helpful to add the column SharepointIds for additional relationship information: https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0#:~:text=%20%22sharepointids%22%3A%20%7B%22%40odata.type%22%3A%20%22microsoft.graph.sharepointids%22%7D%2C%20

Note: On the Site table there will be relationships for the Drive used as well so you can get both angles of the relationship.

Add limit handling and `Top` input parameter to any tables missing them

Is your feature request related to a problem? Please describe.
Tables should handle limit and adjust page size as an optimization. All tables should also set the largest page size by default to reduce the number of requests.

Describe the solution you'd like
See above.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.