Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/matrix-ne…
Browse files Browse the repository at this point in the history
…w-oss

* upstream/master: (27 commits)
  Disable host fields for "cloud", panw, cef modules (elastic#18223)
  [docs] Rename monitoring collection from legacy internal collection to legacy collection (elastic#18504)
  Introduce auto detection of format (elastic#18095)
  Add additional fields to address issue elastic#18465 for googlecloud audit log (elastic#18472)
  Fix libbeat import path in seccomp policy template (elastic#18418)
  Address Okta input issue elastic#18530 (elastic#18534)
  [Ingest Manager] Avoid Chown on windows (elastic#18512)
  Fix Cisco ASA/FTD msgs that use a host name as NAT address (elastic#18376)
  [CI] Optimise stash/unstash performance (elastic#18473)
  Libbeat: Remove global loggers from libbeat/metric and libbeat/cloudid (elastic#18500)
  Fix PANW bad mapping of client/source and server/dest packets and bytes (elastic#18525)
  Add a file lock to the data directory on startup to prevent multiple agents. (elastic#18483)
  Followup to 12606 (elastic#18316)
  changed input from syslog to tcp/udp due to unsupported RFC (elastic#18447)
  Improve ECS field mappings in Sysmon module. (elastic#18381)
  [Elastic Agent] Cleaner output of inspect command  (elastic#18405)
  [Elastic Agent] Pick up version from libbeat (elastic#18350)
  Update communitybeats.asciidoc (elastic#18470)
  [Metricbeat] Change visualization interval from 15m to >=15m (elastic#18466)
  docs: Fix typo in kerberos docs (elastic#18503)
  ...
  • Loading branch information
v1v committed May 15, 2020
2 parents 1f5aad8 + e990740 commit 4d24ce8
Show file tree
Hide file tree
Showing 255 changed files with 8,865 additions and 2,747 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
- The disk spool types `spool.Spool` and `spool.Settings` have been renamed to the internal types `spool.diskSpool` and `spool.settings`. {pull}16693[16693]
- `queue.Eventer` has been renamed to `queue.ACKListener` {pull}16691[16691]
- Require logger as first parameter for `outputs.transport.transport#ProxyDialer` and `outputs.elasticsearch.client#BulkReadItemStatus`. {pull}16761[16761]

- The `libbeat/outputs/transport` package has been moved to `libbeat/common/transport`. {pull}16734[16734]
- The `libbeat/outputs/tls.go` file has been removed. All exported symbols in that file (`libbeat/outputs.*`) are now available as `libbeat/common/tlscommon.*`. {pull}16734[16734]
- The newly generated Beats are using go modules to manage dependencies. {pull}16288[16288]
Expand Down Expand Up @@ -87,3 +86,4 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
- Add support for a `TEST_TAGS` environment variable to add tags for tests selection following go build tags semantics, this environment variable is used by mage test targets to add build tags. Python tests can also be tagged with a decorator (`@beat.tag('sometag')`). {pull}16937[16937] {pull}17075[17075]
- Add fields validation for histogram subfields. {pull}17759[17759]
- Add IP* fields to `fields.yml` generator script in Filebeat. {issue}17998[17998] {pull}18256[18256]
- Events intended for the Elasticsearch output can now take an `op_type` metadata field of type events.OpType or string to indicate the `op_type` to use for bulk indexing. {pull}12606[12606]
21 changes: 21 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Change aws_elb autodiscover provider field name from elb_listener.* to aws.elb.*. {issue}16219[16219] {pull}16402{16402}
- Remove `AddDockerMetadata` and `AddKubernetesMetadata` processors from the `script` processor. They can still be used as normal processors in the configuration. {issue}16349[16349] {pull}16514[16514]
- Introduce APM libbeat instrumentation, active when running the beat with ELASTIC_APM_ACTIVE=true. {pull}17938[17938]
- Remove the non-ECS `agent.hostname` field. Use the `agent.name` or `agent.id` fields for an identifier. {issue}16377[16377] {pull}18328[18328]

*Auditbeat*

Expand All @@ -24,6 +25,13 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Improve ECS field mappings in panw module. event.outcome now only contains success/failure per ECS specification. {issue}16025[16025] {pull}17910[17910]
- Improve ECS categorization field mappings for nginx module. http.request.referrer is now lowercase & http.request.referrer only populated when nginx sets a value {issue}16174[16174] {pull}17844[17844]
- Improve ECS field mappings in santa module. move hash.sha256 to process.hash.sha256 & move certificate fields to santa.certificate . {issue}16180[16180] {pull}17982[17982]
- With the default configuration the cloud modules (aws, azure, googlecloud, o365, okta)
will no longer send the `host` field that contains information about the host Filebeat is
running on. This is because the `host` field specifies the host on which the event
happened. {issue}13920[13920] {pull}18223[18223]
- With the default configuration the cef and panw modules will no longer send the `host`
field. You can revert this change by configuring tags for the module and omitting
`forwarded` from the list. {issue}13920[13920] {pull}18223[18223]

*Heartbeat*

Expand All @@ -45,6 +53,10 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Winlogbeat*

- Add support to Sysmon file delete events (event ID 23). {issue}18094[18094]
- Improve ECS field mappings in Sysmon module. `related.hash`, `related.ip`, and `related.user` are now populated. {issue}18364[18364]
- Improve ECS field mappings in Sysmon module. Hashes are now also populated to the corresponding `process.hash`, `process.pe.imphash`, `file.hash`, or `file.pe.imphash`. {issue}18364[18364]
- Improve ECS field mappings in Sysmon module. `file.name`, `file.directory`, and `file.extension` are now populated. {issue}18364[18364]
- Improve ECS field mappings in Sysmon module. `rule.name` is populated for all events when present. {issue}18364[18364]

*Functionbeat*

Expand Down Expand Up @@ -127,6 +139,11 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fixed typo in log message. {pull}17897[17897]
- Fix Cisco ASA ASA 3020** and 106023 messages {pull}17964[17964]
- Unescape file name from SQS message. {pull}18370[18370]
- Improve cisco asa and ftd pipelines' failure handler to avoid mapping temporary fields. {issue}18391[18391] {pull}18392[18392]
- Fix PANW module wrong mappings for bytes and packets counters. {issue}18522[18522] {pull}18525[18525]
- Fixed ingestion of some Cisco ASA and FTD messages when a hostname was used instead of an IP for NAT fields. {issue}14034[14034] {pull}18376[18376]
- Fix a rate limit related issue in httpjson input for Okta module. {issue}18530[18530] {pull}18534[18534]
- Fix `googlecloud.audit` pipeline to only take in fields that are explicitly defined by the dataset. {issue}18465[18465] {pull}18472[18472]

*Heartbeat*

Expand Down Expand Up @@ -178,13 +195,15 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add a switch to the driver definition on SQL module to use pretty names. {pull}17378[17378]
- Fix overflow on Prometheus rates when new buckets are added on the go. {pull}17753[17753]
- Remove specific win32 api errors from events in perfmon. {issue}18292[18292] {pull}18361[18361]
- Fix application_pool metricset after pdh changes. {pull}18477[18477]

*Packetbeat*

- Enable setting promiscuous mode automatically. {pull}11366[11366]

*Winlogbeat*

- Fix invalid IP addresses in DNS query results from Sysmon data. {issue}18432[18432] {pull}18436{18436}

*Functionbeat*

Expand Down Expand Up @@ -313,6 +332,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Improve ECS categorization field mappings in system module. {issue}16031[16031] {pull}18065[18065]
- Change the `json.*` input settings implementation to merge parsed json objects with existing objects in the event instead of fully replacing them. {pull}17958[17958]
- Improve ECS categorization field mappings in osquery module. {issue}16176[16176] {pull}17881[17881]
- Added `observer.vendor`, `observer.product`, and `observer.type` to PANW module events. {pull}18223[18223]
- The `logstash` module can now automatically detect the log file format (JSON or plaintext) and process it accordingly. {issue}9964[9964] {pull}18095[18095]

*Heartbeat*

Expand Down
12 changes: 7 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pipeline {
DOCKER_REGISTRY = 'docker.elastic.co'
AWS_ACCOUNT_SECRET = 'secret/observability-team/ci/elastic-observability-aws-account-auth'
RUNBLD_DISABLE_NOTIFICATIONS = 'true'
JOB_GCS_BUCKET = 'beats-ci-temp'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
}
options {
timeout(time: 2, unit: 'HOURS')
Expand Down Expand Up @@ -63,7 +65,7 @@ pipeline {
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${BASE_DIR}"){
loadConfigEnvVars()
}
Expand Down Expand Up @@ -732,7 +734,7 @@ def withBeatsEnv(boolean archive, Closure body) {
"DOCKER_PULL=0",
]) {
deleteDir()
unstash 'source'
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
if(isDockerInstalled()){
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
}
Expand Down Expand Up @@ -773,7 +775,7 @@ def withBeatsEnvWin(Closure body) {
"RACE_DETECTOR=true",
]){
deleteDir()
unstash 'source'
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${env.BASE_DIR}"){
installTools()
try {
Expand Down Expand Up @@ -1037,7 +1039,7 @@ def terraformCleanup(String stashName, String directory) {
stage("Remove cloud scenarios in ${directory}"){
withCloudTestEnv() {
withBeatsEnv(false) {
unstash "terraform-${stashName}"
unstash("terraform-${stashName}")
retry(2) {
sh(label: "Terraform Cleanup", script: ".ci/scripts/terraform-cleanup.sh ${directory}")
}
Expand Down Expand Up @@ -1186,7 +1188,7 @@ def runbld() {
// Unstash the test reports
stashedTestReports.each { k, v ->
dir(k) {
unstash v
unstash(v)
}
}
sh(label: 'Process JUnit reports with runbld',
Expand Down
8 changes: 5 additions & 3 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2458,10 +2458,12 @@ Contains common beat fields available in all event types.
*`agent.hostname`*::
+
--
Deprecated - use agent.name or agent.id to identify an agent. Hostname of the agent.
Deprecated - use agent.name or agent.id to identify an agent.
type: keyword
type: alias
alias to: agent.name
--
Expand Down Expand Up @@ -2498,7 +2500,7 @@ alias to: host.name
--
type: alias
alias to: agent.hostname
alias to: agent.name
--
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
{
"attributes": {
"columns": [
"agent.hostname",
"agent.name",
"process.args",
"auditd.summary.actor.primary",
"auditd.summary.actor.secondary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{
"attributes": {
"columns": [
"agent.hostname",
"agent.name",
"auditd.summary.actor.primary",
"auditd.summary.actor.secondary",
"event.action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
{
"attributes": {
"columns": [
"agent.hostname",
"agent.name",
"auditd.summary.how",
"auditd.summary.object.primary",
"auditd.summary.object.secondary",
Expand Down Expand Up @@ -566,7 +566,7 @@
{
"attributes": {
"columns": [
"agent.hostname",
"agent.name",
"auditd.summary.how",
"auditd.summary.object.primary",
"auditd.summary.object.secondary",
Expand Down Expand Up @@ -673,7 +673,7 @@
{
"attributes": {
"columns": [
"agent.hostname",
"agent.name",
"auditd.summary.how",
"auditd.summary.object.primary",
"auditd.summary.object.secondary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,31 @@ function enroll(){
if [[ -n "${FLEET_ENROLLMENT_TOKEN}" ]] && [[ ${FLEET_ENROLLMENT_TOKEN} == 1 ]]; then
apikey = "${FLEET_ENROLLMENT_TOKEN}"
else
enrollResp=$(curl -X POST ${KIBANA_HOST:-http://localhost:5601}/api/ingest_manager/fleet/enrollment-api-keys \
enrollResp=$(curl ${KIBANA_HOST:-http://localhost:5601}/api/ingest_manager/fleet/enrollment-api-keys \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-u ${KIBANA_USERNAME:-elastic}:${KIBANA_PASSWORD:-changeme} \
-d '{"name":"'"${FLEET_TOKEN_NAME:-demotoken}"'","config_id":"'"${FLEET_CONFIG_ID:-default}"'"}')
-u ${KIBANA_USERNAME:-elastic}:${KIBANA_PASSWORD:-changeme} )

local exitCode=$?
if [ $exitCode -ne 0 ]; then
exit $exitCode
fi
echo $enrollResp
local apikeyId=$(echo $enrollResp | jq -r '.list[0].id')
echo $apikeyId

apikey=$(echo $enrollResp | jq -r '.item.api_key')
enrollResp=$(curl ${KIBANA_HOST:-http://localhost:5601}/api/ingest_manager/fleet/enrollment-api-keys/$apikeyId \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-u ${KIBANA_USERNAME:-elastic}:${KIBANA_PASSWORD:-changeme} )

exitCode=$?
if [ $exitCode -ne 0 ]; then
exit $exitCode
fi
fi
apikey=$(echo $enrollResp | jq -r '.item.api_key')
echo $apikey

./{{ .BeatName }} enroll ${KIBANA_HOST:-http://localhost:5601} $apikey -f
}
Expand Down
7 changes: 7 additions & 0 deletions filebeat/_meta/config/processors.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{header "Processors"}}
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
- add_docker_metadata: ~
- add_kubernetes_metadata: ~
3 changes: 2 additions & 1 deletion filebeat/channel/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/beat/events"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/processors"
"github.com/elastic/beats/v7/libbeat/processors/actions"
Expand Down Expand Up @@ -195,7 +196,7 @@ func (p *setRawIndex) Run(event *beat.Event) (*beat.Event, error) {
if event.Meta == nil {
event.Meta = common.MapStr{}
}
event.Meta["raw_index"] = p.indexStr
event.Meta[events.FieldMetaRawIndex] = p.indexStr
return event, nil
}

Expand Down
Loading

0 comments on commit 4d24ce8

Please sign in to comment.