Skip to content

Conversation

MMcM
Copy link
Collaborator

@MMcM MMcM commented Aug 22, 2025

No description provided.

@MMcM MMcM added enhancement New feature or request relational issues related to relational FDB labels Aug 22, 2025
@MMcM MMcM force-pushed the yaml-test-encrypted-records branch from f723f72 to ccc924e Compare August 22, 2025 04:03
* A text password to be used to generate an encryption key.
* Since a fixed salt is used, this is <em>not secure at all</em>.
*/
ENCRYPTION_PASSWORD,
Copy link
Contributor

@ohadzeliger ohadzeliger Aug 26, 2025

Choose a reason for hiding this comment

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

Should this be used for testing only? Maybe document it as such?

@@ -86,7 +72,7 @@ public static class RecordLayerConfigBuilder {

public RecordLayerConfigBuilder() {
this.userVersionChecker = (oldUserVersion, oldMetaDataVersion, metaData) -> CompletableFuture.completedFuture(oldUserVersion);
this.serializer = DEFAULT_RELATIONAL_SERIALIZER;
this.serializer = StoreConfig.DEFAULT_RELATIONAL_SERIALIZER;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be removed?

key = new SecretKeySpec(Base64.getDecoder().decode(keyBase64), "AES");
} else {
// TODO: Is there a way to make this only available in YAML test framework?
final String keyPassword = options.getOption(Options.Name.ENCRYPTION_PASSWORD);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a better testing strategy is to check in a key to the repo and have the test harness read the file and pass it in?
A concern here is that even if this is clearly marked as "test only" there is still room for abuse or inattentive use of the feature.

throw new RelationalException("Key generator not found", ErrorCode.UNSUPPORTED_OPERATION, ex);
}
keyGen.init(128);
key = keyGen.generateKey();
Copy link
Contributor

@ohadzeliger ohadzeliger Aug 27, 2025

Choose a reason for hiding this comment

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

What is the end goal of this code path? A one-time key that cannot be reused?

# limitations under the License.
---
options:
supported_version: 4.5.6.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
supported_version: 4.5.6.0
supported_version: !current_version

ENCRYPTION_PASSWORD: SQL
tests:
-
- query: SELECT * FROM t
Copy link
Contributor

Choose a reason for hiding this comment

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

Because of the way that requests are load-balanced across the versions, a better chance of hitting all servers will be achieved by adding more queries to the test (more than one, that is).
So for example, one more write and then read, or just more reads.

- query: SELECT * FROM t
- error: "25F01"
---
test_block:
Copy link
Contributor

Choose a reason for hiding this comment

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

One more flow is the writing of unencrypted data and failing to read it without key

-
- query: SELECT * FROM t
- error: "25F01"
...
Copy link
Contributor

Choose a reason for hiding this comment

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

The code path of using an empty (random) key was not tested. I am not sure whether that flow is a valid production flow, but it could be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request relational issues related to relational FDB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants