* revendor

* revert loglevel

* M

* all prov

* Revert "revert loglevel"

This reverts commit fe0c64ffaa.

* revendor

* revendor

* Added more ops
This commit is contained in:
Arulvel Muralidharan 2023-05-05 14:42:31 -07:00 коммит произвёл GitHub
Родитель 95f78a72b2
Коммит 0ebed11fed
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 292 добавлений и 35 удалений

2
go.mod
Просмотреть файл

@ -7,7 +7,7 @@ require (
github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/date v0.2.0
github.com/google/uuid v1.3.0
github.com/microsoft/moc v0.11.0-alpha.4
github.com/microsoft/moc v0.11.0-alpha.5
google.golang.org/grpc v1.54.0
k8s.io/klog v1.0.0
)

4
go.sum
Просмотреть файл

@ -577,8 +577,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/microsoft/moc v0.11.0-alpha.4 h1:ZGoM9jaMmEVweiX5o2Wy/3xwikIl9xl2gueccQg/KkI=
github.com/microsoft/moc v0.11.0-alpha.4/go.mod h1:gvxuYApVO2jbL+mjOC1/gseLW5An2iDvm0lckLwBuLI=
github.com/microsoft/moc v0.11.0-alpha.5 h1:tpYyU77TCN+KOJyHjeAVKs1UiZPNvG3DLv/6zfCpl4Y=
github.com/microsoft/moc v0.11.0-alpha.5/go.mod h1:gvxuYApVO2jbL+mjOC1/gseLW5An2iDvm0lckLwBuLI=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=

Просмотреть файл

