Skip to content

Commit

Permalink
Merge branch 'master' into feature/split-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Apr 7, 2021
2 parents 1c161f2 + 2875faf commit 415e012
Show file tree
Hide file tree
Showing 570 changed files with 45,697 additions and 5,307 deletions.
3 changes: 3 additions & 0 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pipeline {
'x-pack/heartbeat',
// 'x-pack/journalbeat',
'x-pack/metricbeat',
'x-pack/osquerybeat',
'x-pack/packetbeat',
'x-pack/winlogbeat'
)
Expand Down Expand Up @@ -290,6 +291,8 @@ def pushCIDockerImages(Map args = [:]) {
tagAndPush(beatName: 'journalbeat', arch: arch)
} else if (env?.BEATS_FOLDER?.endsWith('metricbeat')) {
tagAndPush(beatName: 'metricbeat', arch: arch)
} else if (env?.BEATS_FOLDER?.endsWith('osquerybeat')) {
tagAndPush(beatName: 'osquerybeat', arch: arch)
} else if ("${env.BEATS_FOLDER}" == "packetbeat"){
tagAndPush(beatName: 'packetbeat', arch: arch)
} else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") {
Expand Down
4 changes: 3 additions & 1 deletion .ci/scripts/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ GVM_CMD="${HOME}/bin/gvm"

