@@ -24,6 +24,9 @@ ext.docsFileTree = fileTree(projectDir) {
24
24
exclude ' README.asciidoc'
25
25
// Broken code snippet tests
26
26
exclude ' reference/graph/explore.asciidoc'
27
+ // These files simply don't pass yet. We should figure out how to fix them.
28
+ exclude ' reference/watcher/reference/actions.asciidoc'
29
+ exclude ' reference/rest-api/security/ssl.asciidoc'
27
30
if (BuildParams . inFipsJvm) {
28
31
// We don't support this component in FIPS 140
29
32
exclude ' reference/ingest/processors/attachment.asciidoc'
@@ -48,7 +51,13 @@ tasks.named("buildRestTests").configure {
48
51
' reference/ml/anomaly-detection/apis/post-data.asciidoc' ,
49
52
' reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc' ,
50
53
' reference/ml/anomaly-detection/apis/update-snapshot.asciidoc' ,
51
- ' reference/ml/anomaly-detection/apis/update-job.asciidoc'
54
+ ' reference/ml/anomaly-detection/apis/update-job.asciidoc' ,
55
+ ' reference/security/authentication/user-cache.asciidoc' ,
56
+ ' reference/security/authorization/run-as-privilege.asciidoc' ,
57
+ ' reference/security/ccs-clients-integrations/http.asciidoc' ,
58
+ ' reference/rest-api/watcher/put-watch.asciidoc' ,
59
+ ' reference/rest-api/watcher/stats.asciidoc' ,
60
+ ' reference/watcher/example-watches/watching-time-series-data.asciidoc'
52
61
]
53
62
}
54
63
@@ -74,7 +83,6 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
74
83
75
84
// enable regexes in painless so our tests don't complain about example snippets that use them
76
85
setting ' script.painless.regex.enabled' , ' true'
77
- setting ' xpack.security.enabled' , ' false'
78
86
setting ' path.repo' , " ${ buildDir} /cluster/shared/repo"
79
87
Closure configFile = {
80
88
extraConfigFile it, file(" src/test/cluster/config/$it " )
@@ -102,6 +110,42 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
102
110
requiresFeature ' es.index_mode_feature_flag_registered' , Version . fromString(" 8.0.0" )
103
111
requiresFeature ' es.dlm_feature_flag_enabled' , Version . fromString(" 8.8.0" )
104
112
113
+ extraConfigFile ' op-jwks.json' , project(' :x-pack:test:idp-fixture' ). file(" oidc/op-jwks.json" )
114
+ extraConfigFile ' idp-docs-metadata.xml' , project(' :x-pack:test:idp-fixture' ). file(" idp/shibboleth-idp/metadata/idp-docs-metadata.xml" )
115
+ extraConfigFile ' testClient.crt' , project(' :x-pack:plugin:security' ). file(" src/test/resources/org/elasticsearch/xpack/security/action/pki_delegation/testClient.crt" )
116
+ setting ' xpack.security.enabled' , ' true'
117
+ setting ' xpack.security.authc.api_key.enabled' , ' true'
118
+ setting ' xpack.security.authc.token.enabled' , ' true'
119
+ // disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
120
+ setting ' indices.lifecycle.history_index_enabled' , ' false'
121
+ setting ' xpack.license.self_generated.type' , ' trial'
122
+ setting ' xpack.security.authc.realms.file.file.order' , ' 0'
123
+ setting ' xpack.security.authc.realms.native.native.order' , ' 1'
124
+ setting ' xpack.security.authc.realms.oidc.oidc1.order' , ' 2'
125
+ setting ' xpack.security.authc.realms.oidc.oidc1.op.issuer' , ' http://127.0.0.1:8080'
126
+ setting ' xpack.security.authc.realms.oidc.oidc1.op.authorization_endpoint' , " http://127.0.0.1:8080/c2id-login"
127
+ setting ' xpack.security.authc.realms.oidc.oidc1.op.token_endpoint' , " http://127.0.0.1:8080/c2id/token"
128
+ setting ' xpack.security.authc.realms.oidc.oidc1.op.jwkset_path' , ' op-jwks.json'
129
+ setting ' xpack.security.authc.realms.oidc.oidc1.rp.redirect_uri' , ' https://my.fantastic.rp/cb'
130
+ setting ' xpack.security.authc.realms.oidc.oidc1.rp.client_id' , ' elasticsearch-rp'
131
+ keystore ' xpack.security.authc.realms.oidc.oidc1.rp.client_secret' , ' b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2'
132
+ setting ' xpack.security.authc.realms.oidc.oidc1.rp.response_type' , ' id_token'
133
+ setting ' xpack.security.authc.realms.oidc.oidc1.claims.principal' , ' sub'
134
+ setting ' xpack.security.authc.realms.pki.pki1.order' , ' 3'
135
+ setting ' xpack.security.authc.realms.pki.pki1.certificate_authorities' , ' [ "testClient.crt" ]'
136
+ setting ' xpack.security.authc.realms.pki.pki1.delegation.enabled' , ' true'
137
+ setting ' xpack.security.authc.realms.saml.saml1.order' , ' 4'
138
+ setting ' xpack.security.authc.realms.saml.saml1.sp.logout' , ' https://kibana.org/logout'
139
+ setting ' xpack.security.authc.realms.saml.saml1.idp.entity_id' , ' https://my-idp.org'
140
+ setting ' xpack.security.authc.realms.saml.saml1.idp.metadata.path' , ' idp-docs-metadata.xml'
141
+ setting ' xpack.security.authc.realms.saml.saml1.sp.entity_id' , ' https://kibana.org'
142
+ setting ' xpack.security.authc.realms.saml.saml1.sp.acs' , ' https://kibana.org/api/security/saml/callback'
143
+ setting ' xpack.security.authc.realms.saml.saml1.attributes.principal' , ' uid'
144
+ setting ' xpack.security.authc.realms.saml.saml1.attributes.name' , ' urn:oid:2.5.4.3'
145
+
146
+ user username : ' test_admin'
147
+ user username : ' test_user'
148
+
105
149
// build the cluster with all plugins
106
150
project. rootProject. subprojects. findAll { it. parent. path == ' :plugins' }. each { subproj ->
107
151
/* Skip repositories. We just aren't going to be able to test them so it
@@ -1657,6 +1701,210 @@ setups['setup-snapshots'] = setups['setup-repository'] + '''
1657
1701
body: |
1658
1702
#atomic_red_data#
1659
1703
'''
1704
+
1705
+ setups[' my_inactive_watch' ] = '''
1706
+ - do:
1707
+ watcher.put_watch:
1708
+ id: "my_watch"
1709
+ active: false
1710
+ body: >
1711
+ {
1712
+ "trigger": {
1713
+ "schedule": {
1714
+ "hourly": {
1715
+ "minute": [ 0, 5 ]
1716
+ }
1717
+ }
1718
+ },
1719
+ "input": {
1720
+ "simple": {
1721
+ "payload": {
1722
+ "send": "yes"
1723
+ }
1724
+ }
1725
+ },
1726
+ "condition": {
1727
+ "always": {}
1728
+ },
1729
+ "actions": {
1730
+ "test_index": {
1731
+ "index": {
1732
+ "index": "test"
1733
+ }
1734
+ }
1735
+ }
1736
+ }
1737
+ - match: { _id: "my_watch" }
1738
+ '''
1739
+
1740
+ setups[' my_active_watch' ] = setups[' my_inactive_watch' ]. replace(
1741
+ ' active: false' , ' active: true' )
1742
+
1743
+ setups[' role_mapping' ] = '''
1744
+ - do:
1745
+ security.put_role_mapping:
1746
+ name: "mapping1"
1747
+ body: >
1748
+ {
1749
+ "enabled": true,
1750
+ "roles": [ "user" ],
1751
+ "rules": { "field": { "username": "*" } }
1752
+ }
1753
+ '''
1754
+
1755
+ setups[' admin_role' ] = '''
1756
+ - do:
1757
+ security.put_role:
1758
+ name: "my_admin_role"
1759
+ body: >
1760
+ {
1761
+ "cluster": ["all"],
1762
+ "indices": [
1763
+ {"names": ["index1", "index2" ], "privileges": ["all"], "field_security" : {"grant" : [ "title", "body" ]}}
1764
+ ],
1765
+ "run_as": [ "other_user" ],
1766
+ "metadata" : {"version": 1}
1767
+ }
1768
+ '''
1769
+ setups[' jacknich_user' ] = '''
1770
+ - do:
1771
+ security.put_user:
1772
+ username: "jacknich"
1773
+ body: >
1774
+ {
1775
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
1776
+ "roles" : [ "admin", "other_role1" ],
1777
+ "full_name" : "Jack Nicholson",
1778
+
1779
+ "metadata" : { "intelligence" : 7 }
1780
+ }
1781
+ - do:
1782
+ security.activate_user_profile:
1783
+ body: >
1784
+ {
1785
+ "grant_type": "password",
1786
+ "username": "jacknich",
1787
+ "password" : "l0ng-r4nd0m-p@ssw0rd"
1788
+ }
1789
+ '''
1790
+ setups[' app0102_privileges' ] = '''
1791
+ - do:
1792
+ security.put_privileges:
1793
+ body: >
1794
+ {
1795
+ "myapp": {
1796
+ "read": {
1797
+ "application": "myapp",
1798
+ "name": "read",
1799
+ "actions": [
1800
+ "data:read/*",
1801
+ "action:login" ],
1802
+ "metadata": {
1803
+ "description": "Read access to myapp"
1804
+ }
1805
+ }
1806
+ }
1807
+ }
1808
+ '''
1809
+ setups[' service_token42' ] = '''
1810
+ - do:
1811
+ security.create_service_token:
1812
+ namespace: elastic
1813
+ service: fleet-server
1814
+ name: token42
1815
+ '''
1816
+ setups[' user_profiles' ] = '''
1817
+ - do:
1818
+ security.put_user:
1819
+ username: "jacknich"
1820
+ body: >
1821
+ {
1822
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
1823
+ "roles" : [ "admin", "other_role1" ],
1824
+ "full_name" : "Jack Nicholson",
1825
+
1826
+ }
1827
+ - do:
1828
+ security.put_user:
1829
+ username: "jackrea"
1830
+ body: >
1831
+ {
1832
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
1833
+ "roles" : [ "admin" ],
1834
+ "full_name" : "Jack Reacher",
1835
+
1836
+ }
1837
+ - do:
1838
+ security.put_user:
1839
+ username: "jackspa"
1840
+ body: >
1841
+ {
1842
+ "password" : "l0ng-r4nd0m-p@ssw0rd",
1843
+ "roles" : [ "user" ],
1844
+ "full_name" : "Jack Sparrow",
1845
+
1846
+ }
1847
+ - do:
1848
+ security.activate_user_profile:
1849
+ body: >
1850
+ {
1851
+ "grant_type": "password",
1852
+ "username": "jacknich",
1853
+ "password" : "l0ng-r4nd0m-p@ssw0rd"
1854
+ }
1855
+ - do:
1856
+ security.activate_user_profile:
1857
+ body: >
1858
+ {
1859
+ "grant_type": "password",
1860
+ "username": "jackrea",
1861
+ "password" : "l0ng-r4nd0m-p@ssw0rd"
1862
+ }
1863
+ - do:
1864
+ security.activate_user_profile:
1865
+ body: >
1866
+ {
1867
+ "grant_type": "password",
1868
+ "username": "jackspa",
1869
+ "password" : "l0ng-r4nd0m-p@ssw0rd"
1870
+ }
1871
+ # jacknich
1872
+ - do:
1873
+ security.update_user_profile_data:
1874
+ uid: "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"
1875
+ body: >
1876
+ {
1877
+ "labels": {
1878
+ "direction": "north"
1879
+ },
1880
+ "data": {
1881
+ "app1": {
1882
+ "key1": "value1"
1883
+ }
1884
+ }
1885
+ }
1886
+ # jackrea
1887
+ - do:
1888
+ security.update_user_profile_data:
1889
+ uid: "u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0"
1890
+ body: >
1891
+ {
1892
+ "labels": {
1893
+ "direction": "west"
1894
+ }
1895
+ }
1896
+ # jackspa
1897
+ - do:
1898
+ security.update_user_profile_data:
1899
+ uid: "u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0"
1900
+ body: >
1901
+ {
1902
+ "labels": {
1903
+ "direction": "south"
1904
+ }
1905
+ }
1906
+ '''
1907
+
1660
1908
// fake data used by the correlation bucket agg
1661
1909
buildRestTests. setups[' correlate_latency' ] = '''
1662
1910
- do:
0 commit comments