Skip to content

Commit

Permalink
Feature/oracle fips (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trianz-Akshay authored May 10, 2024
1 parent e080a7c commit 96c3c7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions athena-oracle/athena-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Parameters:
SecretNamePrefix:
Description: 'Used to create resource-based authorization policy for "secretsmanager:GetSecretValue" action. E.g. All Athena JDBC Federation secret names can be prefixed with "AthenaJdbcFederation" and authorization policy will allow "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:AthenaJdbcFederation*". Parameter value in this case should be "AthenaJdbcFederation". If you do not have a prefix, you can manually update the IAM policy to add allow any secret names.'
Type: String
IsFIPSEnabled:
AllowedValues:
- true
- false
Default: false
Description: "If oracle rds is FIPS compliance select true, [true, false] (default is false)"
Type: String
SpillBucket:
Description: 'The name of the bucket where this function can spill data.'
Type: String
Expand Down Expand Up @@ -68,6 +75,7 @@ Resources:
spill_bucket: !Ref SpillBucket
spill_prefix: !Ref SpillPrefix
default: !Ref DefaultConnectionString
is_FIPS_Enabled: !Ref IsFIPSEnabled
FunctionName: !Ref LambdaFunctionName
Handler: "com.amazonaws.athena.connectors.oracle.OracleMuxCompositeHandler"
CodeUri: "./target/athena-oracle-2022.47.1.jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

public class OracleJdbcConnectionFactory extends GenericJdbcConnectionFactory
{
public static final String IS_FIPS_ENABLED = "is_FIPS_Enabled";
private final DatabaseConnectionInfo databaseConnectionInfo;
private final DatabaseConnectionConfig databaseConnectionConfig;
private static final Logger LOGGER = LoggerFactory.getLogger(OracleJdbcConnectionFactory.class);
Expand Down Expand Up @@ -70,6 +71,9 @@ public Connection getConnection(final JdbcCredentialProvider jdbcCredentialProvi
properties.put("javax.net.ssl.trustStoreType", "JKS");
properties.put("javax.net.ssl.trustStorePassword", "changeit");
properties.put("oracle.net.ssl_server_dn_match", "true");
if (System.getenv().getOrDefault(IS_FIPS_ENABLED, "false").equalsIgnoreCase("true")) {
properties.put("oracle.net.ssl_cipher_suites", "(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA)");
}
}
else {
LOGGER.info("Establishing normal connection..");
Expand Down

0 comments on commit 96c3c7e

Please sign in to comment.