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

Merge agent to master #16494

Merged
merged 116 commits into from
Mar 6, 2020
Merged

Merge agent to master #16494

merged 116 commits into from
Mar 6, 2020

Conversation

ph
Copy link
Contributor

@ph ph commented Feb 21, 2020

What does this PR do?

This PR move the development of the Elastic Agent inside the master branch, the Agent can be configured locally or using the ingest manager in Kibana. The Agent will take care of starting or stopping the processes depending on the configuration needs.

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

michalpristas and others added 30 commits October 25, 2019 09:43
Co-authored-by: Pier-Hugues Pellerin <[email protected]>
Co-authored-by: Michal Pristas <[email protected]>
Co-authored-by: Pier-Hugues Pellerin <[email protected]>
Co-authored-by: Michal Pristas <[email protected]>
* Refactor: Rename pipeline into stream

To align the code base with the multiple output strategy we will rename
the pipeline concept into the streams.

See elastic#14445
)

This PR updates the enroll command to use an Elasticsearch token instead
of custom token for enrollment.

See elastic/kibana#49639 for details
* Change the Authentication mechanism for fleet.

Fleet changed how we should authenticate with them instead of using an
api key and a special header fields we now use the normal "Authorization" key and with this format:

```
Authorization: ApiKey {accessApiKey}
```

See #49639 for details
Add support for multiples outputs and link it to the streams.
…#14871)

* Implements the require "Checkin" calls

This PR implements the required structs and calls to retrieve the
configuration from Fleet. This is step one before refactoring the
Reporter to split the pushing event and fetching of configuration.
…stic#14945)

* Fakewebapi simulare a Fleet API endpoint for testing the checkin

This PR creates a crude fake webserver to allow a beat agent to enroll
and receives action from a remote host.
*  Feature: Allow to persist AccessToken and other connection data on disk
    This PR add a few things

    - It takes the keystore encryption implementation and create an
      io.Reader and io.Writer for it, we currently work with variable lenght
      blocks and we are not compatible for now with the one in libbeat.

    - It implements a few storage mechanism and wrapper:
      - DiskStore: Save a io.reader directly to disk, the content is saved
        in a temporary file and the target is replace in an atomic
        operation.
      - EncryptedDiskStore: Same as Keystore but use the encrypted io.Reader
        and io.Writer.

    - A fleet configuration is created in _meta/agent.fleet.yml, the content
      of this file is packed in the binary. When a user enroll the agent,
      we do a backup of the current agent.yml and the content is replaced
      with the agent.fleet.yml

    - The enrollment information is saved into a "fleet.yml"

    - The managed mode now read the content of the fleet.yml and creates a
      Kibana API client.

    - A Separates Fleet Config struct is created.

    - Enroll will now ask for confirmation before replacing the user
      configuration.

* allow to use the obfuscated store.

* fix build
This PR add the fix from urso/ecslog#17
Which fix the infinite loop when using parsing flags, the bug was making
the library consume all the available memory until the OS killed the
process.
This PR add support for these types to make sure the convertion is
correctly done. The problem was the generated map had NIL values instead
of having the unsigned int values.

Fix: elastic#15182
Include metricbeat and Filebeat inside the agent.
…c#15027)

*  Feature: Allow to persist AccessToken and other connection data on disk
    This PR add a few things

    - It takes the keystore encryption implementation and create an
      io.Reader and io.Writer for it, we currently work with variable lenght
      blocks and we are not compatible for now with the one in libbeat.

    - It implements a few storage mechanism and wrapper:
      - DiskStore: Save a io.reader directly to disk, the content is saved
        in a temporary file and the target is replace in an atomic
        operation.
      - EncryptedDiskStore: Same as Keystore but use the encrypted io.Reader
        and io.Writer.

    - A fleet configuration is created in _meta/agent.fleet.yml, the content
      of this file is packed in the binary. When a user enroll the agent,
      we do a backup of the current agent.yml and the content is replaced
      with the agent.fleet.yml

    - The enrollment information is saved into a "fleet.yml"

    - The managed mode now read the content of the fleet.yml and creates a
      Kibana API client.

    - A Separates Fleet Config struct is created.

    - Enroll will now ask for confirmation before replacing the user
      configuration.

* allow to use the obfuscated store.

* Allow the Agent to retrieve configuration from the Fleet API.

implement the required gateway and the action handling to allow to
start, restart or stops processes based on the received configuration.

Ref: elastic#14951
* uuid for agent id

* fixed hound dog

* pass agent info

* pass agent info

* agent infor comments

* notice update
go.mod Outdated
github.com/stretchr/testify v1.4.0
github.com/tsg/go-daemon v0.0.0-20200207173439-e704b93fd89b
github.com/tsg/gopacket v0.0.0-20190320122513-dd3d0e41124a
github.com/urso/magetools v0.0.0-20200106130147-61080ed7b22b // indirect
github.com/urso/ecslog v0.0.0-20200210125449-b79160ce24a2
Copy link

Choose a reason for hiding this comment

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

This one looks wrong (dependencies are missing). I created a v0.0.1 tag on ecslog. Please use it to get the correct version and dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@urso I've fixed the version of ecslog on v0.0.1

@ph
Copy link
Contributor Author

ph commented Mar 5, 2020

@urso @ruflin ready to be reviewed again.

@ph
Copy link
Contributor Author

ph commented Mar 5, 2020

fixed again because of transport move.

@ph
Copy link
Contributor Author

ph commented Mar 5, 2020

I've skipped and fixed some of the windows tests the #16852 and created #16854 for a followup.

@ph
Copy link
Contributor Author

ph commented Mar 5, 2020

related created issue #16860

@ph
Copy link
Contributor Author

ph commented Mar 6, 2020

Merging into master 🤗

@ph ph merged commit a9a2779 into elastic:master Mar 6, 2020
@ph ph added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 6, 2020
@ruflin
Copy link
Member

ruflin commented Mar 9, 2020

Hooray, well done team! 👏

ph added a commit to ph/beats that referenced this pull request Apr 6, 2020
This PR move the development of the Elastic Agent inside the master branch, the Agent can be configured locally or using the ingest manager in Kibana. The Agent will take care of starting or stopping the processes depending on the configuration needs.

Co-authored-by: Pier-Hugues Pellerin <[email protected]>
Co-authored-by: Michal Pristas <[email protected]>
(cherry picked from commit a9a2779)
ph added a commit that referenced this pull request Apr 7, 2020
This PR move the development of the Elastic Agent inside the master branch, the Agent can be configured locally or using the ingest manager in Kibana. The Agent will take care of starting or stopping the processes depending on the configuration needs.

Co-authored-by: Pier-Hugues Pellerin <[email protected]>
Co-authored-by: Michal Pristas <[email protected]>
(cherry picked from commit a9a2779)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants