fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.7k stars 383 forks source link

Add `vscode_extensions` table #13891

Closed lukeheath closed 5 months ago

lukeheath commented 10 months ago

Goal

User story
As a security engineering using Fleet,
I want to know what VS Code extensions are installed on my devices,
so that I can create policies for vulnerable or disallowed extensions.

More info

VS Code is the most common IDE used by software engineers (81% in 2023 Stack Overflow poll)

Much of the reason for its popularity is the thriving extensions ecosystem. These extensions have access to quite a lot, and make their own HTTP calls. There is some concern about how vulnerable these are. There is also concern about AI extensions that may be pushing code files to an LLM, which would violate company policy.

Changes

Product

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

Context

QA

Risk assessment

Manual testing steps

  1. Step 1
  2. Step 2
  3. Step 3

Testing notes

Confirmation

  1. [ ] Engineer (@____): Added comment to user story confirming succesful completion of QA.
  2. [ ] QA (@____): Added comment to user story confirming succesful completion of QA.
lukeheath commented 10 months ago

This has been accepted onto our Q4 roadmap. We hope to ship before the end of the year.

@ksatter @Patagonia121 Would you please notify the customer who initially requested this? Thanks!

Patagonia121 commented 10 months ago

Okay @lukeheath all tagged customers have been notified about this!

lucasmrod commented 9 months ago

Related: https://github.com/osquery/osquery/issues/8138

lucasmrod commented 9 months ago

A query has been merged to the standard library that allows fetching VSCode extensions: https://github.com/fleetdm/fleet/pull/14213

noahtalerman commented 9 months ago

@Patagonia121 to follow up w/ customers about the query: https://fleetdm.com/queries/get-a-list-of-visual-studio-code-extensions

Is macOS only enough? Do they get all the info they need from the query?

lucasmrod commented 9 months ago

FYI: There's a PR in progress in osquery, so we might be getting such table in osquery core soon: https://github.com/osquery/osquery/pull/8150

noahtalerman commented 9 months ago

Nice!

noahtalerman commented 8 months ago

FF (2023-10-12)

Noah: Is this just about adding vscode_extensions to fleetdm.com/tables? If yes, this is a website request.

Noah: If it requires agent work we won't take it.

Luke: A lot of new AI plugins that are pushing this up the priority list. Concerned about company IP. Need the reporting to know it's there.

Noah: WONT

noahtalerman commented 8 months ago

Feature fest:

The osquery PR to add a vscode_extensions table is being reviewed by @zwass: osquery/osquery#8150

Zach, do you think this table will make it into the next version of osquery?

Patagonia121 commented 8 months ago

Correct, this was to add tables to Fleet to find those extensions - we've already built some queries that will help users as a workaround, but hopefully we'll have native tables in Fleet in the future (at least that's what we've heard requested by customers)

zwass commented 8 months ago

Yeah, this should make the next release.

noahtalerman commented 8 months ago

Yeah, this should make the next release.

@zwass great! When is the next osquery release happening?

zwass commented 8 months ago

It's not scheduled, but I'd like to see us get one out before the end of the year.

noahtalerman commented 7 months ago

Hey @zwass @sharon-fdm and @xpkoala heads up, I moved this story to the "In review" column in the Endpoint ops board so we can queue the improvement up for later QA (the osquery PR is currently in review)

@zwass when the osquery PR is merged can you please move this story to the "Awaiting QA" column so that we can test it?

lukeheath commented 6 months ago

@sharon-fdm @noahtalerman @zwass Looks like this merged a couple of weeks ago. Is it ready for QA? https://github.com/osquery/osquery/pull/8150

If so, please add manual testing steps and move to "Ready for QA". Thanks!

zwass commented 6 months ago

Yes, the new osquery release is now deployed to edge so this should be easy to test.

xpkoala commented 6 months ago

Looking good using edge. image

noahtalerman commented 6 months ago

the new osquery release is now deployed to edge so this should be easy to test.

