Skip to content

Commit aa9556e

Browse files
authored
Merge branch 'main' into fix/merge_non_empty_results
2 parents 2e4d9dc + 549fddb commit aa9556e

File tree

768 files changed

+20769
-7951
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

768 files changed

+20769
-7951
lines changed

.buildkite/pipelines/pull-request/part-1-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-1-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart1

.buildkite/pipelines/pull-request/part-2-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-2-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart2

.buildkite/pipelines/pull-request/part-3-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-3-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart3

.buildkite/pipelines/pull-request/part-4-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-4-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart4

.buildkite/pipelines/pull-request/part-5-fips.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
config:
2-
allow-labels: "Team:Security"
2+
allow-labels:
3+
- Team:Security
4+
- test-fips
35
steps:
46
- label: part-5-fips
57
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true checkPart5

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public enum DockerBase {
1616
// "latest" here is intentional, since the image name specifies "9"
17-
DEFAULT("docker.elastic.co/ubi9/ubi-minimal:latest", "", "microdnf"),
17+
DEFAULT("redhat/ubi9-minimal:latest", "", "microdnf"),
1818

1919
// The Iron Bank base image is UBI (albeit hardened), but we are required to parameterize the Docker build
2020
IRON_BANK("${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}", "-ironbank", "yum"),

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dra/DraResolvePlugin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ private void configureDraRepository(
7373
patternLayout.artifact(
7474
String.format("/%s/%s/downloads/%s/[module]/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
7575
);
76+
77+
if ("beats".equals(draKey)) {
78+
// we don't have a good pattern here for beats fips specific images
79+
patternLayout.artifact(
80+
String.format("/%s/%s/downloads/%s/metricbeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
81+
);
82+
patternLayout.artifact(
83+
String.format("/%s/%s/downloads/%s/filebeat/[module]-[revision]-[classifier].[ext]", draKey, buildId, draKey)
84+
);
85+
}
7686
});
7787
repo.metadataSources(metadataSources -> metadataSources.artifact());
7888
repo.content(repositoryContentDescriptor -> repositoryContentDescriptor.includeVersionByRegex(".*", ".*", includeVersionRegex));

distribution/docker/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ if (useDra == false) {
5757
patternLayout {
5858
if (VersionProperties.isElasticsearchSnapshot()) {
5959
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
60+
artifact '/[organization]/[revision]/downloads/[organization]/filebeat/[module]-[revision]-[classifier].[ext]'
61+
artifact '/[organization]/[revision]/downloads/[organization]/metricbeat/[module]-[revision]-[classifier].[ext]'
6062
} else {
6163
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
6264
// Release builds are always done with a local repo.
6365
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
66+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/filebeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
67+
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/metricbeat/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
6468
}
6569
}
6670
}
@@ -93,9 +97,13 @@ configurations {
9397
tini
9498
allPlugins
9599
filebeat_aarch64
100+
filebeat_fips_aarch64
96101
filebeat_x86_64
102+
filebeat_fips_x86_64
97103
metricbeat_aarch64
104+
metricbeat_fips_aarch64
98105
metricbeat_x86_64
106+
metricbeat_fips_x86_64
99107
fips
100108
}
101109

@@ -111,8 +119,15 @@ dependencies {
111119
allPlugins project(path: ':plugins', configuration: 'allPlugins')
112120
filebeat_aarch64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
113121
filebeat_x86_64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
122+
filebeat_fips_aarch64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
123+
filebeat_fips_x86_64 "beats:filebeat-fips:${VersionProperties.elasticsearch}:[email protected]"
124+
114125
metricbeat_aarch64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
115126
metricbeat_x86_64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
127+
128+
metricbeat_fips_aarch64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
129+
metricbeat_fips_x86_64 "beats:metricbeat-fips:${VersionProperties.elasticsearch}:[email protected]"
130+
116131
fips "org.bouncycastle:bc-fips:1.0.2.5"
117132
fips "org.bouncycastle:bctls-fips:1.0.19"
118133
}
@@ -301,8 +316,8 @@ void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
301316
boolean includeBeats = VersionProperties.isElasticsearchSnapshot() == true || buildId != null || useDra
302317

303318
if (includeBeats) {
304-
from configurations.getByName("filebeat_${architecture.classifier}")
305-
from configurations.getByName("metricbeat_${architecture.classifier}")
319+
from configurations.getByName("filebeat_fips_${architecture.classifier}")
320+
from configurations.getByName("metricbeat_fips_${architecture.classifier}")
306321
// For some reason, the artifact name can differ depending on what repository we used.
307322
rename ~/((?:file|metric)beat)-.*\.tar\.gz$/, "\$1-${VersionProperties.elasticsearch}.tar.gz"
308323
}

distribution/tools/plugin-cli/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ dependencies {
2424
compileOnly project(":libs:cli")
2525
implementation project(":libs:plugin-api")
2626
implementation project(":libs:plugin-scanner")
27-
// TODO: asm is picked up from the plugin scanner, we should consolidate so it is not defined twice
27+
implementation project(":libs:entitlement")
28+
// TODO: asm is picked up from the plugin scanner and entitlements, we should consolidate so it is not defined twice
2829
implementation 'org.ow2.asm:asm:9.7.1'
2930
implementation 'org.ow2.asm:asm-tree:9.7.1'
3031

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/InstallPluginAction.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
2525
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider;
2626
import org.elasticsearch.Build;
27-
import org.elasticsearch.bootstrap.PluginPolicyInfo;
28-
import org.elasticsearch.bootstrap.PolicyUtil;
2927
import org.elasticsearch.cli.ExitCodes;
3028
import org.elasticsearch.cli.Terminal;
3129
import org.elasticsearch.cli.UserException;
@@ -36,9 +34,9 @@
3634
import org.elasticsearch.core.PathUtils;
3735
import org.elasticsearch.core.SuppressForbidden;
3836
import org.elasticsearch.core.Tuple;
37+
import org.elasticsearch.entitlement.runtime.policy.PolicyUtils;
3938
import org.elasticsearch.env.Environment;
4039
import org.elasticsearch.jdk.JarHell;
41-
import org.elasticsearch.jdk.RuntimeVersionFeature;
4240
import org.elasticsearch.plugin.scanner.ClassReaders;
4341
import org.elasticsearch.plugin.scanner.NamedComponentScanner;
4442
import org.elasticsearch.plugins.Platforms;
@@ -934,13 +932,10 @@ private PluginDescriptor installPlugin(InstallablePlugin descriptor, Path tmpRoo
934932
);
935933
}
936934

937-
if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
938-
PluginPolicyInfo pluginPolicy = PolicyUtil.getPluginPolicyInfo(tmpRoot, env.tmpDir());
939-
if (pluginPolicy != null) {
940-
Set<String> permissions = PluginSecurity.getPermissionDescriptions(pluginPolicy, env.tmpDir());
941-
PluginSecurity.confirmPolicyExceptions(terminal, permissions, batch);
942-
}
943-
}
935+
var pluginPolicy = PolicyUtils.parsePolicyIfExists(info.getName(), tmpRoot, true);
936+
937+
Set<String> entitlements = PolicyUtils.getEntitlementsDescriptions(pluginPolicy);
938+
PluginSecurity.confirmPolicyExceptions(terminal, entitlements, batch);
944939

945940
// Validate that the downloaded plugin's ID matches what we expect from the descriptor. The
946941
// exception is if we install a plugin via `InstallPluginCommand` by specifying a URL or

0 commit comments

Comments
 (0)