AWS neptune medium security documentation change
Summary
Updated documentation to remove references to deprecated TinkerPop versions (<3.4.11) and associated libraries, clarified SigV4 signing with requestInterceptor(), standardized cross-account IAM authentication section, and updated AWS SDK 2.x credential provider usage.
Security assessment
The changes remove references to deprecated authentication methods (SigV4WebSocketChannelizer) and outdated libraries, which could indicate potential security weaknesses in older implementations. The addition of cross-account IAM authentication documentation directly relates to security feature implementation. Specific evidence includes removal of deprecated channelizer usage and explicit migration guidance to more secure requestInterceptor() pattern.
Diff
diff --git a/neptune/latest/userguide/iam-auth-connecting-gremlin-java.md b/neptune/latest/userguide/iam-auth-connecting-gremlin-java.md index e816346f0..dfddbd910 100644 --- a//neptune/latest/userguide/iam-auth-connecting-gremlin-java.md +++ b//neptune/latest/userguide/iam-auth-connecting-gremlin-java.md @@ -5 +5 @@ -Using TinkerPop 3.4.11 or higherBefore TinkerPop 3.4.11 +Cross account IAM authentication @@ -9,3 +9 @@ Using TinkerPop 3.4.11 or higherBefore TinkerPop 3.4.11 -## Using TinkerPop 3.4.11 or higher to connect to Neptune with Sig4 signing - -Here is an example of how to connect to Neptune using the Gremlin Java API with Sig4 signing when using TinkerPop 3.4.11 or higher (it assumes general knowledge about using Maven). This example uses the [ Amazon Neptune SigV4 Signer](https://github.com/aws/amazon-neptune-sigv4-signer) library to assist in request signing. First, define the dependencies as part of the `pom.xml` file: +Here is an example of how to connect to Neptune using the Gremlin Java API with Sig4 signing (it assumes general knowledge about using Maven). This example uses the [Amazon Neptune SigV4 Signer](https://github.com/aws/amazon-neptune-sigv4-signer) library to assist in request signing. First, define the dependencies as part of the `pom.xml` file: @@ -15 +13 @@ Here is an example of how to connect to Neptune using the Gremlin Java API with -The following examples have been updated to include the use of requestInterceptor(). This was added in TinkerPop 3.6.6. Prior to TinkerPop version 3.6.6, the code examples used handshakeInterceptor(), which was deprecated with that release. +The following examples use `requestInterceptor()`, which was introduced in TinkerPop 3.6.6. If you are using a TinkerPop version earlier than 3.6.6 (but 3.5.5 or higher), use `handshakeInterceptor()` instead of `requestInterceptor()` in the code examples below. @@ -24 +22 @@ The following examples have been updated to include the use of requestIntercepto -The Amazon Neptune SigV4 Signer supports use of both versions 1.x and 2.x of the AWS Java SDK. The following example uses 2.x where the `DefaultCredentialsProvider` is a `software.amazon.awssdk.auth.credentials.AwsCredentialsProvider` instance, but you could equally use the 1.x form with any `com.amazonaws.auth.AWSCredentialsProvider`. If you are upgrading from 1.x to 2.x, you can read more about the changes between 1.x and 2.x in the [Credentials provider changes](https://docs.aws.amazon.com//sdk-for-java/latest/developer-guide/migration-client-credentials.html) of the AWS SDK for Java 2.x documentation. +The Amazon Neptune SigV4 Signer supports both versions 1.x and 2.x of the AWS Java SDK. The following examples use 2.x, where `DefaultCredentialsProvider` is a `software.amazon.awssdk.auth.credentials.AwsCredentialsProvider` instance. If you are upgrading from 1.x to 2.x, see the [Credentials provider changes](https://docs.aws.amazon.com//sdk-for-java/latest/developer-guide/migration-client-credentials.html) in the AWS SDK for Java 2.x documentation. @@ -27 +25 @@ The Amazon Neptune SigV4 Signer supports use of both versions 1.x and 2.x of the - import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; + import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; @@ -59,5 +57 @@ The Amazon Neptune SigV4 Signer supports use of both versions 1.x and 2.x of the -###### Note - -If you are upgrading from `3.4.11`, remove references to the `amazon-neptune-gremlin-java-sigv4` library. It is no longer necessary when using `requestInterceptor()` as shown in the example above. Do not attempt to use the `requestInterceptor()` in conjunction with the channelizer (`SigV4WebSocketChannelizer.class`), because it will produce errors. - -### Cross account IAM authentication +## Cross account IAM authentication @@ -145 +139 @@ JSON - // new NeptuneNettyHttpSigV4Signer("us-west-2", new DefaultAWSCredentialsProviderChain()); + // new NeptuneNettyHttpSigV4Signer("us-west-2", DefaultCredentialsProvider.create()); @@ -170,31 +163,0 @@ JSON -## Using a version of TinkerPop earlier than 3.4.11 to connect to Neptune with Sig4 signing - -TinkerPop versions prior to `3.4.11` did not have support for the `requestInterceptor()` configuration shown in the previous section and therefore must rely on the `amazon-neptune-gremlin-java-sigv4` package. This is a Neptune library that contains the `SigV4WebSocketChannelizer` class, which replaces the standard TinkerPop Channelizer with one that can automatically inject a SigV4 signature. Where possible, ugrade to TinkerPop 3.4.11 or higher, because the `amazon-neptune-gremlin-java-sigv4` library is deprecated. - -Here is an example of how to connect to Neptune using the Gremlin Java API with Sig4 signing when using TinkerPop versions prior to 3.4.11 (it assumes general knowledge about how to use Maven). - -First, define the dependencies as part of the `pom.xml` file: - - - <dependency> - <groupId>com.amazonaws</groupId> - <artifactId>amazon-neptune-gremlin-java-sigv4</artifactId> - <version>2.4.0</version> - </dependency> - -The dependency above will include the Gremlin driver version `3.4.10`. Although it is possible to use newer Gremlin driver versions (up through `3.4.13`), an upgrade of the driver past 3.4.10 should include a change to use the `requestInterceptor()` model described above. - -The `gremlin-driver` Cluster object should then be configured as follows in the Java code: - - - import org.apache.tinkerpop.gremlin.driver.SigV4WebSocketChannelizer; - - ... - - Cluster cluster = Cluster.build(your cluster) - .enableSsl(true) - .channelizer(SigV4WebSocketChannelizer.class) - .create(); - Client client = cluster.connect(); - client.submit("g.V().has('code','IAD')").all().get(); -