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

Populate the agent action result if there is no matching action handlers #26152

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

aleksmaus
Copy link
Member

What does this PR do?

Acknowledge the agent action and send the action result back if there is no matching action input supported by the agent.
This could happen in two cases:

  1. Action input type is not supported
  2. The policy update didn't reach the agent yet and the user tries to send the action, for example sending osquery query while the osquery was not enabled on the agent yet.

Why is it important?

Without this change the .fleet-actions-results document is not be created for the action with unsupported input type, giving no feedback to the user about the result of the action.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

How to test this PR locally

  1. Create an action document with unsupported action input type, for example "foobar":

Screen Shot 2021-06-04 at 12 29 27 PM

Observe the .fleet-actions-results document with the error
Screen Shot 2021-06-04 at 11 54 55 AM

  1. Create an action document with osquery input type, while osquery manager IS NOT added to the policy.
    Observe the .fleet-actions-results document with the error.

Screen Shot 2021-06-04 at 11 57 51 AM

@aleksmaus aleksmaus added Team:Elastic-Agent Label for the Agent team backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify labels Jun 4, 2021
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 4, 2021
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #26152 opened

  • Start Time: 2021-06-04T18:33:23.914+0000

  • Duration: 82 min 17 sec

  • Commit: 6da6fbf

Test stats 🧪

Test Results
Failed 0
Passed 6908
Skipped 16
Total 6924

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6908
Skipped 16
Total 6924

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Would be nice to have a unit test for this.

@aleksmaus aleksmaus merged commit 472e3a7 into elastic:master Jun 10, 2021
@aleksmaus aleksmaus deleted the fix/action_result branch June 10, 2021 15:56
mergify bot pushed a commit that referenced this pull request Jun 10, 2021
mergify bot pushed a commit that referenced this pull request Jun 10, 2021
aleksmaus added a commit that referenced this pull request Jun 10, 2021
…ers (#26152) (#26244)

(cherry picked from commit 472e3a7)

Co-authored-by: Aleksandr Maus <aleksandr.maus@elastic.co>
aleksmaus added a commit that referenced this pull request Jun 10, 2021
…ers (#26152) (#26243)

(cherry picked from commit 472e3a7)

Co-authored-by: Aleksandr Maus <aleksandr.maus@elastic.co>
mdelapenya added a commit to mdelapenya/beats that referenced this pull request Jun 21, 2021
* master: (26 commits)
  Report total and free CPU for vSphere virtual machines (elastic#26167)
  [filebeat] Add preserve_original_event option to o365audit input (elastic#26273)
  Change xml processor names in script processor to match convention (elastic#26263)
  [Oracle] Fixing default values for paths in config template (elastic#26276)
  Add more ECS fields to logs (elastic#25998)
  [Heartbeat] Fix broken invocation of synth package (elastic#26228)
  rename sqs file name (elastic#26227)
  Populate the agent action result if there is no matching action handlers (elastic#26152)
  Add ISO8601 as supported timestamp type (elastic#25564)
  Move Filebeat azure module to GA (elastic#26168)
  Filebeat azure module pipeline fixes and changes (elastic#26148)
  libbeat: monitor version (elastic#26214)
  Add new parser to filestream input: container (elastic#26115)
  [Metricbeat] Add state_statefulset replicas.ready (elastic#26088)
  Disable test processors system test for windows 10 (elastic#26216)
  Fix startup with failing configuration (elastic#26126)
  Remove 32 bits version of Elastic Agent. (elastic#25708)
  Chane fleetmode detection to ony use management.enabled (elastic#26180)
  Make `filestream` input GA (elastic#26127)
  libbeat/idxmgmt/ilm: fix alias creation (elastic#26146)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants