Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create policies automatically for Fleet-maintained apps #22077

Closed
62 of 67 tasks
noahtalerman opened this issue Sep 13, 2024 · 12 comments
Closed
62 of 67 tasks

Create policies automatically for Fleet-maintained apps #22077

noahtalerman opened this issue Sep 13, 2024 · 12 comments
Assignees
Labels
customer-preston #g-mdm MDM product group :product Product Design department (shows up on 🦢 Drafting board) story A user story defining an entire feature
Milestone

Comments

@noahtalerman
Copy link
Member

noahtalerman commented Sep 13, 2024

Goal

User story
As an IT admin,
I want to install a Fleet-maintained app on all of my hosts that don't already have it
so that I can deploy a new productivity app to all my hosts w/o having to write a policy.

Objective

Context

Changes

Product

  • Reference documentation changes: Docs changes covered by API changes below.
  • UI changes: Figma link
  • CLI (fleetctl) usage changes: No changes.
  • YAML changes: No changes.
  • REST API changes: [API design] Create policies automatically for Fleet-maintained apps #24413
  • Fleet's agent (fleetd) changes: No changes.
  • Activity changes: No changes.
  • Permissions changes: No changes. Software add/edit/remove permissions are already specified in the permissions guide.
  • Changes to paid features or tiers: Available for Fleet Premium.
  • Other reference documentation changes: No changes.
  • Once shipped, requester has been notified
  • Once shipped, dogfooding issue has been filed
    • Issue: fleetdm/confidential#9214

Engineering

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

QA

Risk assessment

  • Requires load testing: no
  • Risk level: Low / High Low

Manual testing steps

Design/UI

  • When adding FMA, Manual and Automatic install options are available. Tooltip for "missing this software" is shown.

  • Self-service can be selected for either install method, there is a tooltip on "Self-service"

  • Advanced options are available and editable, save on "Add software"

  • When "Add software" is clicked, Add software modal appears with spinner.

  • !!Existing Issue!! #23096 For upload failures, error message is displayed and policy is not created

  • For successful uploads, user is redirected to /software/titles with the "Available for install" filter applied, and success message is shown

  • For successful uploads but policy fails to be created, an error message is displayed

  • On /software/titles page, correct Manual, Automatic, Automatic/Self Service, Manual/Self Service icons appear based on install method

Screenshot 2024-12-06 at 8.48.34 AM.png

  • On /software/titles/:id page for FMA apps that were added with an automatic policy, "Automatic install" badge is shown.
  • Hovering over badge gives instructions to click on it to see all policies that are tied to the software title
  • Clicking the policy name takes you to the policy
  • Policy displays correctly on /policies/ page. "---" appears under "Yes" and "No" results columns until computers have run the policy.
  • Policy appears in "My Device" page for host in the team for which the policy was created.
  • Learn more link redirects to the correct page

Functional

  • Policy is automatically created when FMA software is added and "Automatic" install method is selected
  • Policy runs on host and correctly detects whether or not software is installed
  • Software install is triggered when policy fails, software installs on host
  • Once the software has been installed, policy passes and software is not re-installed
  • If software was already installed, policy passes and software is not re-installed
  • Deleting the software on the host and re-running the policy triggers a new install, software is installed successfully

Role Based Access
Global Admin

  1. Add/Edit/Delete FMA software
  • Policy is automatically created when "Automatic" is selected
  • Software may be edited after adding
  • Policy may be edited after it is automatically added
  • Software can not be deleted until Policy is deleted first

Global Maintainer

  1. Add/Edit/Delete FMA software

Global Observer +

  1. View
  • FMA software that has been added to any team
  • FMA policy that was created on any team
  • SHOULD be able to run policy on any team

Global Observer

  1. View
  • FMA software that has been added to any team
  • FMA policy that was created on any team
  • Should NOT be able to run Policy on any team

Team Admin
Add/Edit/Delete FMA software for the team(s) they are assigned to

  • Policy is automatically created when "Automatic" is selected
  • Software may be edited after adding
  • Policy may be edited after it is automatically added
  • Software can not be deleted until Policy is deleted first
  • Should NOT be able to add/edit/delete software or policies not specific to their team

Team Maintainer
Add/Edit/Delete FMA software for the team(s) they are assigned to

  • Policy is automatically created when "Automatic" is selected
  • Software may be edited after adding
  • Policy may be edited after it is automatically added
  • Software can not be deleted until Policy is deleted first
  • Should NOT be able to add/edit/delete software or policies not specific to their team

Team Observer +

  1. View
  • FMA software that has been added to the team(s) they are assigned to
  • FMA policy that was created on the team(s) they are assigned to
  • SHOULD be able to run policy on the team(s) they are assigned to

Team Observer

  1. View
  • FMA software that has been added to the team(s) they are assigned to
  • FMA policy that was created on the team(s) they are assigned to
  • SHOULD NOT be able to run policy on the team(s) they are assigned to

Testing notes

Confirmation

  1. Engineer (@____): Added comment to user story confirming successful completion of QA.
  2. QA (@jmwatts & @PezHub): Added comment to user story confirming successful completion of QA.
