Skip to content

Commit

Permalink
feat(dgw): subkey tokens (#287)
Browse files Browse the repository at this point in the history
Issue: DGW-35

* feat(dgw): subkey tokens
* chore(tokengen): support for subkey tokens
* Code review
  • Loading branch information
CBenoit authored Aug 2, 2022
1 parent f9b66c1 commit bebee0e
Show file tree
Hide file tree
Showing 15 changed files with 722 additions and 247 deletions.
193 changes: 158 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ If all the optional claims are provided RDP routing will start in **RDP-TLS** mo

#### Token generation utilities

JWT generation should be facilitated by a provider (such as the [WaykDen](https://github.com/Devolutions/WaykDen-ps)).
JWT generation should be facilitated by a provisioner (such as the [WaykDen](https://github.com/Devolutions/WaykDen-ps)).
However, you can easily generate a JWT for testing purposes by using CLI tools provided in `/tools` folder.

##### tokengen
Expand All @@ -142,13 +142,13 @@ The binary is produced inside a `target/release` folder.
RDP-TCP example:

```
$ ./tokengen --provider-private-key /path/to/provisioner/private/key.pem forward --dst-hst 192.168.122.70 --jet-ap rdp
$ ./tokengen --provisioner-key /path/to/provisioner/private/key.pem forward --dst-hst 192.168.122.70 --jet-ap rdp
```

RDP-TLS example:

```
$ ./tokengen --provider-private-key /path/to/provisioner/private/key.pem --delegation-public-key /path/to/delegation/public/key.pem rdp-tls --dst-hst 192.168.122.70 --prx-usr proxy_username --prx-pwd proxy_password --dst-usr host_username --dst-pwd host_password
$ ./tokengen --provisioner-key /path/to/provisioner/private/key.pem --delegation-key /path/to/delegation/public/key.pem rdp-tls --dst-hst 192.168.122.70 --prx-usr proxy_username --prx-pwd proxy_password --dst-usr host_username --dst-pwd host_password
```

##### rdp_token.sh
Expand Down
10 changes: 10 additions & 0 deletions crates/devolutions-gateway-generators/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,13 @@ pub fn session_info_fwd_only() -> impl Strategy<Value = GatewaySessionInfo> {
)
})
}

#[derive(Debug, Serialize, Clone)]
pub struct SubkeyClaims {
pub kid: String,
pub kty: String,
pub jet_gw_id: Option<uuid::Uuid>,
pub iat: i64,
pub nbf: i64,
pub jti: uuid::Uuid,
}
4 changes: 3 additions & 1 deletion devolutions-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ focaccia = "1.1.2"
native-tls = "0.2.8"
zeroize = { version = "1.5.3", features = ["derive"] }
rust-argon2 = "1.0.0"
picky = { version = "7.0.0-rc.2", default-features = false, features = ["jose", "x509"] }
picky = { version = "7.0.0-rc.3", default-features = false, features = ["jose", "x509"] }
sspi = "0.3.2"
ring = "0.16.20"
# (unrequired if using `axum`)
sha1 = "0.10.1"
# (unrequired if using `axum`)
base64 = "0.13.0"
multihash = "0.16.2"
multibase = "0.9.1"

# logging
tracing = "0.1.34"
Expand Down
Loading

0 comments on commit bebee0e

Please sign in to comment.