Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Policies to reuse OSS components #2910

Merged
merged 33 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
976b469
refactor app violations to use OSS app violations
waleedhammam May 28, 2023
4aa37c5
refactor policies API
Samra10 Jun 1, 2023
541b15e
import policies from OSS
AsmaaNabilBakr Jun 8, 2023
543e168
bump policy agent chart to version 2.4.0 (#2904)
waleedhammam May 31, 2023
1409193
Use the Kubernetes RBAC machinery
squaremo May 22, 2023
eae4b9c
Rewrite TestQueryIteration
squaremo May 23, 2023
7111608
Add support for access by resource name to query service
jpellizzari May 17, 2023
edf0a23
Benchmark RBAC access control
squaremo May 24, 2023
6471dbd
Benchmarks for objects > clusters and vice versa
squaremo May 24, 2023
80cb8f6
Caching for rolebindings and roles
squaremo May 24, 2023
3971563
Avoid mapping subresources to kinds
squaremo May 25, 2023
bcb9e1d
Adding http metrics to wge for any api endpoint (#2867)
enekofb May 31, 2023
fc18815
set baseBranch to create resource payload (#2895)
ahussein3 Jun 5, 2023
c047031
Disable dark mode on ee sign in page (#2914)
joshri Jun 5, 2023
0eac7ad
Remove makeStyles hook from Breadcrumbs component (#2918)
joshri Jun 6, 2023
764f1e0
dark mode prep for clusters folder (#2922)
joshri Jun 7, 2023
2120638
Bump OSS version to v0.25.0 (#2925)
waleedhammam Jun 8, 2023
577b682
2874 app violations (#2919)
TheGostKasper Jun 8, 2023
49ae9a8
refactor app violations to use OSS app violations
waleedhammam May 28, 2023
acf31c8
import policies from OSS
AsmaaNabilBakr Jun 8, 2023
9bf4cf5
Merge branch 'main' into 2857-policies-refactor
Samra10 Jun 8, 2023
13c1cb5
update go.mod
Samra10 Jun 8, 2023
c295ed9
fix error handler in policy details, rename pages
AsmaaNabilBakr Jun 8, 2023
81c6ff9
remove dublicates
AsmaaNabilBakr Jun 8, 2023
26f05e7
Merge branch 'main' into 2857-policies-refactor
AsmaaNabilBakr Jun 8, 2023
9f53ae7
Merge branch 'main' into 2857-policies-refactor
Samra10 Jun 11, 2023
06cb0eb
fix linting
Samra10 Jun 11, 2023
3a7ad8d
fix policy unit test
AsmaaNabilBakr Jun 12, 2023
1d131e3
Merge branch 'main' into 2857-policies-refactor
AsmaaNabilBakr Jun 12, 2023
a6c3b38
update snap
AsmaaNabilBakr Jun 12, 2023
9a7d49a
fix parameter naming
Samra10 Jun 12, 2023
6c3e2ae
Merge branch 'main' into 2857-policies-refactor
AsmaaNabilBakr Jun 13, 2023
c46173c
fix conflict
AsmaaNabilBakr Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 0 additions & 150 deletions cmd/clusters-service/api/cluster_services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -134,43 +134,6 @@ service ClustersService {
};
}

// ListPolicies list policies available on the management cluster
rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse) {
option (google.api.http) = {
get : "/v1/policies"
};
}

// GetPolicy gets a policy on the management cluster by name
rpc GetPolicy(GetPolicyRequest) returns (GetPolicyResponse) {
option (google.api.http) = {
get : "/v1/policies/{policy_name}"
};
}

/*
* ListPolicyValidations list policy validations
* available on the management cluster
*/
rpc ListPolicyValidations(ListPolicyValidationsRequest)
returns (ListPolicyValidationsResponse) {
option (google.api.http) = {
post : "/v1/policyviolations"
body : "*"
};
}

/*
* GetPolicyValidation gets a policy validations
* on the management cluster by id
*/
rpc GetPolicyValidation(GetPolicyValidationRequest)
returns (GetPolicyValidationResponse) {
option (google.api.http) = {
get : "/v1/policyviolations/{violation_id}"
};
}

// ListEvents returns the k8s events for a given object
rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -425,78 +388,6 @@ message ListGitopsClustersResponse {
repeated ListError errors = 4;
}

message GetPolicyRequest {
string policy_name = 1;
string clusterName = 2;
}
message ListPoliciesRequest {
string clusterName = 1;
Pagination pagination = 2;
}

message GetPolicyResponse {
Policy policy = 1;
string clusterName = 2;
}

message ListPoliciesResponse {
repeated Policy policies = 1;
int32 total = 2;
string nextPageToken = 3;
repeated ListError errors = 4;
}

message ListPolicyValidationsRequest{
string clusterName = 1;
Pagination pagination = 2;
string application = 3;
string namespace = 4;
string kind = 5;
}
message ListPolicyValidationsResponse {
repeated PolicyValidation violations = 1;
int32 total = 2;
string nextPageToken = 3;
repeated ListError errors = 4;
}

message GetPolicyValidationRequest{
string violation_id = 1;
string clusterName = 2;
}
message GetPolicyValidationResponse{ PolicyValidation violation = 1; }

message PolicyValidationOccurrence {
string message = 1;
}

message PolicyValidationParam {
string name = 1;
string type = 2;
google.protobuf.Any value = 3;
bool required = 4;
string config_ref = 5;
}

message PolicyValidation{
string id = 1;
string message = 2;
string cluster_id = 3;
string category = 4;
string severity = 5;
string created_at = 6;
string entity=7;
string namespace=8;
string violating_entity=9;
string description=10;
string how_to_solve=11;
string name=12;
string clusterName = 13;
repeated PolicyValidationOccurrence occurrences = 14;
string policy_id = 15;
repeated PolicyValidationParam parameters = 16;
}

message CreatePullRequestRequest {
// The repository to use.
string repository_url = 1;
Expand Down Expand Up @@ -892,47 +783,6 @@ message GetConfigResponse {

message PolicyParamRepeatedString { repeated string value = 1; }

message PolicyParam {
string name = 1;
string type = 2;
// value is a generic value that can be a string, int, bool and array of
// strings
google.protobuf.Any value = 3;
bool required = 4;
}

message PolicyTargetLabel { map<string, string> values = 1; }

message PolicyTargets {
repeated string kinds = 1;
repeated PolicyTargetLabel labels = 2;
repeated string namespaces = 3;
}

message PolicyStandard {
string id = 1;
repeated string controls = 2;
}

message Policy {
string name = 1;
string id = 2;
string code = 3;
string description = 4;
string how_to_solve = 5;
string category = 6;
repeated string tags = 7;
string severity = 8;
repeated PolicyStandard standards = 9;
string git_commit = 10;
repeated PolicyParam parameters = 11;
PolicyTargets targets = 12;
string created_at = 13;
string clusterName = 14;
string tenant = 15;
repeated string modes = 16;
}

message ObjectRef {
string kind = 1;
string name = 2;
Expand Down
Loading