if command -v go
then
set +e
echo "Found Go. Checking version.."
FOUND_GO_VERSION=$(go version|awk '{print $3}'|sed s/go//)
if [ $FOUND_GO_VERSION == $GO_VERSION ]
if [ "$FOUND_GO_VERSION" == "$GO_VERSION" ]
then
echo "Versions match. No need to install Go. Exiting."
exit 0
fi
set -e
fi

if [ "${ARCH}" == "aarch64" ] ; then
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add support for SCRAM-SHA-512 and SCRAM-SHA-256 in Kafka output. {pull}12867[12867]
- Use alias to report container image in k8s metadata. {pull}24380[24380]
- Set `cleanup_timeout` to zero by default in docker and kubernetes autodiscover in all beats except Filebeat where it is kept to 60 seconds. {pull}24681[24681]
- Update to ECS 1.9.0. {pull}24909[24909]

*Auditbeat*

Expand Down Expand Up @@ -234,8 +235,11 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add FAQ entry for madvdontneed variable {pull}23429[23429]
- Fix panic due to unhandled DeletedFinalStateUnknown in k8s OnDelete {pull}23419[23419]
- Fix error loop with runaway CPU use when the Kafka output encounters some connection errors {pull}23484[23484]
- Fix ILM setup log reporting that a policy or an alias was created, even though the creation of any resource was disabled. {issue}24046[24046] {pull}24480[24480]
- Fix ILM alias not being created if `setup.ilm.check_exists: false` and `setup.ilm.overwrite: true` has been configured. {pull}24480[24480]
- Fix issue discovering docker containers and metadata after reconnections {pull}24318[24318]
- Allow cgroup self-monitoring to see alternate `hostfs` paths {pull}24334[24334]
- Fix 'make setup' instructions for a new beat {pull}24944[24944]

*Auditbeat*

Expand Down Expand Up @@ -358,6 +362,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix handing missing eventtime and assignip field being set to N/A for fortinet module. {pull}22361[22361]
- Fix Zeek dashboard reference to `zeek.ssl.server.name` field. {pull}21696[21696]
- Fix for `field [source] not present as part of path [source.ip]` error in azure pipelines. {pull}22377[22377]
- Properly update offset in case of unparasable line. {pull}22685[22685]
- Drop aws.vpcflow.pkt_srcaddr and aws.vpcflow.pkt_dstaddr when equal to "-". {pull}22721[22721] {issue}22716[22716]
- Fix cisco umbrella module config by adding input variable. {pull}22892[22892]
- Fix network.direction logic in zeek connection fileset. {pull}22967[22967]
Expand All @@ -379,6 +384,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix date parsing in GSuite/login and Google Workspace/login filesets. {issue}24694[24694]
- Fix date parsing in GSuite/login fileset. {issue}24694[24694]
- Improve Cisco ASA/FTD parsing of messages - better support for identity FW messages. Change network.bytes, source.bytes, and destination.bytes to long from integer since value can exceed integer capacity. Add descriptions for various processors for easier pipeline editing in Kibana UI. {pull}23766[23766]
- Updating Oauth2 flow for m365_defender fileset. {pull}24829[24829]
- Improve PanOS parsing and ingest pipeline. {issue}22413[22413] {issue}22748[22748] {pull}24799[24799]

*Heartbeat*

Expand Down Expand Up @@ -490,6 +497,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix remote_write flaky test. {pull}21173[21173]
- Remove io.time from windows {pull}22237[22237]
- Change vsphere.datastore.capacity.used.pct value to betweeen 0 and 1. {pull}23148[23148]
- Fix incorrect types of fields GetHits and Ops in NodeInterestingStats for Couchbase module in Metricbeat {issue}21021[21021] {pull}23287[23287]
- Update config in `windows.yml` file. {issue}23027[23027]{pull}23327[23327]
- Fix metric grouping for windows/perfmon module {issue}23489[23489] {pull}23505[23505]
- Fix GCP not able to request Cloudfunctions metrics if a region filter was set {pull}24218[24218]
Expand Down Expand Up @@ -590,6 +598,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Added "add_network_direction" processor for determining perimeter-based network direction. {pull}23076[23076]
- Added new `rate_limit` processor for enforcing rate limits on event throughput. {pull}22883[22883]
- Allow node/namespace metadata to be disabled on kubernetes metagen and ensure add_kubernetes_metadata honors host {pull}23012[23012]
- Add `wineventlog` schema to `decode_xml` processor. {issue}23910[23910] {pull}24726[24726]

*Auditbeat*

Expand Down Expand Up @@ -803,15 +812,20 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Mark m365 defender, defender atp, okta and google workspace modules as GA {pull}23113[23113]
- Added `alternative_host` option to google pubsub input {pull}23215[23215]
- Support X-Forwarder-For in IIS logs. {pull}19142[192142]
- Add support for logs generated by servers configured with `log_statement` and `log_duration` in PostgreSQL module. {pull}24607[24607]
- Updating field mappings for Cisco AMP module, fixing certain fields. {pull}24661[24661]
- Added NTP fileset to Zeek module {pull}24224[24224]
- Add `proxy_url` config for httpjson v2 input. {issue}24615[24615] {pull}24662[24662]
- Add support for upper case field names in Sophos XG module {pull}24693[24693]
- Add `fail_on_template_error` option for httpjson input. {pull}24784[24784]
- Change `okta.target` to `flattened` field type. {issue}24354[24354] {pull}24636[24636]

*Heartbeat*

- Add mime type detection for http responses. {pull}22976[22976]
- Handle datastreams for fleet. {pull}24223[24223]
- Add --sandbox option for browser monitor. {pull}24172[24172]
- Support additional 'root' fields from synthetics. {pull}24770[24770]

*Journalbeat*

Expand Down Expand Up @@ -935,6 +949,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Move IIS module to GA and map fields. {issue}22609[22609] {pull}23024[23024]
- Apache: convert status.total_kbytes to status.total_bytes in fleet mode. {pull}23022[23022]
- Release MSSQL as GA {pull}23146[23146]
- Add support for SASL/SCRAM authentication to the Kafka module. {pull}24810[24810]

*Packetbeat*

Expand Down
100 changes: 44 additions & 56 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ pipeline {
GOFLAGS = '-mod=readonly'
}
steps {
withGithubNotify(context: "Lint") {
withBeatsEnv(archive: false, id: "lint") {
dumpVariables()
setEnvVar('VERSION', sh(label: 'Get beat version', script: 'make get-version', returnStdout: true)?.trim())
whenTrue(env.ONLY_DOCS == 'true') {
cmd(label: "make check", script: "make check")
}
whenTrue(env.ONLY_DOCS == 'false') {
runLinting()
stageStatusCache(id: 'Lint'){
withGithubNotify(context: "Lint") {
withBeatsEnv(archive: false, id: "lint") {
dumpVariables()
setEnvVar('VERSION', sh(label: 'Get beat version', script: 'make get-version', returnStdout: true)?.trim())
whenTrue(env.ONLY_DOCS == 'true') {
cmd(label: "make check", script: "make check")
}
whenTrue(env.ONLY_DOCS == 'false') {
runLinting()
}
}
}
}
Expand Down Expand Up @@ -252,7 +254,7 @@ def generateStages(Map args = [:]) {
}

def cloud(Map args = [:]) {
withNode(args.label) {
withNode(labels: args.label, sleepMin: 30, sleepMax: 200, forceWorkspace: true){
startCloudTestEnv(name: args.directory, dirs: args.dirs)
}
withCloudTestEnv() {
Expand All @@ -267,7 +269,7 @@ def cloud(Map args = [:]) {
def k8sTest(Map args = [:]) {
def versions = args.versions
versions.each{ v ->
withNode(args.label) {
withNode(labels: args.label, sleepMin: 30, sleepMax: 200, forceWorkspace: true){
stage("${args.context} ${v}"){
withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
withGithubNotify(context: "${args.context} ${v}") {
Expand Down Expand Up @@ -519,7 +521,7 @@ def target(Map args = [:]) {
def isE2E = args.e2e?.get('enabled', false)
def isPackaging = args.get('package', false)
def dockerArch = args.get('dockerArch', 'amd64')
withNode(args.label) {
withNode(labels: args.label, sleepMin: 30, sleepMax: 200, forceWorkspace: true){
withGithubNotify(context: "${context}") {
withBeatsEnv(archive: true, withModule: withModule, directory: directory, id: args.id) {
dumpVariables()
Expand All @@ -546,22 +548,6 @@ def target(Map args = [:]) {
}
}

/**
* This method wraps the node call for two reasons:
* 1. with some latency to avoid the known issue with the scalabitity in gobld.
* 2. allocate a new workspace to workaround the flakiness of windows workers with deleteDir
*/
def withNode(String label, Closure body) {
sleep randomNumber(min: 10, max: 200)
// this should workaround the existing issue with reusing workers with the Gobld
def uuid = UUID.randomUUID().toString()
node(label) {
ws("workspace/${JOB_BASE_NAME}-${BUILD_NUMBER}-${uuid}") {
body()
}
}
}

/**
* This method wraps all the environment setup and pre-requirements to run any commands.
*/
Expand Down Expand Up @@ -999,40 +985,42 @@ class RunCommand extends co.elastic.beats.BeatsFunction {
super(args)
}
public run(Map args = [:]){
def withModule = args.content.get('withModule', false)
if(args?.content?.containsKey('make')) {
steps.target(context: args.context, command: args.content.make, directory: args.project, label: args.label, withModule: withModule, isMage: false, id: args.id)
}
if(args?.content?.containsKey('mage')) {
steps.target(context: args.context, command: args.content.mage, directory: args.project, label: args.label, withModule: withModule, isMage: true, id: args.id)
}
if(args?.content?.containsKey('packaging-arm')) {
steps.packagingArm(context: args.context,
command: args.content.get('packaging-arm'),
directory: args.project,
label: args.label,
isMage: true,
id: args.id,
e2e: args.content.get('e2e'),
package: true,
dockerArch: 'arm64')
}
if(args?.content?.containsKey('packaging-linux')) {
steps.packagingLinux(context: args.context,
command: args.content.get('packaging-linux'),
steps.stageStatusCache(args){
def withModule = args.content.get('withModule', false)
if(args?.content?.containsKey('make')) {
steps.target(context: args.context, command: args.content.make, directory: args.project, label: args.label, withModule: withModule, isMage: false, id: args.id)
}
if(args?.content?.containsKey('mage')) {
steps.target(context: args.context, command: args.content.mage, directory: args.project, label: args.label, withModule: withModule, isMage: true, id: args.id)
}
if(args?.content?.containsKey('packaging-arm')) {
steps.packagingArm(context: args.context,
command: args.content.get('packaging-arm'),
directory: args.project,
label: args.label,
isMage: true,
id: args.id,
e2e: args.content.get('e2e'),
package: true,
dockerArch: 'amd64')
}
if(args?.content?.containsKey('k8sTest')) {
steps.k8sTest(context: args.context, versions: args.content.k8sTest.split(','), label: args.label, id: args.id)
}
if(args?.content?.containsKey('cloud')) {
steps.cloud(context: args.context, command: args.content.cloud, directory: args.project, label: args.label, withModule: withModule, dirs: args.content.dirs, id: args.id)
dockerArch: 'arm64')
}
if(args?.content?.containsKey('packaging-linux')) {
steps.packagingLinux(context: args.context,
command: args.content.get('packaging-linux'),
directory: args.project,
label: args.label,
isMage: true,
id: args.id,
e2e: args.content.get('e2e'),
package: true,
dockerArch: 'amd64')
}
if(args?.content?.containsKey('k8sTest')) {
steps.k8sTest(context: args.context, versions: args.content.k8sTest.split(','), label: args.label, id: args.id)
}
if(args?.content?.containsKey('cloud')) {
steps.cloud(context: args.context, command: args.content.cloud, directory: args.project, label: args.label, withModule: withModule, dirs: args.content.dirs, id: args.id)
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ projects:
- "x-pack/heartbeat"
- "x-pack/libbeat"
- "x-pack/metricbeat"
- "x-pack/osquerybeat"
- "x-pack/packetbeat"
- "x-pack/winlogbeat"
- "dev-tools"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BUILD_DIR=$(CURDIR)/build
COVERAGE_DIR=$(BUILD_DIR)/coverage
BEATS?=auditbeat filebeat heartbeat journalbeat metricbeat packetbeat winlogbeat x-pack/functionbeat x-pack/elastic-agent
BEATS?=auditbeat filebeat heartbeat journalbeat metricbeat packetbeat winlogbeat x-pack/functionbeat x-pack/elastic-agent x-pack/osquerybeat
PROJECTS=libbeat $(BEATS)
PROJECTS_ENV=libbeat filebeat metricbeat
PYTHON_ENV?=$(BUILD_DIR)/python-env
Expand Down
Loading

0 comments on commit 415e012

Please sign in to comment.