Commit Graph

2910 Commits

Author SHA1 Message Date
Ata E Husain Bohra 33ae398268
REST KmsConnector implementation (#6994)
* REST KmsConnector implementation

Description
  diff-1: Address review comments.
          Add utility interface to Platform namespace to
          create and operate on tmpfile
 diff-2: Address review comments
         Link Boost::filesystem to CMake build process

Major changes includes:
1. Implement REST based KmsConnector implementation.
2. Salient features of the connector:
 2.1. Two required configuration are:
   a. Discovery KMS URLs - enable KMS discovery on bootstrap
   b. Endpoint path configuration to construct URI to fetch/refresh
      encryption keys
   c. Configuration to provide "validationTokens" to connect with
      external KMS. Patch implements file-based token validation scheme.
 2.2. On startup, RESTKmsConnector discovers KMS Urls and caches
      them in-memory. Extracts "validationTokens" based on input config.
 2.3. Expose endpoints to allow fetch/refresh of encryption keys.
 2.4. Defines JSON format to interact with external KMS - request &
      response payload format.
3. Extend Platform namespace with an interface to create and operate on
   tmp files.
4. Update Platform 'readFileBytes' and 'writeFileBytes' to leverage
   fstream supported implementation.

NOTE: KMS URLs fetched after initial discovery will be persisted using
      DynamicKnobs. It is TODO at the moment and shall be completed
      once DynamicKnobs is feature complete

Testing

Unit test to validation following:
1. Parsing on "validation tokens" logic.
2. Construction and parsing of REST JSON request and response strings.
2022-05-07 13:18:35 -07:00
Yi Wu 66f1c5c85a
Small BlobCipher and SimKmsConnector fixes and changes (#6936)
* SimKmsConnector fix domain id being unsigned
* SimKmsConnector fix returning cipher id 0 as latest key, which is invalid
* SimKmsConnector fix keys initialized as c-style strings with incorrect length and uninitialized bytes
* SimKmsConnector fix returning different keys for the same id after restart
* BlobCipher change APIs to return null reference when key not found
* BlobCipher insertCipherKey to return the inserted key
2022-05-04 14:09:31 -07:00
Dan Lambright e8adad38b0
Merge pull request #7057 from sbodagala/main
Address GRV cache and version vector incompatibility
2022-05-04 10:06:14 -04:00
Sreenath Bodagala 2102ed1eaa - Remove "stale_version_vector" error code. 2022-05-03 21:56:11 +00:00
sfc-gh-tclinkenbeard 225146176d Apply clang-format to fdbcli.actor.cpp and Net2.actor.cpp 2022-05-03 12:13:09 -07:00
sfc-gh-tclinkenbeard 258ba462e1 Remove !defined(_WIN32) guards for encryption code 2022-05-03 09:48:24 -07:00
sfc-gh-tclinkenbeard 06825775db Fix formatting of lines with TLS_OPTION_FLAGS 2022-05-02 22:56:06 -07:00
sfc-gh-tclinkenbeard 8ea68154bf Remove WITH_TLS CMake variable 2022-05-02 22:45:00 -07:00
sfc-gh-tclinkenbeard 475d66084d Remove ENCRYPTION_ENABLED macro 2022-05-02 22:26:31 -07:00
sfc-gh-tclinkenbeard 7f05221cfe Removed TLS_DISABLED macro 2022-05-02 22:15:27 -07:00
Andrew Noyes 7ed82c1ac5
Mac m1 has 16k pages (#7038)
Previously the page guard implementation assumed that the page size was
4k. Also check for mmap and mprotect returning errors.
2022-05-02 14:24:43 -07:00
Ray Jenkins dc9e782ccc
OpenTelemetry Tracing Perf Fixes (#6990) 2022-05-02 14:56:51 -05:00
Jingyu Zhou 0ca9761088 Fix IDE build warnings and errors 2022-05-01 16:20:57 -07:00
Sam Gwydir 5403a29ecb
add WolfSSL support (#6682)
remove extraneous include
2022-04-28 16:53:38 -07:00
A.J. Beamon cc72d541e4
Merge pull request #6971 from sfc-gh-svemuri/verify-tenant-prefixes-on-commit-proxy
Validate commit request tenant prefixes on commit proxy
2022-04-28 12:40:56 -07:00
pranavPandit1 a192264e7e missing file added 2022-04-28 08:35:42 -07:00
pranavPandit1 5794fd4e91 clang format corrected for file 2022-04-28 08:35:42 -07:00
pranavPandit1 195a196392 crc32 support added for ppc64le 2022-04-28 08:35:42 -07:00
Ata E Husain Bohra 333aadb903
Interface to enable clients to send/receive REST requests/responses (#6866)
* Interface to enable clients to send/receive REST requests/responses

Description

Major changes:
1. Add RESTClient interface enabling client to send/receive REST HTTP
   requests. Support REST APIs are: get, head, put, post, delete, trace
2. Add RESTUtil file introducing below interfaces:
 2.1. RESTUrl - Extract URI information: host, service, request-parameters.
 2.2. RESTConnectionPool-
      Connection establishment, life-cycle management, connection-pool (TTL)
 2.3. RESTClientKnobs - supports REST Knob parameter management and updates

Testing

Unit test - fdbrpc/RESTClient, fdbrpc/RESTUtils
2022-04-27 12:17:52 -07:00
Sagar Vemuri ed60afc964 Handle versionstamped keys, and include additonal trace information 2022-04-27 11:12:01 -07:00
Sagar Vemuri 35baf4d745 Validate commit request tenant prefixes on commit proxy 2022-04-26 13:28:29 -07:00
Markus Pilman cbe4a873d2 Merge remote-tracking branch 'origin/main' into features/validate-trace-events-in-simulation 2022-04-25 17:39:29 -06:00
Ray Jenkins 1c5bf135d5
Revert "Migrate to OpenTelemetry tracing. (#6855)" (#6941)
This reverts commit 5df3bac110.
2022-04-25 09:29:56 -05:00
Bharadwaj V.R 08323de905 fix formatting 2022-04-22 15:10:24 -07:00
Bharadwaj V.R 588b2fa509
Merge branch 'main' into block-down 2022-04-22 14:53:09 -07:00
Bharadwaj V.R 988a70f064
Merge pull request #6858 from sfc-gh-bvr/dbcorever
Track newest and lowest compatible protocol versions in DBCoreState
2022-04-22 14:46:21 -07:00
Bharadwaj V.R 4a5c2268da
Merge branch 'apple:main' into block-down 2022-04-22 14:45:54 -07:00
Markus Pilman 9e65e15b45 Merge remote-tracking branch 'origin/main' into features/validate-trace-events-in-simulation 2022-04-22 15:39:55 -06:00
Ata E Husain Bohra 6c9030408e Fix Build: use boost::hash to compute hash for std::pair
Description

Fix Build: use boost::hash to compute hash for std::pair

Testing

1. Build - gcc/clang
2. Simulation test: EncryptKeyProxyTest, EncryptionOps
3. Unit test: flow/BlobCipher
4. Running 10k correctness Joshua run
2022-04-22 13:16:30 -07:00
Ata E Husain Bohra 670d40ef79
FDB native KMS Connector Framework (#6846)
* FDB native KMS Connector Framework

Description

Major changes includes:
1. Framework code to enable FDB native KMS connector implementation.
2. SERVER_KNOBS->KMS_CONNECTOR_TYPE controls the connector type selection.
3. KmsConnectorInterface endpoint definitions, every KMSConnector
   implementation needs to support defined endpoints.
4. Update EncryptKeyProxy to leverage KmsConnectorInterface endpoints
   to fetch encryption keys on-demand and/or periodic refreshes.
   Integrate SimKmsConnector implementation.
5. Implement SimKmsConnector by leveraging existing SimKeyProxy
   implementation.

Testing

Unit test: fdbserver/SimKmsConnector
Simulation: EncryptKeyProxy
2022-04-22 08:53:39 -07:00
Bharadwaj V.R 822eb9ec26
Merge branch 'apple:main' into dbcorever 2022-04-22 08:08:34 -07:00
Bharadwaj V.R ed08cfbf52
Merge branch 'apple:main' into block-down 2022-04-22 06:19:38 -07:00
Ata E Husain Bohra 04ecd8e08f
Revert "Revert "Update 'salt' details for EncryptHeader AuthToken details (#6881)" (#6902)" (#6922)
Description

Major changes proposed:
1. This reverts commit f38b2e8209.
2. Also add fix for Valgrind failure due to unintialized variables.
3. Improve checks to catch is cipherKey details cached in BlobCipherKeyCache
   isn't as expected

Testing

Overall correctness: 10K (20220421-193911-ahusain-foundationdb-a730e5cb38541e20)
EncyrptionOps correctness: 100K (20220421-194315-ahusain-foundationdb-29c598a8b9420430)
EncryptionOps Valgrind: 100 (20220421-194434-ahusain-foundationdb-7fc5f98eddc0921a)
2022-04-21 18:57:56 -07:00
Bharadwaj V.R 449a315c06
Merge branch 'apple:main' into block-down 2022-04-21 09:37:42 -07:00
Bharadwaj V.R c20fb6ef6d
Merge branch 'apple:main' into dbcorever 2022-04-21 09:37:29 -07:00
Markus Pilman f38b2e8209
Revert "Update 'salt' details for EncryptHeader AuthToken details (#6881)" (#6902)
This reverts commit a38318a6ac.
2022-04-21 09:04:40 -07:00
Markus Pilman bbb1392aad Merge remote-tracking branch 'origin/main' into features/validate-trace-events-in-simulation 2022-04-21 08:24:18 -06:00
Markus Pilman 85757eb47c
Update flow/Trace.cpp 2022-04-20 15:30:42 -06:00
Renxuan Wang e40cc8722c
A few hostname improvements. (#6825)
* Add tryResolveHostnames() in connection string.

* Add missing hostname to related interfaces.

* Do not pass RequestStream into *GetReplyFromHostname() functions.

Because we are using new RequestStream for each request anyways. Also, the passed in pointer could be nullptr, which results in seg faults.

* Add dynamic hostname resolve and reconnect intervals.

* Address comments.
2022-04-20 13:42:46 -07:00
Markus Pilman 3335b2686e
Merge branch 'main' into features/validate-trace-events-in-simulation 2022-04-20 12:03:33 -06:00
Markus Pilman f7a8ebf818
Update flow/Trace.cpp
Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2022-04-20 11:55:01 -06:00
Bharadwaj V.R 8a0ce5bfc7 Rename isInvalidMagic and fix formatting 2022-04-20 09:17:28 -07:00
Bharadwaj V.R a2449041ea Fix formatting of ProtocolVersion.h 2022-04-20 08:45:53 -07:00
Bharadwaj V.R 4d6f4ecd9c
Merge branch 'main' into dbcorever 2022-04-20 08:23:34 -07:00
Ray Jenkins 5df3bac110
Migrate to OpenTelemetry tracing. (#6855) 2022-04-20 09:26:37 -05:00
Bharadwaj V.R a711c55061
Merge branch 'apple:main' into dbcorever 2022-04-20 06:16:27 -07:00
Bharadwaj V.R 89af5561f1
Merge branch 'apple:main' into block-down 2022-04-20 06:13:01 -07:00
Markus Pilman d4ee7be1d7 Reduce excessive tracing and fail after 1M traces 2022-04-19 21:11:51 -06:00
Andrew Noyes 297d831192
Put guard pages next to fast alloc memory (#6885)
* Put guard pages next to fast alloc memory

I verified that we can now detect #6753 without creating tons of
threads.

* Use pageSize instead of 4096

* Don't include mmapInternal for windows
2022-04-19 11:22:35 -07:00
Bharadwaj V.R 51ef860612
Merge branch 'apple:main' into block-down 2022-04-19 10:16:56 -07:00