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

[CI / Build / FIPS] Use xpack.security.experimental.fipsMode.enabled in CI and Docker #187533

Merged
merged 20 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
7 changes: 5 additions & 2 deletions .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export MERGE_QUEUE_TARGET_BRANCH
BUILDKITE_BRANCH_MERGE_QUEUE="${MERGE_QUEUE_TARGET_BRANCH:-${BUILDKITE_BRANCH:-}}"
export BUILDKITE_BRANCH_MERGE_QUEUE


BUILDKITE_AGENT_GCP_REGION=""
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
# projects/1003139005402/zones/us-central1-a -> us-central1-a -> us-central1
Expand Down Expand Up @@ -133,15 +132,19 @@ export TEST_GROUP_TYPE_FUNCTIONAL="Functional Tests"
export GH_REPO=github.com/elastic/kibana

FTR_ENABLE_FIPS_AGENT=false
# used by FIPS agents to link FIPS OpenSSL modules
if [[ "${KBN_ENABLE_FIPS:-}" == "true" ]] || is_pr_with_label "ci:enable-fips-agent"; then
FTR_ENABLE_FIPS_AGENT=true
# used by FIPS agents to link FIPS OpenSSL modules
export OPENSSL_MODULES=$HOME/openssl/lib/ossl-modules

if [[ -f "$KIBANA_DIR/config/node.options" ]]; then
echo -e '\n--enable-fips' >>"$KIBANA_DIR/config/node.options"
echo "--openssl-config=$HOME/nodejs.cnf" >>"$KIBANA_DIR/config/node.options"
fi

if [[ -f "$KIBANA_DIR/config/kibana.yml" ]]; then
echo -e '\nxpack.security.experimental.fipsMode.enabled: true' >>"$KIBANA_DIR/config/kibana.yml"
fi
fi

export FTR_ENABLE_FIPS_AGENT
4 changes: 2 additions & 2 deletions .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ check_for_changed_files() {

SHOULD_AUTO_COMMIT_CHANGES="${2:-}"
CUSTOM_FIX_MESSAGE="${3:-}"
GIT_CHANGES="$(git status --porcelain -- . ':!:.bazelrc' ':!:config/node.options')"
GIT_CHANGES="$(git status --porcelain -- . ':!:.bazelrc' ':!:config/node.options' ':!config/kibana.yml')"

if [ "$GIT_CHANGES" ]; then
if ! is_auto_commit_disabled && [[ "$SHOULD_AUTO_COMMIT_CHANGES" == "true" && "${BUILDKITE_PULL_REQUEST:-}" ]]; then
Expand All @@ -56,7 +56,7 @@ check_for_changed_files() {
git config --global user.name kibanamachine
git config --global user.email '[email protected]'
gh pr checkout "${BUILDKITE_PULL_REQUEST}"
git add -A -- . ':!.bazelrc' ':!config/node.options'
git add -A -- . ':!.bazelrc' ':!config/node.options' ':!config/kibana.yml'

git commit -m "$NEW_COMMIT_MESSAGE"
git push
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ RUN /usr/bin/echo -e '\n--enable-fips' >> config/node.options
RUN /usr/bin/echo '--openssl-config=/usr/share/kibana/config/nodejs.cnf' >> config/node.options
COPY --chown=1000:0 openssl/nodejs.cnf "/usr/share/kibana/config/nodejs.cnf"
ENV OPENSSL_MODULES=/usr/share/kibana/openssl/lib/ossl-modules
ENV XPACK_SECURITY_FIPSMODE_ENABLED=true
Copy link
Contributor Author

@Ikuni17 Ikuni17 Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, this env variable works fine in the Docker image, but isn't picked up in CI, so had to write to to kibana.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kc13greiner Do you have any idea why this wouldn't work in CI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs EXPERIMENTAL from the xpack.security.experimental.fipsMode.enabled in src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker


{{/fips}}
RUN ln -s /usr/share/kibana /opt/kibana
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('observability', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
disabledPlugins: [],
license: 'trial',
license: 'basic',
ssl: true,
enableActionsProxy: true,
publicBaseUrl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const EmailDomainsAllowed = ['example.org', 'test.com'];
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
verificationMode: 'none',
customizeLocalHostSsl: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
enableActionsProxy: false,
rejectUnauthorized: false,
verificationMode: undefined,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/apm_api_integration/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const apmFtrConfigs = {
kibanaConfig,
},
trial: {
license: 'trial' as const,
license: 'basic' as const,
kibanaConfig,
},
rules: {
license: 'trial' as const,
license: 'basic' as const,
kibanaConfig: {
...kibanaConfig,
'xpack.ruleRegistry.write.enabled': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
license: 'trial',
license: 'basic',
ssl: true,
testFiles: [require.resolve('./tests/no_public_base_url')],
publicBaseUrl: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
license: 'trial',
license: 'basic',
ssl: true,
testFiles: [require.resolve('./tests/trial')],
publicBaseUrl: true,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/cases_api_integration/spaces_only/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTestConfig } from '../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
disabledPlugins: ['security'],
license: 'trial',
license: 'basic',
ssl: false,
testFiles: [require.resolve('./tests/trial')],
});
2 changes: 1 addition & 1 deletion x-pack/test/cloud_integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
servers: kibanaFunctionalConfig.get('servers'),

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: [
'xpack.security.authc.token.enabled=true',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/custom_branding/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

esTestCluster: {
...kibanaFunctionalConfig.get('esTestCluster'),
license: 'trial',
license: 'basic',
serverArgs: [`xpack.license.self_generated.type='trial'`],
},
apps: {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/ftr_apis/security_and_spaces/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
esTestCluster: {
...apiIntegrationConfig.get('esTestCluster'),
license: 'trial',
license: 'basic',
},
kbnTestServer: {
...apiIntegrationConfig.get('kbnTestServer'),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function ({ readConfigFile }) {
servers: kibanaFunctionalConfig.get('servers'),

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: ['path.repo=/tmp/', 'xpack.security.authc.api_key.enabled=true'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const observabilityAIAssistantFtrConfigs = {
},
},
enterprise: {
license: 'trial' as const,
license: 'basic' as const,
kibanaConfig: {
'logging.loggers': [observabilityAIAssistantDebugLogger],
'plugin-path': path.resolve(
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/observability_api_integration/trial/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig({
license: 'trial',
license: 'basic',
name: 'X-Pack Observability API integration tests (trial)',
testFiles: [require.resolve('./tests')],
});
2 changes: 1 addition & 1 deletion x-pack/test/profiling_api_integration/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const profilingDebugLogger = {

const profilingFtrConfigs = {
cloud: {
license: 'trial' as const,
license: 'basic' as const,
kibanaConfig: {
'logging.loggers': [profilingDebugLogger],
config: kibanaYamlFilePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
license: 'trial',
license: 'basic',
ssl: true,
testFiles: [require.resolve('./tests/trial')],
});
2 changes: 1 addition & 1 deletion x-pack/test/rule_registry/spaces_only/config_trial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig('spaces_only', {
license: 'trial',
license: 'basic',
disabledPlugins: ['security'],
ssl: false,
testFiles: [require.resolve('./tests/trial')],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
import { createTestConfig } from '../common/config';

// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', { license: 'trial' });
export default createTestConfig('security_and_spaces', { license: 'basic' });
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
esTestCluster: {
...apiIntegrationConfig.get('esTestCluster'),
license: 'trial',
license: 'basic',
},
kbnTestServer: {
...apiIntegrationConfig.get('kbnTestServer'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
esTestCluster: {
...apiIntegrationConfig.get('esTestCluster'),
license: 'trial',
license: 'basic',
},
kbnTestServer: {
...apiIntegrationConfig.get('kbnTestServer'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
esTestCluster: {
...apiIntegrationConfig.get('esTestCluster'),
license: 'trial',
license: 'basic',
},
kbnTestServer: {
...apiIntegrationConfig.get('kbnTestServer'),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/saved_objects_field_count/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
testFiles: [require.resolve('./test')],

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: ['path.repo=/tmp/'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
servers: kibanaFunctionalConfig.get('servers'),

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: ['xpack.security.enabled=false'],
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/security_functional/login_selector.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
servers: kibanaFunctionalConfig.get('servers'),

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: [
'xpack.security.authc.token.enabled=true',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/security_functional/oidc.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
servers: kibanaFunctionalConfig.get('servers'),

esTestCluster: {
license: 'trial',
license: 'basic',
from: 'snapshot',
serverArgs: [
'xpack.security.authc.token.enabled=true',
Expand Down
Loading