-
Notifications
You must be signed in to change notification settings - Fork 431
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
Policy automations: run script #17129
Comments
@dherder we'll get to this but I think there's an iteration or two before we build it. Currently, the customer can consume the failing policies webhook in Tines and execute a script using the Fleet API, right? I think the first iteration will be sending a webhook per host that includes all the hosts failing policies. I think this simplifies the Tines story. The Tines story becomes this:
|
@noahtalerman would also be good to get a Fleet desktop notification on failed policies similar to #16264 |
@noahtalerman I see the calendar remediation as a separate issue. It works great when you want an end user to do a thing like update an app or perform an OS update. Where it doesn't work so great is if you want the remediation to be "execute a root level script", where if the user is a standard user, they just simply wouldn't be able to do it. |
@dherder I think the first iteration of "Fleet in your calendar" will address this. The high level flow of the feature:
Check out the user story for more details on the flow: #17230 What do you think? Also, we didn't have room for this "Auto remediation of policy failure" story in the current design sprint (4.48). |
@noahtalerman it's still does not solve the problem of 3rd party solution integration that is a blocker for some of our current customers but especially prospective customers. The expectation is that if Fleet has the script server-side & Fleet has a policy to check for a client state or attribute, that it would also have a way of executing the script on a policy failure without 3rd party integration required. Couldn't Fleet just send the policy failure webhook to its own API endpoint for executing a script? Is there a technical concern like load on server due to script execution? Thanks. |
@noahtalerman i presented the option of remediation through 3rd party automation tools today (IT buying scenario) and the feedback was that it would be a blocker to move forward with Fleet. |
@nonpunctual no technical concern that I know of. It's just a matter of priorities/timing. Let's chat about it at feature fest! |
Hey @iansltx when you get the chance, can you please sanity check me here? |
Let's update the guide that "Device remediation" points to (remediation) to link to guides for automatically run scripts and install software: We can frame these features (paid only) as device remediation. |
…) (#23300) - Update guides to reflect use case: automatically run scripts and install software - @noahtalerman: I removed top image from "Automatically run scripts" b/c I think it looked rushed/unexpected - Update "execute" language to "run" and add "manual" language - Clarify when a policy's host counts are reset - Clarify support for policy automations: team v. default (global) v. no team - Update `software.packages` example to best practice: separate file - Inline is supported for backwards compatibility - Remove `policies` and `controls` call outs about "No team." This info is covered in the starter filed in fleetdm/gitops. For an example, see `teams/no-teams.yml` here: https://github.com/fleetdm/fleet-gitops/blob/main/teams/no-team.yml
Hey @iansltx just giving you another ping! Can you please sanity check me here? This is what we have documented in the permissions guide: https://fleetdm.com/guides/role-based-access#user-permissions |
@noahtalerman Re: permissions, as implemented in the API the team-specific policy automations (software install, script run) only require policy write permissions, so they're available to Maintainers as well as Admins and GitOps. My guess is that global automations are only available to admins, and that's what the existing permissions line item is referencing. If we need to tighten down permissions for scripts/software it's doable, and could land in 4.59.0 if needed, but that would be a change from 4.57/4.58, and I'm not sure what the UI enforces here. |
@iansltx ah, ok. I think no need to update the permissions in the code. We just want the documentation to be accurate. UPDATE: @noahtalerman: I opened a draft PR here: #23433 When you get the chance, can you please take a pass at a PR to the permissions guide? https://fleetdm.com/guides/role-based-access |
More context here: #17129 (comment)
@iansltx when you get the chance can you please double check that these^ are the current permissions? I opened up a draft PR to the permissions table here: #23433
@RachelElysia are the permissions mentioned above also enforced in the UI? |
According to the code for the UI: For policy automations dropdown on the policy page, the user has to be a global admin or a team admin, and they need to be viewing a team policy table with at least one team policy shown on the UI table. The UI button for managing automations for policies is hidden for maintainers. Just logged in as a team maintainer and confirmed Policy Automations dropdown is hidden for maintainers. |
So, given the above, we have the API enforcing looser permissions than the UI. Do we want to:
|
Per design review just now, we're taking the second option of the above. Action items (all on me):
Self-assigning this until the above are done. |
Confirmed that global automations are admin-or-above; modifications to global automations hit the global config endpoint, which is controlled by the app_config.write permission, which is gated to admin or gitops. Docs update incoming. |
Going to set this up as a new PR to clean up the approval flow (and since the content of the PR is going to wind up quite different from the original docs change). |
RBAC docs PR is up: #23447 |
#23448 created for matching UI permissions with API permissions. Reassigning this ticket back to @noahtalerman for continuation of confirmation and celebration. |
…and software install (#19551) and script execution (#17129) policy automations (#23447) Co-authored-by: Noah Talerman <[email protected]>
@Patagonia121 @pintomi1989 @pintomi1989 @zayhanlon @ambrusps @phtardif1 @AnthonySnyder8 heads up that this user story was shipped in 4.58 🚀 Here's the guide. (we wait to close the issue until reference docs are updated and guide is published) |
Script triggers rise, |
Goal
"Policy automations: install software" (#19551). Except now we're triggering script runs.
Context
Changes
Product
run_script
parameter topolicies
YAML.Engineering
QA
Risk assessment
Manual testing steps
Migration
Regression avoidance
UI
Policy automation execution
* Known issue: No author on upcoming/past script run activity (fix incoming, pending product confirmation)No-ops
GitOps
Changing existing configuration
Validation errors
Confirmation
The text was updated successfully, but these errors were encountered: