-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add build-tooling to run in the FIPS environment #18921
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
base: main
Are you sure you want to change the base?
Changes from 20 commits
2df9885
5df7ee7
b08999b
69d46e3
8cf332c
738091b
630e804
60728d6
a9a1551
814af0a
0bbdf6e
6014c2c
9f3c9c2
fb177e3
32189ea
b87e926
d4bac69
a7fc277
e282c03
31aaff3
a5b935f
4368d76
88c630c
f826d03
7cfeb72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.client; | ||
|
||
import com.carrotsearch.randomizedtesting.ThreadFilter; | ||
|
||
/** | ||
* ThreadFilter to exclude ThreadLeak checks for BC’s global background threads | ||
* | ||
* <p>clone from the original, which is located in ':test:framework'</p> | ||
*/ | ||
public class BouncyCastleThreadFilter implements ThreadFilter { | ||
beanuwave marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Override | ||
public boolean reject(Thread t) { | ||
String n = t.getName(); | ||
// Ignore BC’s global background threads | ||
return "BC Disposal Daemon".equals(n) || "BC Cleanup Executor".equals(n); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ services: | |
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- node.store.allow_mmap=false | ||
- "KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. outside of running in fips compliance mode, these will be blank? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's the purpose. Docker warns you that this parameter is not set when running w/o FIPS. E.g.
Inside |
||
- "FIPS_GENERATE_TRUSTSTORE=${FIPS_GENERATE_TRUSTSTORE}" | ||
volumes: | ||
- ./build/repo:/tmp/opensearch-repo | ||
- ./build/logs/1:/usr/share/opensearch/logs | ||
|
@@ -40,6 +42,8 @@ services: | |
- cluster.routing.allocation.disk.watermark.high=1b | ||
- cluster.routing.allocation.disk.watermark.flood_stage=1b | ||
- node.store.allow_mmap=false | ||
- "KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD}" | ||
- "FIPS_GENERATE_TRUSTSTORE=${FIPS_GENERATE_TRUSTSTORE}" | ||
volumes: | ||
- ./build/repo:/tmp/opensearch-repo | ||
- ./build/logs/2:/usr/share/opensearch/logs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e -o pipefail | ||
|
||
OPENSEARCH_MAIN_CLASS=org.opensearch.tools.cli.fips.truststore.FipsTrustStoreCommand \ | ||
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/fips-demo-installer-cli \ | ||
"`dirname "$0"`"/opensearch-cli \ | ||
"$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@echo off | ||
|
||
setlocal enabledelayedexpansion | ||
setlocal enableextensions | ||
|
||
set OPENSEARCH_MAIN_CLASS=org.opensearch.tools.cli.fips.truststore.FipsTrustStoreCommand | ||
set OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/fips-demo-installer-cli | ||
|
||
call "%~dp0opensearch-cli.bat" ^ | ||
%%* ^ | ||
|| goto exit | ||
|
||
endlocal | ||
endlocal | ||
:exit | ||
exit /b %ERRORLEVEL% |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis | ||
|
||
apply plugin: 'opensearch.build' | ||
|
||
dependencies { | ||
api project(":libs:opensearch-cli") | ||
api project(':distribution:tools:java-version-checker') | ||
api "info.picocli:picocli:${versions.picocli}" | ||
api "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}" | ||
|
||
testImplementation project(":test:framework") | ||
} | ||
|
||
configurations.runtimeClasspath { | ||
exclude group: 'org.apache.logging.log4j' | ||
} | ||
|
||
tasks.withType(CheckForbiddenApis).configureEach { | ||
replaceSignatureFiles 'jdk-signatures' | ||
} | ||
|
||
tasks.named("dependencyLicenses").configure { | ||
mapping from: /bc.*/, to: 'bouncycastle' | ||
} | ||
|
||
tasks.named("missingJavadoc").configure { it.enabled = false } | ||
tasks.named("loggerUsageCheck").configure { it.enabled = false } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
34c72d0367d41672883283933ebec24843570bf5 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Copyright (c) 2000-2015 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software | ||
and associated documentation files (the "Software"), to deal in the Software without restriction, | ||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial | ||
portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
82bcae3dc45ddeb08b4954e2f596772a42219715 |
Uh oh!
There was an error while loading. Please reload this page.