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

[8.x] [filebeat] Elasticsearch state storage for httpjson and cel inputs (#41446) #42468

Closed
wants to merge 1 commit into from

Conversation

orestisfl
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…lastic#41446)

This enables Elasticsearch as State Store Backend for Security Integrations for
the Agentless solution.

The scope of this change was narrowed down to supporting only `httpjson` inputs
in order to support Okta integration for the initial release. All the other
integrations inputs still use the file storage as before.
This is a short term solution for the state storage for k8s.

The feature currently can only be enabled with the
`AGENTLESS_ELASTICSEARCH_STATE_STORE_INPUT_TYPES` env var.

The existing code relied on the inputs state storage to be fully configurable
before the main beat managers runs. The change delays the configuration of
`httpjson` input to the time when the actual configuration is received from the
Agent.

Example of the state storage index content for Okta integration:
```
{
  "took": 6,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "agentless-state-httpjson-okta.system-028ecf4b-babe-44c6-939e-9e3096af6959",
        "_id": "httpjson::httpjson-okta.system-028ecf4b-babe-44c6-939e-9e3096af6959::https://dev-36006609.okta.com/api/v1/logs",
        "_seq_no": 39,
        "_primary_term": 1,
        "_score": 1,
        "_source": {
          "v": {
            "ttl": 1800000000000,
            "updated": "2024-10-24T20:21:22.032Z",
            "cursor": {
              "published": "2024-10-24T20:19:53.542Z"
            }
          }
        }
      }
    ]
  }
}
```

The naming convention for all state store is `agentless-state-<input id>`,
since the expectation for agentless we would have only one agent per policy and
the agents are ephemeral.

Closes https://github.com/elastic/security-team/issues/11101

Co-authored-by: Orestis Floros <[email protected]>
(cherry picked from commit 8180f23)

# Conflicts:
#	filebeat/beater/filebeat.go
@orestisfl orestisfl requested review from a team as code owners January 29, 2025 10:49
@orestisfl orestisfl requested review from mauri870 and faec and removed request for a team January 29, 2025 10:49
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 29, 2025
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
9b4f7e0

Please, read and sign the above mentioned agreement if you want to contribute to this project

@botelastic
Copy link

botelastic bot commented Jan 29, 2025

This pull request doesn't have a Team:<team> label.

@orestisfl orestisfl closed this Jan 29, 2025
@orestisfl orestisfl deleted the backport/8.x/pr-41446 branch January 29, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants