Skip to content

Commit 584d57f

Browse files
authored
Merge branch 'main' into cip-874-jupyter-notebook-updates
2 parents 992bde2 + f239f44 commit 584d57f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2457
-3938
lines changed

.github/workflows/release-eql.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,19 @@ jobs:
3636
- name: Build EQL release
3737
run: |
3838
just build
39-
mv release/cipherstash-encrypt-dsl.sql release/cipherstash-eql.sql
39+
40+
- name: Upload EQL artifacts
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: eql-release
44+
path: |
45+
release/cipherstash-encrypt.sql
46+
release/cipherstash-encrypt-uninstall.sql
4047
4148
- name: Publish EQL release artifacts
4249
uses: softprops/action-gh-release@v2
4350
if: startsWith(github.ref, 'refs/tags/')
4451
with:
45-
files: release/cipherstash-eql.sql
52+
files: |
53+
release/cipherstash-encrypt.sql
54+
release/cipherstash-encrypt-uninstall.sql

.github/workflows/test-eql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Test EQL"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- ".github/workflows/test-eql.yml"
8+
- "sql/*.sql"
9+
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- ".github/workflows/test-eql.yml"
15+
- "sql/*.sql"
16+
17+
workflow_dispatch:
18+
19+
defaults:
20+
run:
21+
shell: bash -l {0}
22+
23+
jobs:
24+
test:
25+
name: "Test EQL SQL components"
26+
runs-on: ubuntu-24.04
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
postgres-version: [17, 16, 15, 14]
32+
33+
env:
34+
CS_DATABASE__PASSWORD:
35+
CS_DATABASE__PORT: 5432
36+
CS_DATABASE__NAME: test
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: extractions/setup-just@v1
42+
43+
- uses: ankane/setup-postgres@v1
44+
with:
45+
postgres-version: ${{ matrix.postgres-version }}
46+
database: ${{ env.CS_DATABASE__NAME }}
47+
48+
- name: Test EQL
49+
run: |
50+
just build test
51+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,5 @@ cipherstash-proxy.toml
183183

184184
# build artifacts
185185
release/
186+
187+
.mise.*

MIGRATOR.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# CipherStash Migrator
2+
3+
The CipherStash Migrator is a tool that can be used to migrate plaintext data in a database to its encrypted equivalent.
4+
It works inside the CipherStash Proxy Docker container and can handle different data types such as text, JSONB, integers, booleans, floats, and dates.
5+
By specifying the relevant columns in your table, the migrator will seamlessly encrypt the existing data and store it in designated encrypted columns.
6+
7+
## Prerequisites
8+
9+
- [CipherStash Proxy](PROXY.md)
10+
- [Have set up EQL in your database](GETTINGSTARTED.md)
11+
- Ensure that the columns where data will be migrated already exist.
12+
13+
Here’s a draft for the technical usage documentation for the CipherStash Migrator tool:
14+
15+
## Usage
16+
17+
The CipherStash Migrator allows you to specify key-value pairs where the key is the plaintext column, and the value is the corresponding encrypted column.
18+
Multiple key-value pairs can be specified, and the tool will perform a migration for each specified column.
19+
20+
### Running the migrator
21+
22+
You will need to SSH into the CipherStash Proxy Docker container to run the migrator.
23+
24+
```bash
25+
docker exec -it eql-cipherstash-proxy bash
26+
```
27+
28+
Once inside the container, you have access to the migrator tool.
29+
30+
```bash
31+
cipherstash-migrator --version
32+
```
33+
34+
#### Flags
35+
36+
| Flag | Description | Required |
37+
| --- | --- | --- |
38+
| `--columns` | Specifies the plaintext columns and their corresponding encrypted columns. The format is `plaintext_column=encrypted_column`. | Yes |
39+
| `--table` | Specifies the table where the data will be migrated. | Yes |
40+
| `--database-name` | Specifies the database name. | Yes |
41+
| `--username` | Specifies the database username. | Yes |
42+
| `--password` | Specifies the database password. | Yes |
43+
44+
#### Supported data types
45+
46+
- Text
47+
- JSONB
48+
- Integer
49+
- Boolean
50+
- Float
51+
- Date
52+
53+
### Example
54+
55+
The following is an example of how to run the migrator with a single column:
56+
57+
```bash
58+
cipherstash-migrator --columns example_column=example_column_encrypted --table examples --database-name postgres --username postgres --password postgres
59+
```
60+
61+
If you require additional data types, please [raise an issue](https://github.com/cipherstash/encrypt-query-language/issues)
62+
63+
### Running migrations with multiple columns
64+
65+
To run a migration on multiple columns at once, specify multiple key-value pairs in the `--columns` option:
66+
67+
```bash
68+
cipherstash-migrator --columns test_text=encrypted_text test_jsonb=encrypted_jsonb test_int=encrypted_int test_boolean=encrypted_boolean --table examples --database-name migrator_test --username postgres --password postgres
69+
```
70+
71+
## Notes
72+
73+
- Ensure that the corresponding encrypted columns already exist in the table before running the migration.
74+
- Data migration operations should be tested in a development environment before being executed in production.

PROXY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ Populate the following fields with your values:
5151

5252
## Running the Proxy
5353

54-
To run the proxy, you can use the `start.sh` script in this directory. This script will start the proxy using the configuration in the `cipherstash-proxy.toml` file.
54+
To run the proxy, you can use `docker compose` to start the proxy using the configuration in the `cipherstash-proxy.toml` file.
55+
Run the following command from the `cipherstash-proxy` directory:
5556

5657
```bash
57-
./start.sh
58+
docker compose up
5859
```
5960

6061
## Using the Proxy

0 commit comments

Comments
 (0)