Documentation
¶
Index ¶
- Constants
- type Group
- type GroupsResponse
- type NewUser
- type Permission
- type PermissionUpdateBody
- type PermissionsList
- type ReqOpt
- type Role
- type RoleDetails
- type RolesResponse
- type TenableObject
- type TenableVMClient
- func (c *TenableVMClient) CreateUser(ctx context.Context, newUser NewUser) (*User, error)
- func (c *TenableVMClient) CreateUserGroupMembership(ctx context.Context, groupId string, userId string, add bool) error
- func (c *TenableVMClient) DeleteUser(ctx context.Context, userId string) error
- func (c *TenableVMClient) DeleteUserGroupMembership(ctx context.Context, groupId string, userId string) error
- func (c *TenableVMClient) DisableUser(ctx context.Context, userId string) (*User, error)
- func (c *TenableVMClient) EnableUser(ctx context.Context, userId string) (*User, error)
- func (c *TenableVMClient) GetGroupMembers(ctx context.Context, groupId string) ([]User, annotations.Annotations, error)
- func (c *TenableVMClient) GetGroups(ctx context.Context) ([]Group, annotations.Annotations, error)
- func (c *TenableVMClient) GetPermissionDetails(ctx context.Context, uuid string) (*Permission, error)
- func (c *TenableVMClient) GetRoles(ctx context.Context) ([]*RoleDetails, annotations.Annotations, error)
- func (c *TenableVMClient) GetUserDetails(ctx context.Context, userId string) (*User, error)
- func (c *TenableVMClient) GetUserRoles(ctx context.Context, userUUID string) (*UserRole, error)
- func (c *TenableVMClient) GetUsers(ctx context.Context) ([]User, annotations.Annotations, error)
- func (c *TenableVMClient) ListPermissions(ctx context.Context) ([]Permission, annotations.Annotations, error)
- func (c *TenableVMClient) UpdatePermission(ctx context.Context, updatedPermission *Permission) error
- func (c *TenableVMClient) UpdateUser(ctx context.Context, userId string, body UserUpdateReqBody) (*User, error)
- func (c *TenableVMClient) UpdateUserRoles(ctx context.Context, userUUID string, roleUUID string) (*UserRole, error)
- type User
- type UserEnabledReqBody
- type UserRole
- type UserRoleReqBody
- type UserUpdateReqBody
- type UsersResponse
Constants ¶
View Source
const ( BaseURL = "https://cloud.tenable.com" BaseUsersPath = "/users" UserPath = "/users/%s" // uses user id ListGroupsPath = "/groups" ListGroupMembersPath = "/groups/%s/users" UserGroupMembershipPath = "/groups/%s/users/%s" UserRolePath = "/access-control/v1/users/%s/roles" // uses user uuid, not id RolesPath = "/access-control/v1/roles" PermissionsPath = "/api/v3/access-control/permissions" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GroupsResponse ¶
type GroupsResponse struct {
Groups []Group `json:"groups"`
}
type NewUser ¶
type NewUser struct {
Username string `json:"username,omitempty"`
// The initial password for the user.
// Passwords must be at least 12 characters long and contain:
// at least one uppercase letter, one lowercase letter, one number,
// and one special character symbol.
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Permissions int `json:"permissions,omitempty"`
}
type Permission ¶
type Permission struct {
UUID uuid.UUID `json:"permission_uuid,omitempty"`
Name string `json:"name,omitempty"`
Actions []string `json:"actions,omitempty"`
Objects []TenableObject `json:"objects,omitempty"`
Subjects []TenableObject `json:"subjects,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedAt int64 `json:"updated_at,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
}
type PermissionUpdateBody ¶
type PermissionUpdateBody struct {
Name string `json:"name,omitempty"`
Actions []string `json:"actions,omitempty"`
Objects []TenableObject `json:"objects,omitempty"`
Subjects []TenableObject `json:"subjects,omitempty"`
}
type PermissionsList ¶
type PermissionsList struct {
Permissions []Permission `json:"permissions,omitempty"`
}
type RoleDetails ¶ added in v0.0.2
type RolesResponse ¶
type RolesResponse struct {
Roles []User `json:"roles"`
}
type TenableObject ¶
type TenableVMClient ¶
type TenableVMClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(ctx context.Context, accessKey, secretKey string) (*TenableVMClient, error)
func (*TenableVMClient) CreateUser ¶
func (*TenableVMClient) CreateUserGroupMembership ¶
func (*TenableVMClient) DeleteUser ¶ added in v0.0.3
func (c *TenableVMClient) DeleteUser(ctx context.Context, userId string) error
func (*TenableVMClient) DeleteUserGroupMembership ¶
func (*TenableVMClient) DisableUser ¶ added in v0.0.3
func (*TenableVMClient) EnableUser ¶ added in v0.0.3
func (*TenableVMClient) GetGroupMembers ¶
func (c *TenableVMClient) GetGroupMembers(ctx context.Context, groupId string) ([]User, annotations.Annotations, error)
func (*TenableVMClient) GetGroups ¶
func (c *TenableVMClient) GetGroups(ctx context.Context) ([]Group, annotations.Annotations, error)
func (*TenableVMClient) GetPermissionDetails ¶
func (c *TenableVMClient) GetPermissionDetails(ctx context.Context, uuid string) (*Permission, error)
func (*TenableVMClient) GetRoles ¶ added in v0.0.2
func (c *TenableVMClient) GetRoles(ctx context.Context) ([]*RoleDetails, annotations.Annotations, error)
func (*TenableVMClient) GetUserDetails ¶
func (*TenableVMClient) GetUserRoles ¶
func (*TenableVMClient) GetUsers ¶
func (c *TenableVMClient) GetUsers(ctx context.Context) ([]User, annotations.Annotations, error)
API pagination support is limited to specific endpoints. As per documentation https://developer.tenable.com/reference/users-list does not include pagination.
func (*TenableVMClient) ListPermissions ¶
func (c *TenableVMClient) ListPermissions(ctx context.Context) ([]Permission, annotations.Annotations, error)
func (*TenableVMClient) UpdatePermission ¶
func (c *TenableVMClient) UpdatePermission(ctx context.Context, updatedPermission *Permission) error
func (*TenableVMClient) UpdateUser ¶
func (c *TenableVMClient) UpdateUser(ctx context.Context, userId string, body UserUpdateReqBody) (*User, error)
func (*TenableVMClient) UpdateUserRoles ¶
type User ¶
type User struct {
ID int `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Username string `json:"username,omitempty"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
LastLogin int64 `json:"lastlogin,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Permissions int `json:"permissions,omitempty"`
ContainerUUID string `json:"container_uuid,omitempty"`
RbacRoles []Role `json:"rbac_roles,omitempty"`
Roles []string `json:"roles,omitempty"`
GroupUUIDs []string `json:"group_uuids,omitempty"`
}
type UserEnabledReqBody ¶ added in v0.0.3
type UserEnabledReqBody struct {
Enabled bool `json:"enabled"`
}
type UserRoleReqBody ¶
type UserRoleReqBody struct {
RolesUUIDs []string `json:"role_uuids,omitempty"`
}
type UserUpdateReqBody ¶
type UsersResponse ¶
type UsersResponse struct {
Users []User `json:"users"`
}
Click to show internal directories.
Click to hide internal directories.