Skip to content

Commit

Permalink
PMM-7338 Add API for changing security check interval (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
palash25 authored Apr 8, 2021
1 parent 614c31c commit ab1dbca
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 100 deletions.
280 changes: 185 additions & 95 deletions api/managementpb/checks.pb.go

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion api/managementpb/checks.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annota
import "google/api/annotations.proto";
import "managementpb/severity.proto";

// SecurityCheckInterval represents possible execution interval values for checks.
enum SecurityCheckInterval {
SECURITY_CHECK_INTERVAL_INVALID = 0;
STANDARD = 1;
FREQUENT = 2;
RARE = 3;
}

// SecurityCheckResult represents the check result returned from pmm-managed after running the check.
message SecurityCheckResult {
string summary = 1;
Expand All @@ -28,6 +36,8 @@ message SecurityCheck {
string description = 3;
// Short human-readable summary.
string summary = 4;
// Check execution interval.
SecurityCheckInterval interval = 5;
}

// ChangeSecurityCheckParams specifies a single check parameters.
Expand All @@ -36,6 +46,8 @@ message ChangeSecurityCheckParams {
string name = 1;
bool enable = 2;
bool disable = 3;
// check execution interval.
SecurityCheckInterval interval = 4;
}

message GetSecurityCheckResultsRequest {}
Expand Down Expand Up @@ -89,7 +101,7 @@ service SecurityChecks {
body: "*"
};
}
// ChangeSecurityChecks enables/disables Security Thread Tool checks by names.
// ChangeSecurityChecks enables/disables Security Thread Tool checks or changes their interval by names.
rpc ChangeSecurityChecks(ChangeSecurityChecksRequest) returns (ChangeSecurityChecksResponse) {
option (google.api.http) = {
post: "/v1/management/SecurityChecks/Change"
Expand Down

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

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

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

26 changes: 25 additions & 1 deletion api/managementpb/json/managementpb.json
Original file line number Diff line number Diff line change
Expand Up @@ -5491,7 +5491,7 @@
"tags": [
"SecurityChecks"
],
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks by names.",
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks or changes their interval by names.",
"operationId": "ChangeSecurityChecks",
"parameters": [
{
Expand All @@ -5515,6 +5515,18 @@
"type": "boolean",
"x-order": 1
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 3
},
"name": {
"description": "The name of the check to change.",
"type": "string",
Expand Down Expand Up @@ -5737,6 +5749,18 @@
"type": "boolean",
"x-order": 1
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 4
},
"name": {
"description": "Machine-readable name (ID) that is used in expression.",
"type": "string",
Expand Down
26 changes: 25 additions & 1 deletion api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -22615,7 +22615,7 @@
"tags": [
"SecurityChecks"
],
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks by names.",
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks or changes their interval by names.",
"operationId": "ChangeSecurityChecks",
"parameters": [
{
Expand Down Expand Up @@ -22643,6 +22643,18 @@
"disable": {
"type": "boolean",
"x-order": 2
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 3
}
}
},
Expand Down Expand Up @@ -22870,6 +22882,18 @@
"description": "Short human-readable summary.",
"type": "string",
"x-order": 3
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 4
}
}
},
Expand Down
26 changes: 25 additions & 1 deletion api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -17780,7 +17780,7 @@
"tags": [
"SecurityChecks"
],
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks by names.",
"summary": "ChangeSecurityChecks enables/disables Security Thread Tool checks or changes their interval by names.",
"operationId": "ChangeSecurityChecks",
"parameters": [
{
Expand Down Expand Up @@ -17808,6 +17808,18 @@
"disable": {
"type": "boolean",
"x-order": 2
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 3
}
}
},
Expand Down Expand Up @@ -18035,6 +18047,18 @@
"description": "Short human-readable summary.",
"type": "string",
"x-order": 3
},
"interval": {
"description": "SecurityCheckInterval represents possible execution interval values for checks.",
"type": "string",
"default": "SECURITY_CHECK_INTERVAL_INVALID",
"enum": [
"SECURITY_CHECK_INTERVAL_INVALID",
"STANDARD",
"FREQUENT",
"RARE"
],
"x-order": 4
}
}
},
Expand Down

0 comments on commit ab1dbca

Please sign in to comment.