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

ES Serverless support for FTR serverless tests. SSL support in kbn/es. kbn/es DX improvements. #162673

Merged
merged 235 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 212 commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
00082db
Fix docker pull output for serverless
Ikuni17 Jul 28, 2023
3fed98b
WIP Add esFrom serverless
Ikuni17 Jul 28, 2023
2bc6499
Merge remote-tracking branch 'origin/main' into test/162593/kbn-es-se…
Ikuni17 Jul 28, 2023
243e163
Move esTestCluster to base shared config
Ikuni17 Jul 28, 2023
fb63a14
Add support for custom ports
Ikuni17 Jul 28, 2023
4d5c1cb
env var for ES to bind to custom port
Ikuni17 Jul 28, 2023
81f273c
Fix type check
Ikuni17 Jul 28, 2023
37bd9c5
pass serverless flag through
Ikuni17 Jul 28, 2023
562624c
Graceful shutdown of serverless nodes
Ikuni17 Jul 29, 2023
8dacb90
Add docker login to buildkite serverless
Ikuni17 Jul 29, 2023
448e42f
Merge remote-tracking branch 'origin/main' into test/162593/kbn-es-se…
Ikuni17 Jul 31, 2023
71045f1
Merge remote-tracking branch 'origin/main' into test/162593/kbn-es-se…
Ikuni17 Aug 1, 2023
f6044c0
Docker login for serverless security
Ikuni17 Aug 1, 2023
19f116c
testing: only detach nodes 2 and 3
Ikuni17 Aug 1, 2023
e613a32
Increase vm memory
Ikuni17 Aug 1, 2023
6b467f2
sudo
Ikuni17 Aug 1, 2023
e9c0ee1
test bigger node for serverless
Ikuni17 Aug 1, 2023
cdd1ba7
Revert "test bigger node for serverless"
Ikuni17 Aug 1, 2023
ebad37b
Merge remote-tracking branch 'origin/main' into test/162593/kbn-es-se…
Ikuni17 Aug 2, 2023
514d8c4
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 3, 2023
84adcfc
Revert sysctl in sh scripts
Ikuni17 Aug 3, 2023
50cec71
Revert "testing: only detach nodes 2 and 3"
Ikuni17 Aug 3, 2023
f26c158
Pull image separate from run command
Ikuni17 Aug 3, 2023
ff5eb5b
Add maybePullDockerImage tests. Fix tests with setupDocker usage
Ikuni17 Aug 3, 2023
bb1ff0e
Revert "Fix docker pull output for serverless"
Ikuni17 Aug 3, 2023
eb995e5
Cleanup
Ikuni17 Aug 4, 2023
68082f6
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 4, 2023
fb8ecf0
Cleanup
Ikuni17 Aug 4, 2023
fd22857
Error handling for maybePull
Ikuni17 Aug 4, 2023
cd422d8
test detach
Ikuni17 Aug 4, 2023
0361957
sleep
Ikuni17 Aug 4, 2023
e1bf852
Revert "test detach"
Ikuni17 Aug 4, 2023
54881f4
Revert "sleep"
Ikuni17 Aug 4, 2023
fe798e7
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 7, 2023
1353963
Use clean object store
Ikuni17 Aug 7, 2023
f2f50e9
pull docker logs
Ikuni17 Aug 7, 2023
a59bb6f
adjust log style for serverless
Ikuni17 Aug 7, 2023
bbae241
log chmod
Ikuni17 Aug 7, 2023
9e29b45
adjust base path permissions
Ikuni17 Aug 7, 2023
bf9f262
change to 777
Ikuni17 Aug 7, 2023
9b77f4a
Turn off logging. Add user perm
Ikuni17 Aug 7, 2023
bd5554f
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 8, 2023
af30185
enable logging
Ikuni17 Aug 8, 2023
8b6eabc
remove detach
Ikuni17 Aug 8, 2023
45f8154
Add privileged. Remove userCmd. Turn on log
Ikuni17 Aug 8, 2023
7b856d7
Add user namespace host
Ikuni17 Aug 8, 2023
7e370c6
attach
Ikuni17 Aug 8, 2023
f5035d0
Z selinux, remove privileged
Ikuni17 Aug 8, 2023
a7bbaff
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 9, 2023
d1c4fb4
z flag. detach
Ikuni17 Aug 9, 2023
e6b99da
user namespace
Ikuni17 Aug 9, 2023
e20600b
Cleanup stop cluster
Ikuni17 Aug 9, 2023
880c7ef
Add test for stopServerlessCluster
Ikuni17 Aug 9, 2023
6491853
attach
Ikuni17 Aug 9, 2023
c3eb57e
user cmd
Ikuni17 Aug 9, 2023
a803c14
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 10, 2023
ab10861
add sleep
Ikuni17 Aug 10, 2023
a53c6ac
chmod 777. temp fix tag
Ikuni17 Aug 10, 2023
42ab9e4
Cleanup. Maybe fix shutdown
Ikuni17 Aug 10, 2023
07f69dc
Fix incorrect var
Ikuni17 Aug 10, 2023
ca8eb4e
Allow serverless esFrom flag
Ikuni17 Aug 11, 2023
4a01ee1
Fix snapshot overriding config setting
Ikuni17 Aug 11, 2023
73865ea
Fix type check
Ikuni17 Aug 11, 2023
2936e17
Fix volume test
Ikuni17 Aug 11, 2023
62edf60
Fix flags test
Ikuni17 Aug 11, 2023
368ff74
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 11, 2023
939b77c
fix latest tag
Ikuni17 Aug 11, 2023
c88d3b5
Skip avatar test
Ikuni17 Aug 11, 2023
68527e9
Cleanup
Ikuni17 Aug 11, 2023
84d0bc0
Pass esArgs
Ikuni17 Aug 11, 2023
7c7af43
align settings with gradlew
Ikuni17 Aug 11, 2023
b3663ec
small fix
Ikuni17 Aug 11, 2023
f22beab
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 14, 2023
242e63e
Remove es workaround. Add -i -t
Ikuni17 Aug 15, 2023
7265db7
Add teardownServerlessClusterSync and tests
Ikuni17 Aug 15, 2023
ce2fde9
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 15, 2023
6d9f3ed
Skip search test requiring auth
Ikuni17 Aug 15, 2023
8ad0fdd
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 16, 2023
72e0221
WIP ssl working
Ikuni17 Aug 16, 2023
a8a8e59
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 16, 2023
d03cd7b
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
dmlemeshko Aug 17, 2023
943ac2d
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 17, 2023
0d076c6
Remove skips
Ikuni17 Aug 17, 2023
140f027
WIP operator and service token setup
Ikuni17 Aug 17, 2023
ca11529
Restore password
Ikuni17 Aug 17, 2023
831ffd8
Cleanup paths. Add ess_resources
Ikuni17 Aug 17, 2023
75cd21e
Add readme
Ikuni17 Aug 17, 2023
48c6a8c
Switch to p12 key
Ikuni17 Aug 17, 2023
c032116
Add HTTP SSL
Ikuni17 Aug 17, 2023
568ae36
remove :z on p12
Ikuni17 Aug 17, 2023
b3d400d
Add SSL flags. Update tests for SSL support. Add Docker support for SSL
Ikuni17 Aug 17, 2023
33e39e0
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 17, 2023
f64cf90
Merge branches 'test/162593/kbn-es-serverless-ftr' and 'test/162593/k…
Ikuni17 Aug 17, 2023
8c13482
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 21, 2023
e3e0fed
Add kibana service account token
Ikuni17 Aug 21, 2023
1fa9515
default cluster to ssl. disable http ssl
Ikuni17 Aug 21, 2023
c35b336
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 21, 2023
b11f481
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 21, 2023
4498be9
Merge remote-tracking branch 'upstream/main' into test/162593/kbn-es-…
Ikuni17 Aug 22, 2023
44f1da1
chore(NA): support sideloaded users login on ess
mistic Aug 22, 2023
8bb285b
cleanup
Ikuni17 Aug 22, 2023
ba4a7b2
Update ess resources readme
Ikuni17 Aug 22, 2023
d7ebab7
Add roles and role mapping. Improve volume setup
Ikuni17 Aug 22, 2023
6b80d92
Fix tests
Ikuni17 Aug 22, 2023
173059f
Add missing roles files
Ikuni17 Aug 22, 2023
b7e86ca
Allow passing user into getUrlParts
Ikuni17 Aug 22, 2023
2fa1e58
Teardown cluster if non-default image
Ikuni17 Aug 22, 2023
f149d07
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 22, 2023
98fa37c
Add CLI option to kill existing nodes on startup
Ikuni17 Aug 22, 2023
a33f646
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 22, 2023
e6dcac3
Automatically attach logs
Ikuni17 Aug 22, 2023
13399f1
chore(NA): adding system_indices_superuser
mistic Aug 23, 2023
c78abea
chore(NA): whitelist users on operators
mistic Aug 23, 2023
11477f5
chore(NA): specific role for system_indices_superuser
mistic Aug 23, 2023
2bdaf3a
chore(NA): update roles
mistic Aug 23, 2023
657c47c
chore(NA): apply changes to parallel script from security solution
mistic Aug 23, 2023
8e1a934
chore(NA): login on docker
mistic Aug 23, 2023
f864cd4
chore(NA): more predefined roles
mistic Aug 23, 2023
5230289
chore(NA): merge and solve conflicts with main
mistic Aug 24, 2023
281d994
chore(NA): skip unsupported setting
mistic Aug 24, 2023
37cf475
volume test fix
Ikuni17 Aug 24, 2023
033fbbd
Revert "Allow Kibana to restrict the usage of JWT for a predefined se…
mistic Aug 24, 2023
7d78261
disable http ssl
Ikuni17 Aug 24, 2023
0b1ecdc
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 24, 2023
5b66105
Update ess resources readme for adding users
Ikuni17 Aug 24, 2023
35e777e
Revert "Prepare the Security domain HTTP APIs for Serverless (#162087)"
mistic Aug 24, 2023
189a0d7
chore(NA): docker login on serverless osquery
mistic Aug 24, 2023
14fa7f3
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 24, 2023
27294e1
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
mistic Aug 25, 2023
a8b0748
Support secrets.json. Fix deprecation warnings for SSL
Ikuni17 Aug 25, 2023
ceb3d0c
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 25, 2023
cb8e6bf
Remove comment about deprecation
Ikuni17 Aug 25, 2023
03f7373
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
mistic Aug 25, 2023
23f4c8a
chore(NA): add service token when running kibana dev mode in serverless
mistic Aug 25, 2023
4f61f50
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 25, 2023
c5181f9
chore(NA): only load secrets.json into the volume when ssl
mistic Aug 25, 2023
aba550d
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 25, 2023
6f700c6
skip tests depended on alerts
patrykkopycinski Aug 25, 2023
48911eb
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
patrykkopycinski Aug 25, 2023
bc7b1ab
Revert "Revert "Prepare the Security domain HTTP APIs for Serverless …
Ikuni17 Aug 25, 2023
bb48938
Add support for mounting files into containers
Ikuni17 Aug 25, 2023
85b6ca9
chore(NA): enable ssl for shared serverless config
mistic Aug 25, 2023
235f53b
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 25, 2023
24d9de5
Use https for ess
Ikuni17 Aug 25, 2023
02d6734
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 25, 2023
52e0082
Add ES CA
Ikuni17 Aug 25, 2023
36436fc
Add CA to kibana config
Ikuni17 Aug 25, 2023
584e666
Revert "Revert "Allow Kibana to restrict the usage of JWT for a prede…
mistic Aug 25, 2023
764d6f2
Merge remote-tracking branch 'brad/test/162593/kbn-es-serverless-ftr'…
mistic Aug 25, 2023
993ec6f
fix(NA): wrong saml setting on shared serverless config
mistic Aug 25, 2023
4e7625c
Fix jwt PR secrets, file mount
Ikuni17 Aug 25, 2023
a42379b
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
mistic Aug 25, 2023
21dfc6d
refact(NA): move kibana dev service account out of @kbn/test
mistic Aug 26, 2023
cc40983
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 26, 2023
d8daf94
fix(NA): isolated init of yarn es serverless --ssl
mistic Aug 26, 2023
c7beba4
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 26, 2023
b0b1626
refact(NA): change kibana_serverless_superuser to elastic_serverless
mistic Aug 26, 2023
5d40377
Merge remote-tracking branch 'brad/test/162593/kbn-es-serverless-ftr'…
mistic Aug 26, 2023
59a303f
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
mistic Aug 26, 2023
13d5ad1
support ssl
patrykkopycinski Aug 26, 2023
039b863
fix(NA): running cypress tests parallel on serverless
mistic Aug 26, 2023
b99c4e7
chore(NA): remove debugger statement
mistic Aug 26, 2023
e985055
fix(NA): remove hardcoded port
mistic Aug 26, 2023
45e2e9e
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 26, 2023
9752249
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 26, 2023
8fe4539
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
patrykkopycinski Aug 27, 2023
da17dc2
add ca certificate to esClient and kbnClient for es_archiver
patrykkopycinski Aug 27, 2023
214e69d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 27, 2023
6bf366a
fix
patrykkopycinski Aug 27, 2023
511979c
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
patrykkopycinski Aug 27, 2023
c67ef87
fix
patrykkopycinski Aug 27, 2023
500cf7b
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 27, 2023
89a050f
skip broken tests
patrykkopycinski Aug 28, 2023
a5e67aa
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
patrykkopycinski Aug 28, 2023
a588e64
fix
patrykkopycinski Aug 28, 2023
f699fab
skip failing tests
patrykkopycinski Aug 28, 2023
cb2c24c
skip
patrykkopycinski Aug 28, 2023
fefe102
Merge branch 'main' of github.com:elastic/kibana into test/162593/kbn…
patrykkopycinski Aug 28, 2023
0d38797
skip
patrykkopycinski Aug 28, 2023
6e4b6bd
fix
patrykkopycinski Aug 28, 2023
af4bf17
chore(NA): include cert authorities on base config
mistic Aug 28, 2023
12fa58d
fix(NA): base config supertest service
mistic Aug 28, 2023
b114357
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 28, 2023
3ffdefa
fix(NA): introduce function for supertest service
mistic Aug 28, 2023
09cb204
chore(NA): merge and solve conflicts with main
mistic Aug 28, 2023
fd34dc2
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 28, 2023
7c6e45a
chore(NA): merge and solve conflicts with main
mistic Aug 28, 2023
dc51e20
Merge remote-tracking branch 'brad/test/162593/kbn-es-serverless-ftr'…
mistic Aug 28, 2023
bd81652
chore(NA): introduced supertest for serverless api_integration
mistic Aug 28, 2023
59082e1
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 28, 2023
c3211db
chore(NA): skip alerts cypress serverless test
mistic Aug 28, 2023
b8ab3c0
Merge remote-tracking branch 'brad/test/162593/kbn-es-serverless-ftr'…
mistic Aug 28, 2023
1467ca0
Split jwt esargs for ess to fix docker ssl
Ikuni17 Aug 29, 2023
a97f64c
fix(NA): test_serverless observability config
mistic Aug 29, 2023
066893d
fix(NA): add on more brokenInServerless tag
mistic Aug 29, 2023
0f96b98
Merge branches 'test/162593/kbn-es-serverless-ftr' and 'test/162593/k…
Ikuni17 Aug 29, 2023
74ab885
fix(NA): a couple more cypress tests
mistic Aug 29, 2023
60c7742
chore(NA): skip one more test
mistic Aug 29, 2023
772312e
chore(NA): skip one more test
mistic Aug 29, 2023
ab26adf
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 29, 2023
7661fba
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 29, 2023
9041e77
Remove cert skip - fixed
Ikuni17 Aug 29, 2023
337da79
Remove cert skip - fixed
Ikuni17 Aug 29, 2023
76e8559
Remove cert skip - fixed
Ikuni17 Aug 29, 2023
8710578
Change skip reason
Ikuni17 Aug 29, 2023
e9d16a0
Change skip reason
Ikuni17 Aug 29, 2023
bb850b7
Remove cert skip - fixed
Ikuni17 Aug 29, 2023
1e30407
Remove cert skip - fixed
Ikuni17 Aug 29, 2023
9289a75
Remove cert skip - fixed. Skip failure
Ikuni17 Aug 29, 2023
18ed3ea
Add skip
Ikuni17 Aug 29, 2023
79b4cbd
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 29, 2023
0e6314e
fix
patrykkopycinski Aug 29, 2023
5d8ebd6
skipping api_integration tests from obs
mistic Aug 29, 2023
9f19423
fix(NA): skip failing tests on apm_api_integration/feature_flags.ts
mistic Aug 29, 2023
82924a6
chore(NA): unskip cases/list_view.ts test
mistic Aug 29, 2023
1765ad0
chore(NA): remove failing comment
mistic Aug 29, 2023
66ff90e
chore(NA): merge and solve conflicts with main
mistic Aug 29, 2023
ebd3a95
chore(NA): unskip home.cy.ts
mistic Aug 29, 2023
9ed2692
fix(NA): add @brokenInServerless to cell_actions.cy.ts
mistic Aug 29, 2023
93bcc14
Add security threat hunting issue
Ikuni17 Aug 29, 2023
3629766
Add observability issue
Ikuni17 Aug 29, 2023
6d37b5b
More obs issues
Ikuni17 Aug 29, 2023
5350127
Response ops issue
Ikuni17 Aug 29, 2023
b63c021
chore(NA): skip burning specs that are buggy with respect to tags
mistic Aug 29, 2023
4faeae4
Add kill to FTR for safety
Ikuni17 Aug 29, 2023
323572b
Merge branch 'test/162593/kbn-es-serverless-ftr' of github.com:Ikuni1…
Ikuni17 Aug 29, 2023
1136a48
Update alert_details_right_panel_json_tab.cy.ts
patrykkopycinski Aug 30, 2023
4e75fc2
fix test
patrykkopycinski Aug 30, 2023
5368cb6
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
mistic Aug 30, 2023
80a7a44
chore(NA): merge and solve conflicts with main
mistic Aug 30, 2023
383a776
split sourcerer
patrykkopycinski Aug 30, 2023
bfe0188
Merge branch 'main' of github.com:elastic/kibana into test/162593/kbn…
patrykkopycinski Aug 30, 2023
d790522
fix(NA): remove extra log declaration from parallel.ts
mistic Aug 30, 2023
f1fee62
fix
patrykkopycinski Aug 30, 2023
c54fb7b
Merge branch 'main' into test/162593/kbn-es-serverless-ftr
patrykkopycinski Aug 30, 2023
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
27 changes: 14 additions & 13 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,20 @@ steps:
artifact_paths:
- "target/kibana-security-solution/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_defend_workflows.sh
label: 'Serverless Security Defend Workflows Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
soft_fail: true
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
# status_exception: Native role management is not enabled in this Elasticsearch instance
# - command: .buildkite/scripts/steps/functional/security_serverless_defend_workflows.sh
# label: 'Serverless Security Defend Workflows Cypress Tests'
# agents:
# queue: n2-4-spot
# depends_on: build
# timeout_in_minutes: 40
# soft_fail: true
# retry:
# automatic:
# - exit_status: '*'
# limit: 1
# artifact_paths:
# - "target/kibana-security-solution/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_investigations.sh
label: 'Serverless Security Investigations Cypress Tests'
Expand Down
6 changes: 3 additions & 3 deletions .buildkite/pipelines/pull_request/defend_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ steps:
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
timeout_in_minutes: 60
parallelism: 2
retry:
automatic:
Expand All @@ -18,8 +18,8 @@ steps:
agents:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 120
parallelism: 5
timeout_in_minutes: 60
parallelism: 6
retry:
automatic:
- exit_status: '*'
Expand Down
27 changes: 14 additions & 13 deletions .buildkite/pipelines/pull_request/osquery_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ steps:
artifact_paths:
- "target/kibana-osquery/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_osquery.sh
label: 'Serverless Osquery Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 50
parallelism: 6
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-osquery/**/*"
# Error: self-signed certificate in certificate chain
# - command: .buildkite/scripts/steps/functional/security_serverless_osquery.sh
# label: 'Serverless Osquery Cypress Tests'
# agents:
# queue: n2-4-spot
# depends_on: build
# timeout_in_minutes: 50
# parallelism: 6
# retry:
# automatic:
# - exit_status: '*'
# limit: 1
# artifact_paths:
# - "target/kibana-osquery/**/*"
4 changes: 4 additions & 0 deletions .buildkite/scripts/steps/functional/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ if [[ -d "$cacheDir" ]]; then
fi

