mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-06-03 23:13:36 +00:00
Compare commits
7 Commits
master
...
permission
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bfc43295a | ||
|
|
879b4b1e7b | ||
|
|
e948637f79 | ||
|
|
c21e4c4276 | ||
|
|
9445806002 | ||
|
|
90a6fb3d40 | ||
|
|
fd5bf8c1b5 |
@@ -102,23 +102,10 @@ func CreateDefaultConfig() ConfigStruct {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Auth: configStructs.AuthConfig{
|
Auth: configStructs.AuthConfig{
|
||||||
RolesClaim: "role",
|
RolesClaim: "groups",
|
||||||
Roles: map[string]configStructs.Role{
|
DefaultRole: "kubeshark-viewer",
|
||||||
"admin": {
|
GroupMapping: map[string]string{},
|
||||||
Filter: "",
|
Roles: map[string]configStructs.RoleConfig{},
|
||||||
CanDownloadPCAP: true,
|
|
||||||
CanUseScripting: true,
|
|
||||||
ScriptingPermissions: configStructs.ScriptingPermissions{
|
|
||||||
CanSave: true,
|
|
||||||
CanActivate: true,
|
|
||||||
CanDelete: true,
|
|
||||||
},
|
|
||||||
CanUpdateTargetedPods: true,
|
|
||||||
CanStopTrafficCapturing: true,
|
|
||||||
CanControlDissection: true,
|
|
||||||
ShowAdminConsoleLink: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
EnabledDissectors: []string{
|
EnabledDissectors: []string{
|
||||||
"amqp",
|
"amqp",
|
||||||
|
|||||||
@@ -155,23 +155,6 @@ type ProbeConfig struct {
|
|||||||
FailureThreshold int `yaml:"failureThreshold" json:"failureThreshold" default:"3"`
|
FailureThreshold int `yaml:"failureThreshold" json:"failureThreshold" default:"3"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScriptingPermissions struct {
|
|
||||||
CanSave bool `yaml:"canSave" json:"canSave" default:"true"`
|
|
||||||
CanActivate bool `yaml:"canActivate" json:"canActivate" default:"true"`
|
|
||||||
CanDelete bool `yaml:"canDelete" json:"canDelete" default:"true"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Role struct {
|
|
||||||
Filter string `yaml:"filter" json:"filter" default:""`
|
|
||||||
CanDownloadPCAP bool `yaml:"canDownloadPCAP" json:"canDownloadPCAP" default:"false"`
|
|
||||||
CanUseScripting bool `yaml:"canUseScripting" json:"canUseScripting" default:"false"`
|
|
||||||
ScriptingPermissions ScriptingPermissions `yaml:"scriptingPermissions" json:"scriptingPermissions"`
|
|
||||||
CanUpdateTargetedPods bool `yaml:"canUpdateTargetedPods" json:"canUpdateTargetedPods" default:"false"`
|
|
||||||
CanStopTrafficCapturing bool `yaml:"canStopTrafficCapturing" json:"canStopTrafficCapturing" default:"false"`
|
|
||||||
CanControlDissection bool `yaml:"canControlDissection" json:"canControlDissection" default:"false"`
|
|
||||||
ShowAdminConsoleLink bool `yaml:"showAdminConsoleLink" json:"showAdminConsoleLink" default:"false"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SamlConfig struct {
|
type SamlConfig struct {
|
||||||
IdpMetadataUrl string `yaml:"idpMetadataUrl" json:"idpMetadataUrl"`
|
IdpMetadataUrl string `yaml:"idpMetadataUrl" json:"idpMetadataUrl"`
|
||||||
X509crt string `yaml:"x509crt" json:"x509crt"`
|
X509crt string `yaml:"x509crt" json:"x509crt"`
|
||||||
@@ -190,12 +173,40 @@ type AuthConfig struct {
|
|||||||
// NOTE: prior releases routed `oidc` to Descope. If you were using `oidc`
|
// NOTE: prior releases routed `oidc` to Descope. If you were using `oidc`
|
||||||
// to mean Descope, switch to `descope` (or `default`). The rename is a
|
// to mean Descope, switch to `descope` (or `default`). The rename is a
|
||||||
// breaking change documented in the release notes.
|
// breaking change documented in the release notes.
|
||||||
Type string `yaml:"type" json:"type" default:"saml"`
|
Type string `yaml:"type" json:"type" default:"saml"`
|
||||||
Roles map[string]Role `yaml:"roles" json:"roles"`
|
RolesClaim string `yaml:"rolesClaim" json:"rolesClaim"`
|
||||||
RolesClaim string `yaml:"rolesClaim" json:"rolesClaim"`
|
// DefaultRole is applied when the authenticated user's SSO claim has no
|
||||||
DefaultRole string `yaml:"defaultRole" json:"defaultRole"`
|
// recognized group. Must be one of the four built-in roles
|
||||||
DefaultFilter string `yaml:"defaultFilter" json:"defaultFilter"`
|
// (kubeshark-admin / kubeshark-realtime / kubeshark-snapshot /
|
||||||
Saml SamlConfig `yaml:"saml" json:"saml"`
|
// kubeshark-viewer), the name of an operator-defined role under
|
||||||
|
// `tap.auth.roles`, or empty for strict-deny.
|
||||||
|
DefaultRole string `yaml:"defaultRole" json:"defaultRole"`
|
||||||
|
// GroupMapping translates SSO group names into role names (built-in or
|
||||||
|
// operator-defined). Optional — groups whose name already matches a
|
||||||
|
// built-in role are identity-matched and don't need an entry here.
|
||||||
|
// Operator-defined role names MUST appear here to participate in
|
||||||
|
// resolution (identity-match is built-in-only).
|
||||||
|
GroupMapping map[string]string `yaml:"groupMapping" json:"groupMapping"`
|
||||||
|
// Roles is the operator-defined role catalogue, keyed by role name.
|
||||||
|
// Each role has its own capability set + namespace scope. Names with
|
||||||
|
// the `kubeshark-` prefix are reserved for built-ins and will be
|
||||||
|
// rejected at hub startup. Unknown capability strings are dropped
|
||||||
|
// with a warning; empty / "*" namespace specs mean deny-all-data and
|
||||||
|
// allow-all respectively.
|
||||||
|
Roles map[string]RoleConfig `yaml:"roles" json:"roles"`
|
||||||
|
Saml SamlConfig `yaml:"saml" json:"saml"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RoleConfig is an operator-defined role declared under tap.auth.roles.
|
||||||
|
// Capabilities is the closed vocabulary documented in the hub project
|
||||||
|
// (snapshot:read / snapshot:write / snapshot:dissection / dissection:live /
|
||||||
|
// dissection:control / pods:target:write / settings:write); unknown
|
||||||
|
// capability strings are warn-dropped at hub startup. Namespaces is a
|
||||||
|
// comma-separated list with `*` (allow-all) and glob (`foo-*`, `*-bar`,
|
||||||
|
// `*mid*`) support; empty string means deny-all-data.
|
||||||
|
type RoleConfig struct {
|
||||||
|
Capabilities []string `yaml:"capabilities" json:"capabilities"`
|
||||||
|
Namespaces string `yaml:"namespaces" json:"namespaces"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type IngressConfig struct {
|
type IngressConfig struct {
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ data:
|
|||||||
{{ (default false .Values.demoModeEnabled) | ternary "default" .Values.tap.auth.type }}
|
{{ (default false .Values.demoModeEnabled) | ternary "default" .Values.tap.auth.type }}
|
||||||
{{- end }}'
|
{{- end }}'
|
||||||
AUTH_SAML_IDP_METADATA_URL: '{{ .Values.tap.auth.saml.idpMetadataUrl }}'
|
AUTH_SAML_IDP_METADATA_URL: '{{ .Values.tap.auth.saml.idpMetadataUrl }}'
|
||||||
AUTH_ROLES: '{{ .Values.tap.auth.roles | toJson }}'
|
|
||||||
AUTH_ROLES_CLAIM: '{{ .Values.tap.auth.rolesClaim }}'
|
AUTH_ROLES_CLAIM: '{{ .Values.tap.auth.rolesClaim }}'
|
||||||
AUTH_DEFAULT_ROLE: '{{ default "" .Values.tap.auth.defaultRole }}'
|
AUTH_DEFAULT_ROLE: '{{ default "" .Values.tap.auth.defaultRole }}'
|
||||||
|
AUTH_GROUP_MAPPING: '{{ default (dict) .Values.tap.auth.groupMapping | toJson }}'
|
||||||
|
AUTH_ROLES: '{{ default (dict) .Values.tap.auth.roles | toJson }}'
|
||||||
AUTH_OIDC_ISSUER: '{{ default "not set" (((.Values.tap).auth).oidc).issuer }}'
|
AUTH_OIDC_ISSUER: '{{ default "not set" (((.Values.tap).auth).oidc).issuer }}'
|
||||||
AUTH_OIDC_REFRESH_TOKEN_LIFETIME: '{{ default "3960h" (((.Values.tap).auth).oidc).refreshTokenLifetime }}'
|
AUTH_OIDC_REFRESH_TOKEN_LIFETIME: '{{ default "3960h" (((.Values.tap).auth).oidc).refreshTokenLifetime }}'
|
||||||
AUTH_OIDC_STATE_PARAM_EXPIRY: '{{ default "10m" (((.Values.tap).auth).oidc).oauth2StateParamExpiry }}'
|
AUTH_OIDC_STATE_PARAM_EXPIRY: '{{ default "10m" (((.Values.tap).auth).oidc).oauth2StateParamExpiry }}'
|
||||||
|
|||||||
@@ -153,22 +153,10 @@ tap:
|
|||||||
auth:
|
auth:
|
||||||
enabled: false
|
enabled: false
|
||||||
type: saml
|
type: saml
|
||||||
roles:
|
rolesClaim: groups
|
||||||
admin:
|
defaultRole: kubeshark-viewer
|
||||||
filter: ""
|
groupMapping: {}
|
||||||
canDownloadPCAP: true
|
roles: {}
|
||||||
canUseScripting: true
|
|
||||||
scriptingPermissions:
|
|
||||||
canSave: true
|
|
||||||
canActivate: true
|
|
||||||
canDelete: true
|
|
||||||
canUpdateTargetedPods: true
|
|
||||||
canStopTrafficCapturing: true
|
|
||||||
canControlDissection: true
|
|
||||||
showAdminConsoleLink: true
|
|
||||||
rolesClaim: role
|
|
||||||
defaultRole: ""
|
|
||||||
defaultFilter: ""
|
|
||||||
saml:
|
saml:
|
||||||
idpMetadataUrl: ""
|
idpMetadataUrl: ""
|
||||||
x509crt: ""
|
x509crt: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user