@noahtalerman noahtalerman added story A user story defining an entire feature :product Product Design department (shows up on 🦢 Drafting board) labels Sep 13, 2024
@noahtalerman noahtalerman changed the title Set a Fleet-maintained app to always be on latest Set minimum version and automatically install Fleet-maintained app Sep 20, 2024
@noahtalerman noahtalerman changed the title Set minimum version and automatically install Fleet-maintained app Automatically install latest version of Fleet-maintained app Sep 20, 2024
@noahtalerman noahtalerman changed the title Automatically install latest version of Fleet-maintained app Fleet-maintained apps: automatically install latest version Sep 20, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatically install latest version Fleet-maintained apps: automatic install latest version Sep 20, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install latest version Fleet-maintained apps: automatic install and update Sep 30, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install and update Fleet-maintained apps: automatic install Sep 30, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install Fleet-maintained apps: automatic install and update Sep 30, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install and update Fleet-maintained apps: automatic install Sep 30, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install Fleet-maintained apps: automatic install and update Sep 30, 2024
@noahtalerman noahtalerman changed the title Fleet-maintained apps: automatic install and update Fleet-maintained apps: automatic install Sep 30, 2024
@noahtalerman noahtalerman added ~feature fest Will be reviewed at next Feature Fest #g-mdm MDM product group labels Oct 3, 2024
@noahtalerman noahtalerman added Epic DO NOT USE. Auto-created by ZenHub, cannot be disabled. and removed Epic DO NOT USE. Auto-created by ZenHub, cannot be disabled. ~feature fest Will be reviewed at next Feature Fest labels Oct 4, 2024
@noahtalerman
Copy link
Member Author

Hey @georgekarrv just giving you a reminder that this story is ready to spec. Please let us know if we can help get this ready for estimation.

cc @marko-lisica

@noahtalerman
Copy link
Member Author

noahtalerman commented Oct 11, 2024

Hey @georgekarrv just giving you a ping! as a reminder that this story is ready to spec. Please let us know if we can help get this ready for estimation.

Note that the API design PR is a draft but it's ready for review. It's in draft b/c it's helping us remember that we want to wait for the 4.58 reference docs to merge it into main before we merge this PR into the 4.59 on the reference docs.

cc @marko-lisica

@noahtalerman
Copy link
Member Author

Hey @georgekarrv, just giving you another reminder that this story is ready for specs. Please ping @marko-lisica if we can help get this ready for estimation.

@georgekarrv georgekarrv added this to the 4.60.0-tentative milestone Oct 28, 2024
@marko-lisica
Copy link
Member

Hey @ghernandez345, I did small copy tweak here in case you started working on this.

@marko-lisica
Copy link
Member

marko-lisica commented Nov 14, 2024

Hey @georgekarrv, I tried this query and it worked, it triggered installation on my host:

SELECT 1 FROM apps WHERE bundle_identifier = '<SOFTWARE_BUNDLE_IDENTIFIER>';

We already have bundle_identifier for each Fleet-maintained app in this file, but you mentioned yesterday that frontend don't have access to it.

I think we need a way for the frontend to know bundle_identifier, probably include it in Get Fleet-maintained app response.

@PezHub I also added note in QA section in the description that we should make sure that this query template works (triggers install) for each Fleet-maintained app.

@georgekarrv georgekarrv modified the milestones: 4.60.0, 4.61.0-tentative Nov 21, 2024
jahzielv added a commit that referenced this issue Dec 4, 2024
…4298)

> Related issue: #22077

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
@georgekarrv georgekarrv added :demo and removed :demo labels Dec 6, 2024
@jmwatts
Copy link
Member

jmwatts commented Dec 6, 2024

@noahtalerman @marko-lisica
Screenshot 2024-12-06 at 2.48.12 PM.png

Suggestion for readability improvement. The error message currently says:

"Couldn't add automatic install policy. Software is successfully added. To try again delete software and add it again."

Could we change this to say something like:
"Couldn't add automatic install policy. Software is successfully added. To retry, delete software and add it again."
or
"Software added successfully, but automatic install policy couldn't be created. To retry, delete and re-add software."

@marko-lisica
Copy link
Member

marko-lisica commented Dec 9, 2024

@jmwatts Thanks for the proposal. I like the first one:
"Couldn't add automatic install policy. Software is successfully added. To retry, delete software and add it again."
It's shorter and reads better.

I'll update Figma to match this. @jahzielv If we can make this change now would be great. Thanks!

@jahzielv jahzielv mentioned this issue Dec 9, 2024
1 task
@PezHub
Copy link
Contributor

PezHub commented Dec 9, 2024

QA Notes:

Paired with @jmwatts to ensure all acceptance criteria was met and automatic policies for fleet-maintained apps behaved as expected. Additional results were tracked here.

lukeheath pushed a commit that referenced this issue Dec 17, 2024
Release article for Fleet 4.61.0

Highlighted user stories:
- #22077
- #22078
- #22075
@lukeheath lukeheath added :product Product Design department (shows up on 🦢 Drafting board) and removed :release Ready to write code. Scheduled in a release. See "Making changes" in handbook. labels Dec 17, 2024
@noahtalerman
Copy link
Member Author

Hey @marko-lisica just giving you a ping! as a reminder to prioritize the remaining TODOs for this story in confirm and celebrate.

@fleet-release
Copy link
Contributor

Apps deploy, hosts sync,
Fleet maintains, admin rests,
Tech harmony sings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-preston #g-mdm MDM product group :product Product Design department (shows up on 🦢 Drafting board) story A user story defining an entire feature
Development

No branches or pull requests

9 participants