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

[AWS][Pipeline Test] Multiple pipeline Test failure due to event.category mappings #10116

Closed
agithomas opened this issue Jun 11, 2024 · 12 comments
Labels
Integration:aws AWS Team:Ecosystem Label for the Packages Ecosystem team [elastic/ecosystem] Team:Integrations Label for the Integrations team Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] Team:Service-Integrations Label for the Service Integrations team

Comments

@agithomas
Copy link
Contributor

agithomas commented Jun 11, 2024

Observing below mentioned failures upon running AWS pipeline test.
ES Stack Version : 8.14

This error breaks the CI/CD pipeline.

1

pipeline test: test-s3-server-access.log in aws.s3access
test case failed: one or more problems with fields found in documents: [0] field "event.category" is not normalized as expected: expected array, found "web" (string)

pipeline test: test-cloudfront.log in aws.cloudfront_logs
test case failed: one or more problems with fields found in documents: [0] field "event.category" is not normalized as expected: expected array, found "web" (string)

pipeline test: test-waf.log in aws.waf
test case failed: one or more problems with fields found in documents: [0] field "event.category" is not normalized as expected: expected array, found "web" (string)

Buildkite Reference : https://buildkite.com/elastic/integrations/builds/12418

image

The solution to the problem can be found here

https://github.com/elastic/elastic-package/blob/main/docs/howto/update_major_package_spec.md#field--is-not-normalized-as-expected-expected-array-found-

Once the issue is fixed, there may exist a need to run
elastic-package test pipeline -d cloudfront_logs -v --generate

@agithomas agithomas added Integration:aws AWS integration Label used for meta issues tracking each integration Team:Integrations Label for the Integrations team labels Jun 11, 2024
@elasticmachine
Copy link

Pinging @elastic/integrations (Team:Integrations)

@agithomas agithomas added Team:Service-Integrations Label for the Service Integrations team Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] and removed integration Label used for meta issues tracking each integration labels Jun 11, 2024
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@agithomas
Copy link
Contributor Author

With the above-mentioned changes applied, you can observe successful pipeline execution run.

ES version : 8.14


--- Test results for package: aws - START ---
╭─────────┬─────────────────┬───────────┬────────────────────────────┬────────┬──────────────╮
│ PACKAGE │ DATA STREAM     │ TEST TYPE │ TEST NAME                  │ RESULT │ TIME ELAPSED │
├─────────┼─────────────────┼───────────┼────────────────────────────┼────────┼──────────────┤
│ aws     │ cloudfront_logs │ pipeline  │ test-cloudfront.log        │ PASS   │  10.098706ms │
│ aws     │ cloudfront_logs │ pipeline  │ (ingest pipeline warnings) │ PASS   │ 571.062007ms │
╰─────────┴─────────────────┴───────────┴────────────────────────────┴────────┴──────────────╯

@agithomas
Copy link
Contributor Author

agithomas commented Jun 11, 2024

For AWS-WAF, I have noticied below mentioned error additionally

--- Test results for package: aws - START ---
FAILURE DETAILS:
aws/waf test-waf.log:
[0] parsing field value failed: field "event.type" value "allowed" is not one of the expected values (access, error, info) for any of the values of "event.category" (web)
[1] parsing field value failed: field "event.type" value "denied" is not one of the expected values (access, error, info) for any of the values of "event.category" (web)

Fix Reference: https://github.com/elastic/elastic-package/blob/main/docs/howto/update_major_package_spec.md#field-eventtype-value--is-not-one-of-the-expected-values--for-

So, it may be determined what append processor values may be appropriate

But, I do notice the allowed value list: https://www.elastic.co/guide/en/ecs/current/ecs-allowed-values-event-type.html
which mentions values such as allowed and denied are supported.

@agithomas
Copy link
Contributor Author

Closing the issue as the issue is not reproducible.

@agithomas
Copy link
Contributor Author

Reopening the issue, as i could recreate the issue.

The mandatory condition to recreate the issue is

  kibana:
    version: "^8.14.0"
    

@agithomas agithomas reopened this Jun 11, 2024
@agithomas
Copy link
Contributor Author

@jsoriano , do you know why the issue mentioned here occur?

@agithomas agithomas added the Team:Ecosystem Label for the Packages Ecosystem team [elastic/ecosystem] label Jun 11, 2024
@muthu-mps
Copy link
Contributor

@agithomas -

  • By upgrading the stack version from 8.12 to 8.14 we may need to remove the ECS field definitions (ecs.yml file). We may also need to validate the ecs@mapping behaviour.
  • Starting from 8.13 the ecs@mapping component template is referenced by any integration as mentioned here.

cc: @zmoog

@ishleenk17
Copy link
Contributor

This issue will occur from 8.13 onwards, where the default ECS mappings are now applied to fields. Previously, event.category was not explicitly defined in ecs.yml, so it was treated as a keyword. The Elastic package did not previously flag such errors for undefined fields.

For your information, this upgrade of ECS mappings will be addressed as part of this issue. However, if this change is a prerequisite for your task, please feel free to make the necessary adjustments.

@agithomas
Copy link
Contributor Author

Related issue : #10135

@jsoriano
Copy link
Member

@jsoriano , do you know why the issue mentioned here occur?

As Ishleen mentions, I think this is a similar case to #9453 (comment). Summarizing, elastic-package ignores validation on some fields for legacy reasons when these fields are not defined, this includes event.*. This package didn't have definitions for some of these fields. Now that it supports only versions >= 8.13, it includes all ECS definitions, and these validations apply.

The possible solutions would be similar too:

  • Adapt the values of event.type according to what ECS expects. But this could be a breaking change if there is something working with these values.
  • Define event.type and/or event.category according to the expectations of this package, so the definition in ECS is not used for validation.

@agithomas
Copy link
Contributor Author

Resolved by the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:aws AWS Team:Ecosystem Label for the Packages Ecosystem team [elastic/ecosystem] Team:Integrations Label for the Integrations team Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] Team:Service-Integrations Label for the Service Integrations team
Projects
None yet
Development

No branches or pull requests

5 participants