is_test_execution_step

# logins into docker as a common step for functional tests
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -euo pipefail

source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/functional/common.sh
source .buildkite/scripts/steps/functional/common_cypress.sh

.buildkite/scripts/bootstrap.sh
# TODO: remove the line below to use build artifacts for tests.
# in addition to remove the line, we will have to expose the kibana install dir into the downloaded build location
# by exporting a var like:
# export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}
node scripts/build_kibana_platform_plugins.js

export JOB=kibana-osquery-cypress-serverless
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-dev-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export {
KBN_P12_PATH,
KBN_P12_PASSWORD,
} from './src/certs';
export * from './src/dev_service_account';
export * from './src/axios';
export * from './src/plugin_list';
export * from './src/streams';
Expand Down
19 changes: 19 additions & 0 deletions packages/kbn-dev-utils/src/dev_service_account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

const env = process.env;

/**
* `kibana-dev` service account token for connecting to ESS
* See packages/kbn-es/src/ess_resources/README.md
*/
export const kibanaDevServiceAccount = {
token:
env.TEST_KIBANA_SERVICE_ACCOUNT_TOKEN ||
'AAEAAWVsYXN0aWMva2liYW5hL2tpYmFuYS1kZXY6VVVVVVVVTEstKiBaNA',
};
7 changes: 6 additions & 1 deletion packages/kbn-es/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@

export { run } from './src/cli';
export { Cluster } from './src/cluster';
export { SYSTEM_INDICES_SUPERUSER } from './src/utils';
export {
SYSTEM_INDICES_SUPERUSER,
ELASTIC_SERVERLESS_SUPERUSER,
ELASTIC_SERVERLESS_SUPERUSER_PASSWORD,
getDockerFileMountPath,
} from './src/utils';
8 changes: 7 additions & 1 deletion packages/kbn-es/src/cli_commands/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ToolingLog } from '@kbn/tooling-log';
import { getTimeReporter } from '@kbn/ci-stats-reporter';

import { Cluster } from '../cluster';
import { DOCKER_IMG, DOCKER_REPO, DOCKER_TAG } from '../utils';
import { DOCKER_IMG, DOCKER_REPO, DOCKER_TAG, DEFAULT_PORT } from '../utils';
import { Command } from './types';

export const docker: Command = {
Expand All @@ -27,8 +27,12 @@ export const docker: Command = {
--tag Image tag of ES to run from ${DOCKER_REPO} [default: ${DOCKER_TAG}]
--image Full path to image of ES to run, has precedence over tag. [default: ${DOCKER_IMG}]
--password Sets password for elastic user [default: ${password}]
--port The port to bind to on 127.0.0.1 [default: ${DEFAULT_PORT}]
--ssl Sets up SSL on Elasticsearch
--kill Kill running ES nodes if detected
-E Additional key=value settings to pass to Elasticsearch
-D Override Docker command
-F Absolute paths for files to mount into container

Examples:

Expand All @@ -50,9 +54,11 @@ export const docker: Command = {
alias: {
esArgs: 'E',
dockerCmd: 'D',
files: 'F',
},

string: ['tag', 'image', 'D'],
boolean: ['ssl', 'kill'],

default: defaults,
});
Expand Down
14 changes: 10 additions & 4 deletions packages/kbn-es/src/cli_commands/serverless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ToolingLog } from '@kbn/tooling-log';
import { getTimeReporter } from '@kbn/ci-stats-reporter';

import { Cluster } from '../cluster';
import { SERVERLESS_REPO, SERVERLESS_TAG, SERVERLESS_IMG } from '../utils';
import { SERVERLESS_REPO, SERVERLESS_TAG, SERVERLESS_IMG, DEFAULT_PORT } from '../utils';
import { Command } from './types';

export const serverless: Command = {
Expand All @@ -22,10 +22,15 @@ export const serverless: Command = {
return dedent`
Options:

--tag Image tag of ES Serverless to run from ${SERVERLESS_REPO} [default: ${SERVERLESS_TAG}]
--image Full path of ES Serverless image to run, has precedence over tag. [default: ${SERVERLESS_IMG}]
--tag Image tag of ESS to run from ${SERVERLESS_REPO} [default: ${SERVERLESS_TAG}]
--image Full path of ESS image to run, has precedence over tag. [default: ${SERVERLESS_IMG}]
--clean Remove existing file system object store before running
--port The port to bind to on 127.0.0.1 [default: ${DEFAULT_PORT}]
--ssl Sets up SSL on Elasticsearch
--kill Kill running ESS nodes if detected
--background Start ESS without attaching to the first node's logs
-E Additional key=value settings to pass to Elasticsearch
-F Absolute paths for files to mount into containers

Examples:

Expand All @@ -46,10 +51,11 @@ export const serverless: Command = {
alias: {
basePath: 'base-path',
esArgs: 'E',
files: 'F',
},

string: ['tag', 'image'],
boolean: ['clean'],
boolean: ['clean', 'ssl', 'kill', 'background'],

default: defaults,
});
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-es/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ const { Client } = require('@elastic/elasticsearch');
const { downloadSnapshot, installSnapshot, installSource, installArchive } = require('./install');
const { ES_BIN, ES_PLUGIN_BIN, ES_KEYSTORE_BIN } = require('./paths');
const {
log: defaultLog,
parseEsLog,
extractConfigFiles,
log: defaultLog,
NativeRealm,
parseEsLog,
parseTimeoutToMs,
runServerlessCluster,
runDockerContainer,
runServerlessCluster,
stopServerlessCluster,
teardownServerlessClusterSync,
} = require('./utils');
const { createCliError } = require('./errors');
const { promisify } = require('util');
Expand Down Expand Up @@ -276,6 +278,10 @@ exports.Cluster = class Cluster {
}
this._stopCalled = true;

if (this._serverlessNodes?.length) {
return await stopServerlessCluster(this._log, this._serverlessNodes);
}
Ikuni17 marked this conversation as resolved.
Show resolved Hide resolved

if (!this._process || !this._outcome) {
throw new Error('ES has not been started');
}
Expand All @@ -295,6 +301,10 @@ exports.Cluster = class Cluster {

this._stopCalled;

if (this._serverlessNodes?.length) {
return await stopServerlessCluster(this._log, this._serverlessNodes);
}

if (!this._process || !this._outcome) {
throw new Error('ES has not been started');
}
Expand Down Expand Up @@ -573,7 +583,15 @@ exports.Cluster = class Cluster {
throw new Error('ES has already been started');
}

await runServerlessCluster(this._log, options);
this._serverlessNodes = await runServerlessCluster(this._log, options);

if (options.teardown) {
/**
* Ideally would be async and an event like beforeExit or SIGINT,
* but those events are not being triggered in FTR child process.
*/
process.on('exit', () => teardownServerlessClusterSync(this._log, options));
}
}

/**
Expand Down
49 changes: 49 additions & 0 deletions packages/kbn-es/src/ess_resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Elasticsearch Serverless Resources
The resources in this directory are used for seeding Elasticsearch Serverless (ESS) images with users, roles and tokens for SSL and authentication. ESS requires file realm authentication, so we will bind mount them into the containers at `/usr/share/elasticsearch/config/`.

## Users

### Default user

The default superuser authentication to login to Kibana is:

```
username: elastic_serverless
password: changeme
```

### Adding users
mistic marked this conversation as resolved.
Show resolved Hide resolved

1. Add the user:encrypted_password to `users` file. The encrypted password for `elastic_serverless` is `changeme` if you want to reuse the value.
1. Set the new user's roles in `users_roles` file.
1. Add the username to `operator_users.yml` in the array for file realm users.


## Service Account and Tokens

This section for Service Accounts was originally from the [ESS repository](https://github.com/elastic/elasticsearch-serverless/blob/main/serverless-build-tools/src/main/resources/README.service_tokens.md).

The "service_tokens" file contains this line:
```
elastic/kibana/kibana-dev:$2a$10$mY2RuGROhk56vLNh.Mgwue98BnkdQPlTR.yGh38ao5jhPJobvuBCq
```

That line defines a single service token
- For the `elastic/kibana` service account
- The token is named `kibana-dev`
- The token's secret is hashed using bcrypt (`$2a$`) using `10` rounds

Although Elasticsearch used PBKDF2_STRETCH by default, the k8s controller
creates tokens using bcrypt, so we mimic that here.

The hash is not reversible, so this README is here to tell you what the secret is.
The secret value is: `UUUUUULK-* Z4`
That produces an encoded token of: `AAEAAWVsYXN0aWMva2liYW5hL2tpYmFuYS1kZXY6VVVVVVVVTEstKiBaNA`
Yes, the secret was specially chosen to produce an encoded value that can be more easily recognised in development.

If a node is configured to use this `service_tokens` file, then you can authenticate to it with
```
curl -H "Authorization: Bearer AAEAAWVsYXN0aWMva2liYW5hL2tpYmFuYS1kZXY6VVVVVVVVTEstKiBaNA" http://localhost:9200/_security/_authenticate
```

The name of the token (`kibana-dev`) is important because the `operator_users.yml` file designates that token as an operator and allows us to seed an ESS cluster with this token.
10 changes: 10 additions & 0 deletions packages/kbn-es/src/ess_resources/jwks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"keys": [
{
"kty": "RSA",
"e": "AQAB",
"use": "sig",
"n": "v9-88aGdE4E85PuEycxTA6LkM3TBvNScoeP6A-dd0Myo6-LfBlp1r7BPBWmvi_SC6Zam3U1LE3AekDMwqJg304my0pvh8wOwlmRpgKXDXjvj4s59vdeVNhCB9doIthUABd310o9lyb55fWc_qQYE2LK9AyEjicJswafguH6txV4IwSl13ieZAxni0Ca4CwdzXO1Oi34XjHF8F5x_0puTaQzHn5bPG4fiIJN-pwie0Ba4VEDPO5ca4lLXWVi1bn8xMDTAULrBAXJwDaDdS05KMbc4sPlyQPhtY1gcYvUbozUPYxSWwA7fZgFzV_h-uy_oXf1EXttOxSgog1z3cJzf6Q"
}
]
}
9 changes: 9 additions & 0 deletions packages/kbn-es/src/ess_resources/operator_users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
operator:
- usernames: ["elastic_serverless", "system_indices_superuser"]
realm_type: "file"
auth_type: "realm"
- usernames: [ "elastic/kibana" ]
realm_type: "_service_account"
auth_type: "token"
token_source: "file"
token_names: [ "kibana-dev" ]
14 changes: 14 additions & 0 deletions packages/kbn-es/src/ess_resources/role_mapping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Role mapping configuration file which has elasticsearch roles as keys
# that map to one or more user or group distinguished names

#roleA: this is an elasticsearch role
# - groupA-DN this is a group distinguished name
# - groupB-DN
# - user1-DN this is the full user distinguished name

#power_user:
# - "cn=admins,dc=example,dc=com"
#user:
# - "cn=users,dc=example,dc=com"
# - "cn=admins,dc=example,dc=com"
# - "cn=John Doe,cn=other users,dc=example,dc=com"
Loading