Skip to content

Commit 7900fe0

Browse files
authored
feat(pedm): add version check API and signature check API (#1343)
Add a new policy option `target_must_be_signed`; this forces the target executable to have a valid auhenticode signature as per the policy. Realistically, this should be a "rule" so I'm probably introducing some slight technical debt here but I believe it's a worthwhile feature and a low-hanging fruit we can squeeze in for the release. Add the application (Agent) version to the "About" API endpoint. This is for future proofing: RDM needs a way to know what version of PEDM he's talking to, in case we add/remove/change APIs. The implementation is in Win32 and I believe it to be correct, but it could use some close scrutiny. I generated the OpenAPI in a. separate commit for easier reviewing.
1 parent e8356ec commit 7900fe0

23 files changed

Lines changed: 160 additions & 22 deletions

File tree

crates/devolutions-pedm-shared/devolutions-pedm-client-http/docs/AboutData.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**run_id** | **i32** | |
1010
**start_time** | **String** | |
1111
**startup_request_count** | **i32** | |
12+
**version** | **String** | |
1213

1314
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1415

crates/devolutions-pedm-shared/devolutions-pedm-client-http/docs/Profile.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**id** | [**uuid::Uuid**](uuid::Uuid.md) | |
1111
**name** | **String** | |
1212
**prompt_secure_desktop** | **bool** | |
13+
**target_must_be_signed** | **bool** | |
1314

1415
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1516

crates/devolutions-pedm-shared/devolutions-pedm-client-http/src/models/about_data.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,25 @@ pub struct AboutData {
2424
pub start_time: String,
2525
#[serde(rename = "StartupRequestCount")]
2626
pub startup_request_count: i32,
27+
#[serde(rename = "Version")]
28+
pub version: String,
2729
}
2830

2931
impl AboutData {
30-
pub fn new(current_request_count: i32, run_id: i32, start_time: String, startup_request_count: i32) -> AboutData {
32+
pub fn new(
33+
current_request_count: i32,
34+
run_id: i32,
35+
start_time: String,
36+
startup_request_count: i32,
37+
version: String,
38+
) -> AboutData {
3139
AboutData {
3240
current_request_count,
3341
last_request_time: None,
3442
run_id,
3543
start_time,
3644
startup_request_count,
45+
version,
3746
}
3847
}
3948
}

crates/devolutions-pedm-shared/devolutions-pedm-client-http/src/models/profile.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub struct Profile {
2525
pub name: String,
2626
#[serde(rename = "PromptSecureDesktop")]
2727
pub prompt_secure_desktop: bool,
28+
#[serde(rename = "TargetMustBeSigned")]
29+
pub target_must_be_signed: bool,
2830
}
2931

3032
impl Profile {
@@ -35,6 +37,7 @@ impl Profile {
3537
id: uuid::Uuid,
3638
name: String,
3739
prompt_secure_desktop: bool,
40+
target_must_be_signed: bool,
3841
) -> Profile {
3942
Profile {
4043
default_elevation_kind,
@@ -43,6 +46,7 @@ impl Profile {
4346
id,
4447
name,
4548
prompt_secure_desktop,
49+
target_must_be_signed,
4650
}
4751
}
4852
}

crates/devolutions-pedm-shared/src/policy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ pub struct Profile {
317317
pub elevation_settings: ElevationConfigurations,
318318
pub default_elevation_kind: ElevationKind,
319319
pub prompt_secure_desktop: bool,
320+
pub target_must_be_signed: bool,
320321
}
321322

322323
impl Identifiable for Profile {
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
3-
VisualStudioVersion = 17.12.35506.116 d17.12
4-
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devolutions.Pedm.Client", "src\Devolutions.Pedm.Client\Devolutions.Pedm.Client.csproj", "{0EB49E08-5842-4A2E-A5AC-926E6DD65C15}"
2+
# Visual Studio 2012
3+
VisualStudioVersion = 12.0.0.0
4+
MinimumVisualStudioVersion = 10.0.0.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devolutions.Pedm.Client", "src\Devolutions.Pedm.Client\Devolutions.Pedm.Client.csproj", "0eb49e08-5842-4a2e-a5ac-926e6dd65c15"
66
EndProject
77
Global
88
GlobalSection(SolutionConfigurationPlatforms) = preSolution
99
Debug|Any CPU = Debug|Any CPU
1010
Release|Any CPU = Release|Any CPU
1111
EndGlobalSection
1212
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13-
{0EB49E08-5842-4A2E-A5AC-926E6DD65C15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14-
{0EB49E08-5842-4A2E-A5AC-926E6DD65C15}.Debug|Any CPU.Build.0 = Debug|Any CPU
15-
{0EB49E08-5842-4A2E-A5AC-926E6DD65C15}.Release|Any CPU.ActiveCfg = Release|Any CPU
16-
{0EB49E08-5842-4A2E-A5AC-926E6DD65C15}.Release|Any CPU.Build.0 = Release|Any CPU
13+
0eb49e08-5842-4a2e-a5ac-926e6dd65c15.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
0eb49e08-5842-4a2e-a5ac-926e6dd65c15.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
0eb49e08-5842-4a2e-a5ac-926e6dd65c15.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
0eb49e08-5842-4a2e-a5ac-926e6dd65c15.Release|Any CPU.Build.0 = Release|Any CPU
17+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
1721
EndGlobalSection
1822
GlobalSection(SolutionProperties) = preSolution
1923
HideSolutionNode = FALSE
2024
EndGlobalSection
21-
EndGlobal
25+
EndGlobal

crates/devolutions-pedm/openapi/dotnet-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
55
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
66

77
- API version:
8-
- SDK version: 2025.5.14
8+
- SDK version: 2025.5.15
99
- Generator version: 7.7.0
1010
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
1111

crates/devolutions-pedm/openapi/dotnet-client/api/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ components:
342342
schemas:
343343
AboutData:
344344
example:
345+
Version: Version
345346
LastRequestTime: 2000-01-23T04:56:07.000+00:00
346347
StartTime: 2000-01-23T04:56:07.000+00:00
347348
RunId: 1
@@ -368,11 +369,14 @@ components:
368369
StartupRequestCount:
369370
format: int32
370371
type: integer
372+
Version:
373+
type: string
371374
required:
372375
- CurrentRequestCount
373376
- RunId
374377
- StartTime
375378
- StartupRequestCount
379+
- Version
376380
Assignment:
377381
example:
378382
Users:
@@ -386,6 +390,7 @@ components:
386390
AccountName: AccountName
387391
Profile:
388392
PromptSecureDesktop: true
393+
TargetMustBeSigned: true
389394
DefaultElevationKind: AutoApprove
390395
Id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
391396
ElevationSettings:
@@ -842,6 +847,7 @@ components:
842847
Profile:
843848
example:
844849
PromptSecureDesktop: true
850+
TargetMustBeSigned: true
845851
DefaultElevationKind: AutoApprove
846852
Id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
847853
ElevationSettings:
@@ -866,13 +872,16 @@ components:
866872
type: string
867873
PromptSecureDesktop:
868874
type: boolean
875+
TargetMustBeSigned:
876+
type: boolean
869877
required:
870878
- DefaultElevationKind
871879
- ElevationMethod
872880
- ElevationSettings
873881
- Id
874882
- Name
875883
- PromptSecureDesktop
884+
- TargetMustBeSigned
876885
SessionElevationConfiguration:
877886
example:
878887
Enabled: true

crates/devolutions-pedm/openapi/dotnet-client/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packageAuthors": "Devolutions Inc.",
33
"packageName": "Devolutions.Pedm.Client",
44
"packageTitle": "Devolutions PEDM REST API Client",
5-
"packageVersion": "2025.5.14",
5+
"packageVersion": "2025.5.15",
66
"packageDescription": "Client for Devolutions PEDM REST API",
77
"packageGuid": "0eb49e08-5842-4a2e-a5ac-926e6dd65c15",
88
"packageCopyright": "© Devolutions Inc. All rights reserved.",

crates/devolutions-pedm/openapi/dotnet-client/docs/AboutData.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**RunId** | **int** | |
1010
**StartTime** | **DateTime** | |
1111
**StartupRequestCount** | **int** | |
12+
**VarVersion** | **string** | |
1213

1314
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1415

0 commit comments

Comments
 (0)