-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: combine three servers to one ccnp server
Signed-off-by: Xiaocheng Dong <[email protected]>
- Loading branch information
Showing
62 changed files
with
1,315 additions
and
5,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# CCNP Service | ||
|
||
This service will provide CC event log/CC measurement/CC report by [CC Trusted API](https://github.com/cc-api/cc-trusted-api) for remote attestation service to verify the integrity and confidentiality of the trusted computing environment and required software environment. | ||
|
||
## Start Service | ||
|
||
Run the command: | ||
|
||
``` | ||
sudo ./ccnp_server | ||
[2024-02-06T02:06:18Z INFO ccnp_server] [ccnp-server]: set sock file permissions: /run/ccnp/uds/ccnp-server.sock | ||
[2024-02-06T02:06:18Z INFO ccnp_server] [ccnp-server]: staring the service... | ||
``` | ||
|
||
## Query Information | ||
|
||
1. Query the CC report | ||
|
||
Run the command: | ||
|
||
``` | ||
grpcurl -authority "dummy" -plaintext -d '{ "user_data": "MTIzNDU2NzgxMjM0NTY3ODEyMzQ1Njc4MTIzNDU2NzgxMjM0NTY3ODEyMzQ1Njc4", "nonce":"IXUKoBO1UM3c1wopN4sY" }' -unix /run/ccnp/uds/ccnp-server.sock ccnp_server_pb.ccnp.GetCcReport | ||
``` | ||
|
||
The output looks like this: | ||
|
||
``` | ||
{ | ||
"ccType": 1, | ||
"ccReport": "..." | ||
} | ||
``` | ||
|
||
2. Query the CC measurement | ||
|
||
Run the command: | ||
|
||
``` | ||
grpcurl -authority "dummy" -plaintext -d '{ "index": 0, "algo_id": 12}' -unix /run/ccnp/uds/ccnp-server.sock ccnp_server_pb.ccnp.GetCcMeasurement | ||
``` | ||
|
||
The output looks like: | ||
|
||
``` | ||
{ | ||
"measurement": { | ||
"algoId": 12, | ||
"hash": "..." | ||
} | ||
} | ||
``` | ||
|
||
3. Query the eventlog | ||
|
||
Run the command: | ||
|
||
``` | ||
grpcurl -authority "dummy" -plaintext -d '{"start": 0, "count": 3}' -unix /run/ccnp/uds/ccnp-server.sock ccnp_server_pb.ccnp.GetCcEventlog | ||
``` | ||
|
||
The output looks like: | ||
|
||
``` | ||
{ | ||
"eventLogs": [ | ||
{ | ||
"eventType": 3, | ||
"digests": [ | ||
{ | ||
"algoId": 4, | ||
"hash": "..." | ||
} | ||
], | ||
"eventSize": 33, | ||
"event": "..." | ||
}, | ||
{ | ||
"eventType": 2147483659, | ||
"digests": [ | ||
{ | ||
"algoId": 12, | ||
"hash": "..." | ||
} | ||
], | ||
"eventSize": 42, | ||
"event": "..." | ||
}, | ||
{ | ||
"eventType": 2147483658, | ||
"digests": [ | ||
{ | ||
"algoId": 12, | ||
"hash": "..." | ||
} | ||
], | ||
"eventSize": 58, | ||
"event": "..." | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
syntax = "proto3"; | ||
package ccnp_server_pb; | ||
|
||
message HealthCheckRequest { | ||
string service = 1; | ||
} | ||
|
||
message HealthCheckResponse { | ||
enum ServingStatus { | ||
UNKNOWN = 0; | ||
SERVING = 1; | ||
NOT_SERVING = 2; | ||
SERVICE_UNKNOWN = 3; | ||
} | ||
ServingStatus status = 1; | ||
} | ||
|
||
service ccnp { | ||
rpc GetDefaultAlgorithm(GetDefaultAlgorithmRequest) returns (GetDefaultAlgorithmResponse); | ||
rpc GetMeasurementCount(GetMeasurementCountRequest) returns (GetMeasurementCountResponse); | ||
rpc GetCcReport (GetCcReportRequest) returns (GetCcReportResponse); | ||
rpc GetCcMeasurement (GetCcMeasurementRequest) returns (GetCcMeasurementResponse) {} | ||
rpc GetCcEventlog (GetCcEventlogRequest) returns (GetCcEventlogResponse) {} | ||
} | ||
|
||
message GetDefaultAlgorithmRequest { | ||
} | ||
|
||
message GetDefaultAlgorithmResponse { | ||
uint32 algo_id = 1; | ||
} | ||
|
||
message GetMeasurementCountRequest { | ||
} | ||
|
||
message GetMeasurementCountResponse { | ||
uint32 count = 1; | ||
} | ||
|
||
message GetCcReportRequest { | ||
string user_data = 1; | ||
string nonce = 2; | ||
} | ||
|
||
message GetCcReportResponse { | ||
int32 cc_type = 1; | ||
bytes cc_report = 2; | ||
} | ||
|
||
message GetCcMeasurementRequest { | ||
uint32 index = 1; | ||
uint32 algo_id = 2; | ||
} | ||
|
||
message GetCcMeasurementResponse { | ||
TcgDigest measurement = 1; | ||
} | ||
|
||
message GetCcEventlogRequest { | ||
uint32 start = 1; | ||
uint32 count = 2; | ||
} | ||
|
||
message TcgDigest { | ||
uint32 algo_id = 1; | ||
bytes hash = 2; | ||
} | ||
|
||
message TcgEventlog { | ||
uint32 rec_num = 1; | ||
uint32 imr_index = 2; | ||
uint32 event_type = 3; | ||
repeated TcgDigest digests = 4; | ||
uint32 event_size = 5; | ||
bytes event = 6; | ||
map<string, string> extra_info = 7; | ||
} | ||
|
||
message GetCcEventlogResponse { | ||
repeated TcgEventlog event_logs = 1; | ||
} |
Oops, something went wrong.