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

Fix forbidden apis on FIPS #33202

Merged
merged 3 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions distribution/tools/plugin-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ test {
// TODO: find a way to add permissions for the tests in this module
systemProperty 'tests.security.manager', 'false'
}

if (project.inFipsJvm) {
thirdPartyAudit.enabled = false
Copy link
Member

Choose a reason for hiding this comment

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

I think this definitely warrants a comment as to why we disable third party audit

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why we are completely disabling this as opposed to excluding the forbidden classes when using a FIPS JVM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jasontedor we could exclude but it's a really long list, and those classes are AFAIK the only difference between fips and java 8 from a third party audit perspective, if we except all I don't think there's any reason to keep it enabled.

}
7 changes: 6 additions & 1 deletion modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ thirdPartyAudit.excludes = [
'io.netty.internal.tcnative.SSLContext',

// from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty)
'org.bouncycastle.asn1.x500.X500Name',
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder',
Expand Down Expand Up @@ -163,3 +162,9 @@ thirdPartyAudit.excludes = [
'org.conscrypt.Conscrypt',
'org.conscrypt.HandshakeListener'
]

if (project.inFipsJvm == false) {
thirdPartyAudit.excludes += [
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment , i.e.:

// BouncyCastleFIPS provides this class, so the exclusion is invalid when running CI in
// a FIPS JVM with BouncyCastleFIPS Provider

'org.bouncycastle.asn1.x500.X500Name'
]
}
5 changes: 5 additions & 0 deletions plugins/ingest-attachment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2141,3 +2141,8 @@ if (project.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
'javax.xml.bind.Unmarshaller'
]
}

if (project.inFipsJvm) {
// jar hell with JDK on FIPS
Copy link
Member

Choose a reason for hiding this comment

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

Maybe expand a little on jar hell with JDK on FIPS to make what happens more obvious ?

thirdPartyAudit.enabled = false
}
8 changes: 6 additions & 2 deletions plugins/transport-nio/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ thirdPartyAudit.excludes = [
'io.netty.internal.tcnative.SSLContext',

// from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty)
'org.bouncycastle.asn1.x500.X500Name',
'org.bouncycastle.cert.X509v3CertificateBuilder',
'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder',
Expand Down Expand Up @@ -141,4 +140,9 @@ thirdPartyAudit.excludes = [
'org.conscrypt.BufferAllocator',
'org.conscrypt.Conscrypt',
'org.conscrypt.HandshakeListener'
]
]
if (project.inFipsJvm == false) {
thirdPartyAudit.excludes += [
'org.bouncycastle.asn1.x500.X500Name'
]
}
10 changes: 8 additions & 2 deletions x-pack/plugin/security/cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.elasticsearch.gradle.precommit.ForbiddenApisCliTask

apply plugin: 'elasticsearch.build'

archivesBaseName = 'elasticsearch-security-cli'
Expand All @@ -6,8 +8,8 @@ dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
// "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here
compileOnly project(path: xpackModule('core'), configuration: 'default')
compile 'org.bouncycastle:bcprov-jdk15on:1.59'
compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
compile 'org.bouncycastle:bcprov-jdk15on:1.59'
testImplementation 'com.google.jimfs:jimfs:1.1'
testCompile "junit:junit:${versions.junit}"
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
Expand All @@ -20,6 +22,10 @@ dependencyLicenses {
mapping from: /bc.*/, to: 'bouncycastle'
}

if (inFipsJvm) {
if (project.inFipsJvm) {
test.enabled = false
tasks.withType(ForbiddenApisCliTask) {
bundledSignatures -= "jdk-non-portable"
}
thirdPartyAudit.enabled = false
}