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

Digital code signatures for process, file and dll events #733

Merged
merged 12 commits into from
Feb 17, 2020
42 changes: 42 additions & 0 deletions code/go/ecs/code_signature.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions docs/field-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,89 @@ example: `us-east-1`

|=====

[[ecs-code_signature]]
=== Code Signature Fields

These fields contain information about binary code signatures.

==== Code Signature Field Details

[options="header"]
|=====
| Field | Description | Level

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

| code_signature.exists
| Boolean to capture if a signature is present.

This should only populated if the signature was checked.

type: keyword

example: `True`
webmat marked this conversation as resolved.
Show resolved Hide resolved

| extended

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

| code_signature.status
| Additional information about the certificate status.

This is useful for logging cryptographic errors with the certificate validity or trust status.

type: keyword

example: `ERROR_UNTRUSTED_ROOT`

| extended

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

| code_signature.subject_name
| Subject name of the code signer

type: keyword

example: `Microsoft Corporation`

| core

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

| code_signature.trusted
| Stores the trust status of the certificate chain.

type: boolean

example: `True`

| extended

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

| code_signature.valid
| Boolean to capture if the digital signature is verified against the binary content.

type: boolean

example: `True`

| core

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

|=====

==== Field Reuse

The `code_signature` fields are expected to be nested at: `file.code_signature`, `process.code_signature`.

Note also that the `code_signature` fields are not expected to be used directly at the top level.




[[ecs-container]]
=== Container Fields

Expand Down Expand Up @@ -1719,6 +1802,12 @@ example: `1001`
// ===============================================================


| <<ecs-code_signature,file.code_signature.*>>
| These fields contain information about binary code signatures.

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


| <<ecs-hash,file.hash.*>>
| Hashes, usually file hashes.

Expand Down Expand Up @@ -3521,6 +3610,12 @@ example: `/home/alice`
// ===============================================================


| <<ecs-code_signature,process.code_signature.*>>
| These fields contain information about binary code signatures.

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


| <<ecs-hash,process.hash.*>>
| Hashes, usually file hashes.

Expand Down
2 changes: 2 additions & 0 deletions docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ all fields are defined.

| <<ecs-cloud,Cloud>> | Fields about the cloud resource.

| <<ecs-code_signature,Code Signature>> | These fields contain information about binary code signatures.

| <<ecs-container,Container>> | Fields describing the container that generated this event.

| <<ecs-destination,Destination>> | Fields about the destination side of a network connection, used with source.
Expand Down
135 changes: 135 additions & 0 deletions generated/beats/fields.ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,55 @@
ignore_above: 1024
description: Region in which this host is running.
example: us-east-1
- name: code_signature
title: Code Signature
group: 2
description: These fields contain information about binary code signatures.
type: group
fields:
- name: exists
level: extended
type: keyword
ignore_above: 1024
format: core
description: 'Boolean to capture if a signature is present.

This should only populated if the signature was checked.'
example: true
default_field: false
- name: status
level: extended
type: keyword
ignore_above: 1024
format: string
description: 'Additional information about the certificate status.

This is useful for logging cryptographic errors with the certificate validity
or trust status.'
example: ERROR_UNTRUSTED_ROOT
default_field: false
- name: subject_name
level: core
type: keyword
ignore_above: 1024
format: string
description: Subject name of the code signer
example: Microsoft Corporation
default_field: false
- name: trusted
level: extended
type: boolean
format: core
description: Stores the trust status of the certificate chain.
example: true
default_field: false
- name: valid
level: core
type: boolean
description: Boolean to capture if the digital signature is verified against
the binary content.
example: true
default_field: false
- name: container
title: Container
group: 2
Expand Down Expand Up @@ -1196,6 +1245,49 @@
execute, hidden, read, readonly, system, write.'
example: '["readonly", "system"]'
default_field: false
- name: code_signature.exists
level: extended
type: keyword
ignore_above: 1024
format: core
description: 'Boolean to capture if a signature is present.

This should only populated if the signature was checked.'
example: true
default_field: false
- name: code_signature.status
level: extended
type: keyword
ignore_above: 1024
format: string
description: 'Additional information about the certificate status.

This is useful for logging cryptographic errors with the certificate validity
or trust status.'
example: ERROR_UNTRUSTED_ROOT
default_field: false
- name: code_signature.subject_name
level: core
type: keyword
ignore_above: 1024
format: string
description: Subject name of the code signer
example: Microsoft Corporation
default_field: false
- name: code_signature.trusted
level: extended
type: boolean
format: core
description: Stores the trust status of the certificate chain.
example: true
default_field: false
- name: code_signature.valid
level: core
type: boolean
description: Boolean to capture if the digital signature is verified against
the binary content.
example: true
default_field: false
- name: created
level: extended
type: date
Expand Down Expand Up @@ -2381,6 +2473,49 @@
indication of suspicious activity.'
example: 4
default_field: false
- name: code_signature.exists
level: extended
type: keyword
ignore_above: 1024
format: core
description: 'Boolean to capture if a signature is present.

This should only populated if the signature was checked.'
example: true
default_field: false
- name: code_signature.status
level: extended
type: keyword
ignore_above: 1024
format: string
description: 'Additional information about the certificate status.

This is useful for logging cryptographic errors with the certificate validity
or trust status.'
example: ERROR_UNTRUSTED_ROOT
default_field: false
- name: code_signature.subject_name
level: core
type: keyword
ignore_above: 1024
format: string
description: Subject name of the code signer
example: Microsoft Corporation
default_field: false
- name: code_signature.trusted
level: extended
type: boolean
format: core
description: Stores the trust status of the certificate chain.
example: true
default_field: false
- name: code_signature.valid
level: core
type: boolean
description: Boolean to capture if the digital signature is verified against
the binary content.
example: true
default_field: false
- name: command_line
level: extended
type: keyword
Expand Down
15 changes: 15 additions & 0 deletions generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Example,Description
1.5.0-dev,true,cloud,cloud.machine.type,keyword,extended,t2.medium,Machine type of the host machine.
1.5.0-dev,true,cloud,cloud.provider,keyword,extended,aws,Name of the cloud provider.
1.5.0-dev,true,cloud,cloud.region,keyword,extended,us-east-1,Region in which this host is running.
1.5.0-dev,true,code_signature,code_signature.exists,keyword,extended,True,Boolean to capture if a signature is present.
1.5.0-dev,true,code_signature,code_signature.status,keyword,extended,ERROR_UNTRUSTED_ROOT,Additional information about the certificate status.
1.5.0-dev,true,code_signature,code_signature.subject_name,keyword,core,Microsoft Corporation,Subject name of the code signer
1.5.0-dev,true,code_signature,code_signature.trusted,boolean,extended,True,Stores the trust status of the certificate chain.
1.5.0-dev,true,code_signature,code_signature.valid,boolean,core,True,Boolean to capture if the digital signature is verified against the binary content.
1.5.0-dev,true,container,container.id,keyword,core,,Unique container id.
1.5.0-dev,true,container,container.image.name,keyword,extended,,Name of the image the container was built on.
1.5.0-dev,true,container,container.image.tag,keyword,extended,,Container image tag.
Expand Down Expand Up @@ -139,6 +144,11 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Example,Description
1.5.0-dev,true,event,event.type,keyword,core,,Event type. The third categorization field in the hierarchy.
1.5.0-dev,true,file,file.accessed,date,extended,,Last time the file was accessed.
1.5.0-dev,true,file,file.attributes,keyword,extended,"[""readonly"", ""system""]",Array of file attributes.
1.5.0-dev,true,file,file.code_signature.exists,keyword,extended,True,Boolean to capture if a signature is present.
1.5.0-dev,true,file,file.code_signature.status,keyword,extended,ERROR_UNTRUSTED_ROOT,Additional information about the certificate status.
1.5.0-dev,true,file,file.code_signature.subject_name,keyword,core,Microsoft Corporation,Subject name of the code signer
1.5.0-dev,true,file,file.code_signature.trusted,boolean,extended,True,Stores the trust status of the certificate chain.
1.5.0-dev,true,file,file.code_signature.valid,boolean,core,True,Boolean to capture if the digital signature is verified against the binary content.
1.5.0-dev,true,file,file.created,date,extended,,File creation time.
1.5.0-dev,true,file,file.ctime,date,extended,,Last time the file attributes or metadata changed.
1.5.0-dev,true,file,file.device,keyword,extended,sda,Device that is the source of the file.
Expand Down Expand Up @@ -300,6 +310,11 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Example,Description
1.5.0-dev,true,package,package.version,keyword,extended,1.12.9,Package version
1.5.0-dev,true,process,process.args,keyword,extended,"['/usr/bin/ssh', '-l', 'user', '10.0.0.16']",Array of process arguments.
1.5.0-dev,true,process,process.args_count,long,extended,4,Length of the process.args array.
1.5.0-dev,true,process,process.code_signature.exists,keyword,extended,True,Boolean to capture if a signature is present.
1.5.0-dev,true,process,process.code_signature.status,keyword,extended,ERROR_UNTRUSTED_ROOT,Additional information about the certificate status.
1.5.0-dev,true,process,process.code_signature.subject_name,keyword,core,Microsoft Corporation,Subject name of the code signer
1.5.0-dev,true,process,process.code_signature.trusted,boolean,extended,True,Stores the trust status of the certificate chain.
1.5.0-dev,true,process,process.code_signature.valid,boolean,core,True,Boolean to capture if the digital signature is verified against the binary content.
1.5.0-dev,true,process,process.command_line,keyword,extended,/usr/bin/ssh -l user 10.0.0.16,Full command line that started the process.
1.5.0-dev,true,process,process.command_line.text,text,extended,/usr/bin/ssh -l user 10.0.0.16,Full command line that started the process.
1.5.0-dev,true,process,process.executable,keyword,extended,/usr/bin/ssh,Absolute path to the process executable.
Expand Down