forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entitlements] Add
set_https_connection_properties
entitlement and …
…checks (elastic#118577)
- Loading branch information
Showing
21 changed files
with
265 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
.../common/src/main/java/org/elasticsearch/entitlement/qa/common/TestHttpsURLConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
package org.elasticsearch.entitlement.qa.common; | ||
|
||
import java.io.IOException; | ||
import java.security.cert.Certificate; | ||
|
||
import javax.net.ssl.HttpsURLConnection; | ||
import javax.net.ssl.SSLPeerUnverifiedException; | ||
|
||
class TestHttpsURLConnection extends HttpsURLConnection { | ||
TestHttpsURLConnection() { | ||
super(null); | ||
} | ||
|
||
@Override | ||
public void connect() throws IOException {} | ||
|
||
@Override | ||
public void disconnect() {} | ||
|
||
@Override | ||
public boolean usingProxy() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String getCipherSuite() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public Certificate[] getLocalCertificates() { | ||
return new Certificate[0]; | ||
} | ||
|
||
@Override | ||
public Certificate[] getServerCertificates() throws SSLPeerUnverifiedException { | ||
return new Certificate[0]; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...qa/common/src/main/java/org/elasticsearch/entitlement/qa/common/TestSSLSocketFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
package org.elasticsearch.entitlement.qa.common; | ||
|
||
import java.io.IOException; | ||
import java.net.InetAddress; | ||
import java.net.Socket; | ||
import java.net.UnknownHostException; | ||
|
||
import javax.net.ssl.SSLSocketFactory; | ||
|
||
class TestSSLSocketFactory extends SSLSocketFactory { | ||
@Override | ||
public Socket createSocket(String host, int port) throws IOException, UnknownHostException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Socket createSocket(InetAddress host, int port) throws IOException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String[] getDefaultCipherSuites() { | ||
return new String[0]; | ||
} | ||
|
||
@Override | ||
public String[] getSupportedCipherSuites() { | ||
return new String[0]; | ||
} | ||
|
||
@Override | ||
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { | ||
return null; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...lement/qa/entitlement-allowed-nonmodular/src/main/plugin-metadata/entitlement-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ALL-UNNAMED: | ||
- create_class_loader | ||
- set_https_connection_properties |
1 change: 1 addition & 0 deletions
1
libs/entitlement/qa/entitlement-allowed/src/main/plugin-metadata/entitlement-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
org.elasticsearch.entitlement.qa.common: | ||
- create_class_loader | ||
- set_https_connection_properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...org/elasticsearch/entitlement/runtime/policy/SetHttpsConnectionPropertiesEntitlement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
package org.elasticsearch.entitlement.runtime.policy; | ||
|
||
/** | ||
* An Entitlement to allow setting properties to a single Https connection after this has been created | ||
*/ | ||
public class SetHttpsConnectionPropertiesEntitlement implements Entitlement { | ||
@ExternalEntitlement(esModulesOnly = false) | ||
public SetHttpsConnectionPropertiesEntitlement() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
elastic.apm.agent: | ||
- set_https_connection_properties |
2 changes: 2 additions & 0 deletions
2
modules/repository-gcs/src/main/plugin-metadata/entitlement-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALL-UNNAMED: | ||
- set_https_connection_properties # required by google-http-client |
2 changes: 2 additions & 0 deletions
2
plugins/discovery-gce/src/main/plugin-metadata/entitlement-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALL-UNNAMED: | ||
- set_https_connection_properties # required by google-http-client |
Oops, something went wrong.