@ -110,12 +110,182 @@ func getMocProviderAction(action *security.Action) (wssdcloudcommon.ProviderAcce
}
switch action.ProviderOperation {
case security.Authentication_LoginAccess:
return wssdcloudcommon.ProviderAccessOperation_Authentication_Login, nil
case security.Certificate_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Create, nil
case security.Certificate_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Update, nil
case security.Certificate_GetAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Get, nil
case security.Certificate_DeleteAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Delete, nil
case security.Certificate_SignAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Sign, nil
case security.Certificate_RenewAccess:
return wssdcloudcommon.ProviderAccessOperation_Certificate_Renew, nil
case security.Identity_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Identity_Create, nil
case security.Identity_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Identity_Update, nil
case security.Identity_RevokeAccess:
return wssdcloudcommon.ProviderAccessOperation_Identity_Revoke, nil
case security.Identity_RotateAccess:
return wssdcloudcommon.ProviderAccessOperation_Identity_Rotate, nil
case security.IdentityCertificate_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_IdentityCertificate_Create, nil
case security.IdentityCertificate_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_IdentityCertificate_Update, nil
case security.IdentityCertificate_RenewAccess:
return wssdcloudcommon.ProviderAccessOperation_IdentityCertificate_Renew, nil
case security.Key_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Create, nil
case security.Key_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Update, nil
case security.Key_EncryptAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Encrypt, nil
case security.Key_DecryptAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Decrypt, nil
case security.Key_WrapKeyAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_WrapKey, nil
case security.Key_UnwrapKeyAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_UnwrapKey, nil
case security.Key_SignAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Sign, nil
case security.Key_VerifyAccess:
return wssdcloudcommon.ProviderAccessOperation_Key_Verify, nil
case security.VirtualMachine_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Create, nil
case security.VirtualMachine_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Update, nil
case security.VirtualMachine_DeleteAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Delete, nil
case security.VirtualMachine_ValidateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Validate, nil
case security.VirtualMachine_StartAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Start, nil
case security.VirtualMachine_StopAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Stop, nil
case security.VirtualMachine_ResetAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachine_Reset, nil
case security.Cluster_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_Create, nil
case security.Cluster_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_Update, nil
case security.Cluster_LoadClusterAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_LoadCluster, nil
case security.Cluster_UnloadClusterAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_UnloadCluster, nil
case security.Cluster_GetClusterAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_GetCluster, nil
case security.Cluster_GetNodesAccess:
return wssdcloudcommon.ProviderAccessOperation_Cluster_GetNodes, nil
case security.Debug_DebugServerAccess:
return wssdcloudcommon.ProviderAccessOperation_Debug_DebugServer, nil
case security.Debug_StackTraceAccess:
return wssdcloudcommon.ProviderAccessOperation_Debug_StackTrace, nil
case security.BaremetalHost_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_BaremetalHost_Create, nil
case security.BaremetalHost_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_BaremetalHost_Update, nil
case security.BaremetalMachine_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_BaremetalMachine_Create, nil
case security.BaremetalMachine_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_BaremetalMachine_Update, nil
case security.ControlPlane_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_ControlPlane_Create, nil
case security.ControlPlane_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_ControlPlane_Update, nil
case security.EtcdCluster_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_EtcdCluster_Create, nil
case security.EtcdCluster_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_EtcdCluster_Update, nil
case security.EtcdServer_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_EtcdServer_Create, nil
case security.EtcdServer_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_EtcdServer_Update, nil
case security.GalleryImage_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_GalleryImage_Create, nil
case security.GalleryImage_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_GalleryImage_Update, nil
case security.Group_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Group_Create, nil
case security.Group_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Group_Update, nil
case security.KeyVault_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_KeyVault_Create, nil
case security.KeyVault_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_KeyVault_Update, nil
case security.Kubernetes_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Kubernetes_Create, nil
case security.Kubernetes_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Kubernetes_Update, nil
case security.LoadBalancer_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_LoadBalancer_Create, nil
case security.LoadBalancer_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_LoadBalancer_Update, nil
case security.Location_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Location_Create, nil
case security.Location_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Location_Update, nil
case security.Macpool_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Macpool_Create, nil
case security.Macpool_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Macpool_Update, nil
case security.NetworkInterface_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_NetworkInterface_Create, nil
case security.NetworkInterface_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_NetworkInterface_Update, nil
case security.Node_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Node_Create, nil
case security.Node_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Node_Update, nil
case security.Recovery_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Recovery_Create, nil
case security.Recovery_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Recovery_Update, nil
case security.Role_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Role_Create, nil
case security.Role_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Role_Update, nil
case security.RoleAssignment_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_RoleAssignment_Create, nil
case security.RoleAssignment_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_RoleAssignment_Update, nil
case security.Secret_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Secret_Create, nil
case security.Secret_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Secret_Update, nil
case security.StorageContainer_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_StorageContainer_Create, nil
case security.StorageContainer_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_StorageContainer_Update, nil
case security.Subscription_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_Subscription_Create, nil
case security.Subscription_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_Subscription_Update, nil
case security.Validation_ValidateAccess:
return wssdcloudcommon.ProviderAccessOperation_Validation_Validate, nil
case security.VipPool_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VipPool_Create, nil
case security.VipPool_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VipPool_Update, nil
case security.VirtualHardDisk_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualHardDisk_Create, nil
case security.VirtualHardDisk_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualHardDisk_Update, nil
case security.VirtualMachineImage_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachineImage_Create, nil
case security.VirtualMachineImage_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachineImage_Update, nil
case security.VirtualMachineScaleSet_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachineScaleSet_Create, nil
case security.VirtualMachineScaleSet_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualMachineScaleSet_Update, nil
case security.VirtualNetwork_CreateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualNetwork_Create, nil
case security.VirtualNetwork_UpdateAccess:
return wssdcloudcommon.ProviderAccessOperation_VirtualNetwork_Update, nil
default:
return wssdcloudcommon.ProviderAccessOperation_Unspecified, errors.Wrapf(errors.InvalidInput, "([provideraction] Access: [%v]", action.ProviderOperation)
}

Просмотреть файл