@lukeheath or @zwass have we pushed the new osquery release (that includes this table) to the stable channel?

noahtalerman commented 6 months ago

@zwass do you know if there were doc updates made to the osquery schema as part of adding these tables?

zwass commented 6 months ago

We have not pushed to stable (osquery release has not been declared stable yet). There are always docs for new tables in osquery because they are automatically generated via the table implementation. Those aren't available on the website yet because the release hasn't been marked stable.

noahtalerman commented 6 months ago

C&C: Asked Luke if we pushed the latest osquery to stable: https://github.com/fleetdm/fleet/issues/15215#issuecomment-1899062824

noahtalerman commented 5 months ago

C&C: Let's close after the osquery 5.11 release is pushed to stable.

lucasmrod commented 5 months ago

@noahtalerman osquery 5.11.0 has been pushed to stable. The table is returning results on my device (SELECT * FROM users JOIN vscode_extensions USING (uid);).

noahtalerman commented 5 months ago

. osquery 5.11.0 has been pushed to stable. The table is returning results on my device (SELECT * FROM users JOIN vscode_extensions USING (uid);).

Nice!

@eashaw do you know how to pull this table into fleetdm.com/tables?

It looks like the table is in the osquery schema: https://osquery.io/schema/5.11.0/#vscode_extensions

Do we have to run some GitHub action or script?

eashaw commented 5 months ago

@noahtalerman, we need to update the website's custom configuration to use the new osquery schema version and run the generate-merged-schema script in the website folder. I'll make a PR to do that.

noahtalerman commented 5 months ago

@zwass how do you get results from the vscode_extensions table?

Rachael and I tried this query but no results were returned:

select * from vscode_extensions

Do we need to do some joining against the users table?

lucasmrod commented 5 months ago

Yes, see https://github.com/fleetdm/fleet/issues/13891#issuecomment-1924547487.

noahtalerman commented 5 months ago

Yes, see https://github.com/fleetdm/fleet/issues/13891#issuecomment-1924547487

Wow, how did I miss that? 😅 Thanks Lucas

noahtalerman commented 5 months ago

Hey @eashaw do you know what we have to do to update the tables in the Fleet product? Currently in dogfood (commit ba03140), the vscode_extensions table doesn't appear in the right-side bar and isn't a valid table:

Screenshot 2024-02-13 at 9 13 23 AM

eashaw commented 5 months ago

@noahtalerman The version that is deployed to dogfood does not have the updated osquery_fleet_schema.json file that includes this table.

noahtalerman commented 5 months ago

Hey @eashaw if I'm understanding correctly, the generate-merged-schema script creates the osquery_fleet_schema.json file.

When we release a new version of the Fleet product, it will take the latest osquery_fleet_schema.json.

If that's the case, we would have to run the generate-merged-schema again to make sure the updates to the schema in this PR make it into the core product: #16779

Is that right?

eashaw commented 5 months ago

@noahtalerman That is correct. I made a PR to regenerate the merged schema and fix a minor formatting issue on the vscode_extensions override file here: https://github.com/fleetdm/fleet/pull/16829

noahtalerman commented 5 months ago

@eashaw thanks!

Sounds like regenerating the merged schema is a manual task. If that's right, do we have a ritual so we remember to do this?

I'm thinking it's something we could do every Fleet release (patch and minor) so that any updates to the schema make it into the product ASAP.

If you agree, I can take that to Luke (release DRI)

eashaw commented 5 months ago

@noahtalerman I have a ritual to update the merged schema every three weeks (This typically happens on the 2nd Tuesday of a sprint). I'll change the ritual frequency to weekly and will make sure it is documented in the handbook. (https://github.com/fleetdm/fleet/pull/16852)

fleet-release commented 5 months ago

Extension table blooms, Security clarity looms, No policy dooms.

rachaelshaw commented 5 months ago

@Patagonia121 this was shipped and is now documented on the website