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

Feature/add hcp vault backend #42

Closed
wants to merge 6 commits into from

Conversation

gabheadz
Copy link
Contributor

Added an async connector for Vault.

Closes #41 .

KeyFactory var9 = KeyFactory.getInstance("RSA");
PrivateKey privateKey = var9.generatePrivate(pkcs8EncodedKeySpec);
KeyStore ikeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
ikeyStore.load((InputStream)null, "password".toCharArray());

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUE-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUE&open=AYytWILcGWAFecbYwgUE&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
KeyStore ikeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
ikeyStore.load((InputStream)null, "password".toCharArray());
ikeyStore.setCertificateEntry("clientCert", clientCertificate);
ikeyStore.setKeyEntry("key", privateKey, "password".toCharArray(),

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUF-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUF&open=AYytWILcGWAFecbYwgUF&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
ikeyStore.setCertificateEntry("clientCert", clientCertificate);
ikeyStore.setKeyEntry("key", privateKey, "password".toCharArray(),
new Certificate[]{clientCertificate});
keyManagerFactory.init(ikeyStore, "password".toCharArray());

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUG-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUG&open=AYytWILcGWAFecbYwgUG&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
try {
SSLContext disabledSslContxt = SSLContext.getInstance(TLSV_1_2);
disabledSslContxt.init((KeyManager[])null, new TrustManager[]{new X509ExtendedTrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUH-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUH&open=AYytWILcGWAFecbYwgUH&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUI-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUI&open=AYytWILcGWAFecbYwgUI&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUJ-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUJ&open=AYytWILcGWAFecbYwgUJ&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUK-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUK&open=AYytWILcGWAFecbYwgUK&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUL-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUL&open=AYytWILcGWAFecbYwgUL&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytWILcGWAFecbYwgUM-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytWILcGWAFecbYwgUM&open=AYytWILcGWAFecbYwgUM&branch=feature%2Fadd-hcp-vault-backend">SonarCloud</a></p>
KeyFactory var9 = KeyFactory.getInstance("RSA");
PrivateKey privateKey = var9.generatePrivate(pkcs8EncodedKeySpec);
KeyStore ikeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
ikeyStore.load((InputStream)null, "password".toCharArray());

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpW-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpW&open=AYytaRRfE6alD4B5GUpW&pullRequest=42">SonarCloud</a></p>
KeyStore ikeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
ikeyStore.load((InputStream)null, "password".toCharArray());
ikeyStore.setCertificateEntry("clientCert", clientCertificate);
ikeyStore.setKeyEntry("key", privateKey, "password".toCharArray(),

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpX-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpX&open=AYytaRRfE6alD4B5GUpX&pullRequest=42">SonarCloud</a></p>
ikeyStore.setCertificateEntry("clientCert", clientCertificate);
ikeyStore.setKeyEntry("key", privateKey, "password".toCharArray(),
new Certificate[]{clientCertificate});
keyManagerFactory.init(ikeyStore, "password".toCharArray());

Check failure

Code scanning / SonarCloud

Credentials should not be hard-coded

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpY-->Revoke and change this password, as it is compromised. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpY&open=AYytaRRfE6alD4B5GUpY&pullRequest=42">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpa-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpa&open=AYytaRRfE6alD4B5GUpa&pullRequest=42">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpb-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpb&open=AYytaRRfE6alD4B5GUpb&pullRequest=42">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpc-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpc&open=AYytaRRfE6alD4B5GUpc&pullRequest=42">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpd-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpd&open=AYytaRRfE6alD4B5GUpd&pullRequest=42">SonarCloud</a></p>
// leave blank to trust all clients
}

public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpe-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpe&open=AYytaRRfE6alD4B5GUpe&pullRequest=42">SonarCloud</a></p>
try {
SSLContext disabledSslContxt = SSLContext.getInstance(TLSV_1_2);
disabledSslContxt.init((KeyManager[])null, new TrustManager[]{new X509ExtendedTrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {

Check failure

Code scanning / SonarCloud

Server certificates should be verified during SSL/TLS connections

<!--SONAR_ISSUE_KEY:AYytaRRfE6alD4B5GUpZ-->Enable server certificate validation on this SSL/TLS connection. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bancolombia_secrets-manager&issues=AYytaRRfE6alD4B5GUpZ&open=AYytaRRfE6alD4B5GUpZ&pullRequest=42">SonarCloud</a></p>
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
87.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@gabheadz gabheadz closed this Dec 28, 2023
@gabheadz gabheadz deleted the feature/add-hcp-vault-backend branch December 28, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new backend connector for Hashicorp Vault
1 participant