@ -183,43 +183,130 @@ const (
type ProviderAccessOperation string
const (
Unspecified_Access ProviderAccessOperation = "unspecified"
Authentication_LoginAccess ProviderAccessOperation = "authentication_login"
Certificate_GetAccess ProviderAccessOperation = "certificate_get"
Certificate_DeleteAccess ProviderAccessOperation = "certificate_delete"
Certificate_SignAccess ProviderAccessOperation = "certificate_sign"
Certificate_RenewAccess ProviderAccessOperation = "certificate_renew"
VirtualMachine_StartAccess ProviderAccessOperation = "virtualmachine_start"
VirtualMachine_StopAccess ProviderAccessOperation = "virtualmachine_stop"
VirtualMachine_ResetAccess ProviderAccessOperation = "virtualmachine_reset"
Unspecified_Access ProviderAccessOperation = "unspecified"
Authentication_LoginAccess ProviderAccessOperation = "authentication_login"
Certificate_CreateAccess ProviderAccessOperation = "certificate_create"
Certificate_UpdateAccess ProviderAccessOperation = "certificate_update"
Certificate_GetAccess ProviderAccessOperation = "certificate_get"
Certificate_DeleteAccess ProviderAccessOperation = "certificate_delete"
Certificate_SignAccess ProviderAccessOperation = "certificate_sign"
Certificate_RenewAccess ProviderAccessOperation = "certificate_renew"
Identity_CreateAccess ProviderAccessOperation = "identity_create"
Identity_UpdateAccess ProviderAccessOperation = "identity_update"
Identity_RevokeAccess ProviderAccessOperation = "identity_revoke"
Identity_RotateAccess ProviderAccessOperation = "identity_rotate"
IdentityCertificate_CreateAccess ProviderAccessOperation = "identitycertificate_create"
IdentityCertificate_UpdateAccess ProviderAccessOperation = "identitycertificate_update"
IdentityCertificate_RenewAccess ProviderAccessOperation = "identitycertificate_renew"
Key_CreateAccess ProviderAccessOperation = "key_create"
Key_UpdateAccess ProviderAccessOperation = "key_update"
Key_EncryptAccess ProviderAccessOperation = "key_encrypt"
Key_DecryptAccess ProviderAccessOperation = "key_decrypt"
Key_WrapKeyAccess ProviderAccessOperation = "key_wrapkey"
Key_UnwrapKeyAccess ProviderAccessOperation = "key_unwrapkey"
Key_SignAccess ProviderAccessOperation = "key_sign"
Key_VerifyAccess ProviderAccessOperation = "key_verify"
VirtualMachine_CreateAccess ProviderAccessOperation = "virtualmachine_create"
VirtualMachine_UpdateAccess ProviderAccessOperation = "virtualmachine_update"
VirtualMachine_DeleteAccess ProviderAccessOperation = "virtualmachine_delete"
VirtualMachine_ValidateAccess ProviderAccessOperation = "virtualmachine_validate"
VirtualMachine_StartAccess ProviderAccessOperation = "virtualmachine_start"
VirtualMachine_StopAccess ProviderAccessOperation = "virtualmachine_stop"
VirtualMachine_ResetAccess ProviderAccessOperation = "virtualmachine_reset"
Cluster_CreateAccess ProviderAccessOperation = "cluster_create"
Cluster_UpdateAccess ProviderAccessOperation = "cluster_update"
Cluster_LoadClusterAccess ProviderAccessOperation = "cluster_loadcluster"
Cluster_UnloadClusterAccess ProviderAccessOperation = "cluster_unloadcluster"
Cluster_GetClusterAccess ProviderAccessOperation = "cluster_getcluster"
Cluster_GetNodesAccess ProviderAccessOperation = "cluster_getnodes"
)
// Unspecified = 0;
// Authentication_Login = 1;
// Certificate_Get = 2;
// Certificate_Delete = 3;
// Certificate_Sign = 4;
// Certificate_Renew = 5;
// Identity_Revoke = 6;
// Identity_Rotate = 7;
// Identity_OperateCertificates = 8;
// Key_Encrypt = 9;
// Key_Decrypt = 10;
// Key_WrapKey = 11;
// Key_UnwrapKey = 12;
// Key_Sign = 13;
// Key_Verify = 14;
// VirtualMachine_Start = 15;
// VirtualMachine_Stop= 16;
// VirtualMachine_Reset = 17;
// Cluster_LoadCluster = 18;
// Cluster_UnloadCluster = 19;
// Cluster_GetCluster = 20;
// Cluster_GetNodes = 21;
Debug_DebugServerAccess ProviderAccessOperation = "debug_debugserver"
Debug_StackTraceAccess ProviderAccessOperation = "debug_stacktrace"
BaremetalHost_CreateAccess ProviderAccessOperation = "baremetalhost_create"
BaremetalHost_UpdateAccess ProviderAccessOperation = "baremetalhost_update"
BaremetalMachine_CreateAccess ProviderAccessOperation = "baremetalmachine_create"
BaremetalMachine_UpdateAccess ProviderAccessOperation = "baremetalmachine_update"
ControlPlane_CreateAccess ProviderAccessOperation = "controlplane_create"
ControlPlane_UpdateAccess ProviderAccessOperation = "controlplane_update"
EtcdCluster_CreateAccess ProviderAccessOperation = "etcdcluster_create"
EtcdCluster_UpdateAccess ProviderAccessOperation = "etcdcluster_update"
EtcdServer_CreateAccess ProviderAccessOperation = "etcdserver_create"
EtcdServer_UpdateAccess ProviderAccessOperation = "etcdserver_update"
GalleryImage_CreateAccess ProviderAccessOperation = "galleryimage_create"
GalleryImage_UpdateAccess ProviderAccessOperation = "galleryimage_update"
Group_CreateAccess ProviderAccessOperation = "group_create"
Group_UpdateAccess ProviderAccessOperation = "group_update"
KeyVault_CreateAccess ProviderAccessOperation = "keyvault_create"
KeyVault_UpdateAccess ProviderAccessOperation = "keyvault_update"
Kubernetes_CreateAccess ProviderAccessOperation = "kubernetes_create"
Kubernetes_UpdateAccess ProviderAccessOperation = "kubernetes_update"
LoadBalancer_CreateAccess ProviderAccessOperation = "loadbalancer_create"
LoadBalancer_UpdateAccess ProviderAccessOperation = "loadbalancer_update"
Location_CreateAccess ProviderAccessOperation = "location_create"
Location_UpdateAccess ProviderAccessOperation = "location_update"
Macpool_CreateAccess ProviderAccessOperation = "macpool_create"
Macpool_UpdateAccess ProviderAccessOperation = "macpool_update"
NetworkInterface_CreateAccess ProviderAccessOperation = "networkinterface_create"
NetworkInterface_UpdateAccess ProviderAccessOperation = "networkinterface_update"
Node_CreateAccess ProviderAccessOperation = "node_create"
Node_UpdateAccess ProviderAccessOperation = "node_update"
Recovery_CreateAccess ProviderAccessOperation = "recovery_create"
Recovery_UpdateAccess ProviderAccessOperation = "recovery_update"
Role_CreateAccess ProviderAccessOperation = "role_create"
Role_UpdateAccess ProviderAccessOperation = "role_update"
RoleAssignment_CreateAccess ProviderAccessOperation = "roleassignment_create"
RoleAssignment_UpdateAccess ProviderAccessOperation = "roleassignment_update"
Secret_CreateAccess ProviderAccessOperation = "secret_create"
Secret_UpdateAccess ProviderAccessOperation = "secret_update"
StorageContainer_CreateAccess ProviderAccessOperation = "storagecontainer_create"
StorageContainer_UpdateAccess ProviderAccessOperation = "storagecontainer_update"
Subscription_CreateAccess ProviderAccessOperation = "subscription_create"
Subscription_UpdateAccess ProviderAccessOperation = "subscription_update"
Validation_ValidateAccess ProviderAccessOperation = "validation_validate"
VipPool_CreateAccess ProviderAccessOperation = "vippool_create"
VipPool_UpdateAccess ProviderAccessOperation = "vippool_update"
VirtualHardDisk_CreateAccess ProviderAccessOperation = "virtualharddisk_create"
VirtualHardDisk_UpdateAccess ProviderAccessOperation = "virtualharddisk_update"
VirtualMachineImage_CreateAccess ProviderAccessOperation = "virtualmachineimage_create"
VirtualMachineImage_UpdateAccess ProviderAccessOperation = "virtualmachineimage_update"
VirtualMachineScaleSet_CreateAccess ProviderAccessOperation = "virtualmachinescaleset_create"
VirtualMachineScaleSet_UpdateAccess ProviderAccessOperation = "virtualmachinescaleset_update"
VirtualNetwork_CreateAccess ProviderAccessOperation = "virtualnetwork_create"
VirtualNetwork_UpdateAccess ProviderAccessOperation = "virtualnetwork_update"
)
// Permissions permissions the identity has for keys, secrets, certificates and storage.
type Permissions struct {