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

elastic main #8

Merged
merged 46 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7815b3f
Add .caseless subfield to process.name & process.executable (#2341)
w0rk3r Jul 10, 2024
146c96a
Revert "Add .caseless subfield to process.name & process.executable" …
andrewkroh Jul 23, 2024
fa37023
[RFC] Apple Platform specific fields (#2338)
txhaflaire Aug 13, 2024
a664f22
Add renovate.json (#2352)
elastic-renovate-prod[bot] Aug 13, 2024
e3f0f0e
Update template fields (#2354)
mjwolf Aug 19, 2024
86791b1
Pin dependencies (#2355)
elastic-renovate-prod[bot] Aug 19, 2024
529cca7
Update dependency PyYAML to v6.0.2 (#2356)
elastic-renovate-prod[bot] Aug 19, 2024
33662b6
Update dependency gitpython to v3.1.43 (#2358)
elastic-renovate-prod[bot] Aug 19, 2024
229312a
Update dependency yamllint to v1.35.1 (#2361)
elastic-renovate-prod[bot] Aug 19, 2024
22a03bc
Update stale PR message (#2369)
mjwolf Aug 20, 2024
70f4bca
Update actions/checkout action to v4 (#2362)
elastic-renovate-prod[bot] Aug 20, 2024
c097a0e
Update actions/github-script action to v7 (#2363)
elastic-renovate-prod[bot] Aug 20, 2024
22d5d35
Update actions/setup-python action to v5 (#2364)
elastic-renovate-prod[bot] Aug 21, 2024
07ffbd1
Update actions/stale action to v9 (#2365)
elastic-renovate-prod[bot] Aug 21, 2024
71a5e5d
Update dependency mock to v5 (#2367)
elastic-renovate-prod[bot] Aug 22, 2024
5376570
Update dependency ubuntu to v22 (#2368)
elastic-renovate-prod[bot] Aug 22, 2024
a793bb2
Update dependency autopep8 to v1.7.0 (#2359)
elastic-renovate-prod[bot] Aug 27, 2024
e3e73de
Update dependency autopep8 to v2 (#2366)
elastic-renovate-prod[bot] Aug 27, 2024
3f3ff68
add license header (#2377)
stbischof Sep 6, 2024
93453f4
Update actions/setup-python digest to f677139 (#2374)
elastic-renovate-prod[bot] Sep 6, 2024
029cf00
[RFC] Stage 0: Introducing new field in rule namespace (#2330)
smriti0321 Sep 10, 2024
149a4cc
[RFC] Stage 2: Adding Apple Platform specific fields (#2370)
txhaflaire Sep 11, 2024
a967d85
code blocks specified language yaml (#2380)
stbischof Sep 11, 2024
71d285d
trim trailing whitespace in schema (#2379)
stbischof Sep 11, 2024
8be4ed7
[RFC] Stage 0: Introducing new fields in ECS vulnerability field set …
smriti0321 Sep 17, 2024
220ecee
Fix type in code signature (#2382)
mjwolf Sep 23, 2024
e78c424
Enforce yamllint in CI (#2381)
mjwolf Sep 24, 2024
68fd038
Add Stage0 RFC for new fields for fileless execution on Linux (#2322)
stanek-michal Sep 27, 2024
2a8f82e
Add support for settings
lksnyder0 Jun 10, 2024
8e10ca5
Fix settings merging
lksnyder0 Jun 10, 2024
cc0994c
Restrict test workflow
lksnyder0 Jun 10, 2024
3b19187
Fix merge conflicts
lksnyder0 Oct 9, 2024
48b7cd2
Less restrictive
lksnyder0 Jun 10, 2024
956fd87
Add docker files and pipeline
lksnyder0 Jun 11, 2024
5678a99
Make building more restrictive
lksnyder0 Jun 11, 2024
eb6d217
Simplify build workflow
lksnyder0 Jun 11, 2024
50898bb
Update tagging strategy
lksnyder0 Jun 11, 2024
1627f7e
Removing unused variable
lksnyder0 Jun 11, 2024
e3776ad
Kick?
lksnyder0 Jun 11, 2024
5fcc445
Anchors aren't supported 😭
lksnyder0 Jun 11, 2024
ea9a35d
Fix role name
lksnyder0 Jun 11, 2024
bb823a6
Test branch name
lksnyder0 Jun 11, 2024
a46fcd3
Remove extra default update (#3)
lksnyder0 Jun 12, 2024
58e9135
Add support for a top-level type (#4)
lksnyder0 Jun 17, 2024
81c2e21
Type needs to be nested within the field name (#5)
lksnyder0 Jun 17, 2024
d6b4a62
Add documention for parameters field (#6)
lksnyder0 Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/build_elastic_common_schema_toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build ECS Toolchain Image
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::068738303278:role/GithubECSRepoPolicy
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

# Setting up Docker Buildx with docker-container driver is required
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Debug
run: 'echo Branch name: "${{ github.head_ref || github.ref_name }}"'

# Always push with the branch name, this allows for external testing
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
tags: 068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:${{ github.head_ref || github.ref_name }}
cache-from: type=registry,ref=068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:cache
cache-to: mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:cache
push: true
build-args: |
BRANCH=${{ github.head_ref || github.ref_name }}

# Once it's in main, we want to update to the latest stable version
- name: Push Latest Tag
if: github.ref_name == 'main'
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:docker"
tags: 068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:latest
cache-from: type=registry,ref=068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:cache
cache-to: mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain:cache
push: true
build-args: |
BRANCH=${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .github/workflows/docs-preview-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
doc-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
name: Add doc preview links
with:
script: |
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,21 @@ jobs:

steps:
- name: "Check PRs"
uses: actions/stale@v4
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR is stale because it has been open for 60 days with no activity.'
stale-pr-message: |
Hi!

We just realized that we haven't looked into this PR in a while. We're
sorry!

We're labeling this PR as `Stale` to make it hit our filters and
make sure we get back to it as soon as possible. In the meantime, it'd
be extremely helpful if you could take a look at it as well and confirm its
relevance. A simple comment with a nice emoji will be enough `:+1`.

Thank you for your contribution!
stale-pr-label: 'stale'
ascending: true
days-before-pr-stale: 60
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: Unit Tests
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: '3.x'
- run: git fetch --prune --unshallow --tags
- run: make check
- run: make check yamllint
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ misspell:
fi
./build/misspell/bin/misspell -error README.md CONTRIBUTING.md schemas/* docs/* experimental/schemas/*

# Warn re misspell removal
# Warn re misspell removal
.PHONY: misspell_warn
misspell_warn:
@echo "Warning: due to lack of cross-platform support, misspell is no longer included in this task and may be deprecated in future\n"
Expand All @@ -110,4 +110,4 @@ build/ve/bin/activate: scripts/requirements.txt scripts/requirements-dev.txt
# Check YAML syntax (currently not enforced).
.PHONY: yamllint
yamllint: ve
build/ve/bin/yamllint schemas/*.yml
build/ve/bin/yamllint -d '{extends: default, rules: {line-length: disable}}' schemas/*.yml
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:latest
ARG BRANCH=main
RUN mkdir /ecs && apt update && apt install -y git python3-pip && apt clean
WORKDIR /ecs
RUN git clone https://github.com/huntresslabs/ecs . && git checkout ${BRANCH} && python3 -m pip install --break-system-packages -r scripts/requirements.txt
COPY scripts/entry_point.sh entry_point.sh
ENTRYPOINT ["/bin/bash", "/ecs/entry_point.sh"]
23 changes: 23 additions & 0 deletions docker/scripts/entry_point.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

python3 scripts/generator.py --subset /data_stream/subset --out /data_stream --include /include /data_stream/include
code=$?
if [ $code -ne 0 ]; then
exit $code
fi

# Moving this functionality into the ECS tool
# for yaml_file in $(find {"/include","/data_stream/include"} -name '*.yml' -type f); do
# file_name="${yaml_file##*/}"
# if [ "$(yq '.0 | has("settings")' $yaml_file)" == "true" ]; then
# out_file="/data_stream/generated/elasticsearch/composable/component/${file_name%.yml}.json"
# echo "Adding settings from ${file_name} to ${out_file##*/}"
# yq '.0.settings' -o json $yaml_file | jq '.tmp.template.settings = .' | jq '.tmp' > /tmp/settings.json
# jq -s '.[0] * .[1]' $out_file /tmp/settings.json > /tmp/combined.json
# mv /tmp/combined.json $out_file
# else
# echo "$file_name does NOT have settings"
# fi
# done
echo "Opening permissions"
chmod -R 'u=rwX,g=rwX,o=rwX' "/data_stream/generated"
70 changes: 67 additions & 3 deletions docs/fields/field-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,24 @@ example: `true`

// ===============================================================

|
[[field-code-signature-flags]]
<<field-code-signature-flags, code_signature.flags>>

a| beta:[ This field is beta and subject to change. ]

The flags used to sign the process.

type: keyword



example: `570522385`

| extended

// ===============================================================

|
[[field-code-signature-signing-id]]
<<field-code-signature-signing-id, code_signature.signing_id>>
Expand Down Expand Up @@ -1610,7 +1628,7 @@ example: `co.uk`
[[ecs-device]]
=== Device Fields

Fields that describe a device instance and its characteristics. Data collected for applications and processes running on a (mobile) device can be enriched with these fields to describe the identity, type and other characteristics of the device.
Fields that describe a device instance and its characteristics. Data collected for applications and processes running on a (mobile) device can be enriched with these fields to describe the identity, type and other characteristics of the device.

This field group definition is based on the Device namespace of the OpenTelemetry Semantic Conventions (https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/device/).

Expand All @@ -1629,7 +1647,7 @@ beta::[ These fields are in beta and are subject to change.]
[[field-device-id]]
<<field-device-id, device.id>>

a| The unique identifier of a device. The identifier must not change across application sessions but stay fixed for an instance of a (mobile) device.
a| The unique identifier of a device. The identifier must not change across application sessions but stay fixed for an instance of a (mobile) device.

On iOS, this value must be equal to the vendor identifier (https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android, this value must be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application.

Expand Down Expand Up @@ -1693,6 +1711,24 @@ example: `Samsung Galaxy S6`

// ===============================================================

|
[[field-device-serial-number]]
<<field-device-serial-number, device.serial_number>>

a| beta:[ This field is beta and subject to change. ]

The unique serial number serves as a distinct identifier for each device, aiding in inventory management and device authentication.

type: keyword



example: `DJGAQS4CW5`

| core

// ===============================================================

|=====


Expand Down Expand Up @@ -4811,6 +4847,24 @@ Note that this fieldset is used for common hashes that may be computed over a ra

// ===============================================================

|
[[field-hash-cdhash]]
<<field-hash-cdhash, hash.cdhash>>

a| beta:[ This field is beta and subject to change. ]

Code directory hash, utilized to uniquely identify and authenticate the integrity of the executable code.

type: keyword



example: `3783b4052fd474dbe30676b45c329e7a6d44acd9`

| extended

// ===============================================================

|
[[field-hash-md5]]
<<field-hash-md5, hash.md5>>
Expand Down Expand Up @@ -8685,6 +8739,8 @@ The `process` fields are expected to be nested at:

* `process.previous`

* `process.responsible`

* `process.session_leader`

* `process.session_leader.parent`
Expand Down Expand Up @@ -8839,6 +8895,14 @@ Note: this reuse should contain an array of process field set objects.
// ===============================================================


| `process.responsible.*`
| <<ecs-process,process>>| beta:[ This field is beta and subject to change.]

Responsible process in macOS tracks the originating process of an app, key for understanding permissions and hierarchy.

// ===============================================================


| `process.saved_group.*`
| <<ecs-group,group>>
| The saved group (sgid).
Expand Down Expand Up @@ -9142,7 +9206,7 @@ Note: this field should contain an array of values.
[[ecs-risk]]
=== Risk information Fields

Fields for describing risk score and risk level of entities such as hosts and users. These fields are not allowed to be nested under `event.*`. Please continue to use `event.risk_score` and `event.risk_score_norm` for event risk.
Fields for describing risk score and risk level of entities such as hosts and users. These fields are not allowed to be nested under `event.*`. Please continue to use `event.risk_score` and `event.risk_score_norm` for event risk.

beta::[ These fields are in beta and are subject to change.]

Expand Down
Loading