Engineering decisions: Security attributes
In the interest of better transparency, we will use this Issue to share engineering decisions that have been made, in the scope of the parent Epic: Security Attributes/Context Filtering (&18010) • Michael Omokoh • 18.9
Finalized decisions should go in the below Decisions section, while topics that require discussion should go to a new thread below, and then the decision should be brought back here to the Description once it has been reached.
Engineering Decisions
- Feature Flags:
security_context_labelscontrols whether the feature is visible at all [FF] `security_context_labels` -- Categorize pr... (#551226 - closed)custom_ability_admin_security_attributescontrols whether theEdit security attributescustom ability is shown as an option for Custom rolessecurity_categories_and_attributesbulk_edit_security_attributes(#577576 (closed))security_attribute_inventory_filters(!209690 (merged))
Product decisions
- GitLab Ultimate license is required to use the feature. See comment
🧵 - Who has permission to configure the available set of attributes for a group? We should create a new permission that can be assigned to users to give them CRUD capabilities for security attributes: (
admin_security_attributes) we can include the permission in the default security role, so anyone with that role will have access by default. See comment🧵 - Who has permission to apply attributes to a project? Seems like we don't need a new permission for this - any user who can view the project's security configuration can apply labels. See comment
🧵
GraphQL Proposal (still in discussion)
Here's a proposed schema:
Definitions
SecurityAttributeCategory
type SecurityAttributeCategory {
id: ID!
name: String!
description: String
multipleSelection: Boolean
editableState: EditableStateEnum
attributeCount: Int
attributes: [SecurityAttribute!]
}editableStatecan be an enum?LOCKED:PARTIALLY_EDITABLE:EDITABLE:- ?
SecurityAttribute
type SecurityAttribute {
id: ID!
categoryId: ID!
name: String!
description: String
color: String!
}- should we have it as
nameorlabel?name
Queries
Group-level
getSecurityAttributes
query getSecurityAttributes($fullPath: ID!, $categoryId: ID) {
group(fullPath: $fullPath) {
securityAttributeCategories {
nodes {
id
name
description
multipleSelection
editableState
attributeCount
}
}
securityAttributes(categoryId: $categoryId) {
nodes {
id
categoryId
name
description
color
}
}
}
}- is it beneficial to have two separate queries -
securityAttributeCategoriesas well assecurityAttributes?
Project Level
List attributes applied to a project
project(fullPath: "gitlab-org/gitlab") {
securityAttributes {
nodes {
id
name
description
color
category {
id
name
multipleSelection
...
}
}
}
}Mutations
securityAttributeCategoryCreate
mutation securityAttributeCategoryCreate($input: SecurityAttributeCategoryCreateInput!) {
securityAttributeCategoryCreate(input: $input) {
id
errors
securityAttributeCategory {
...SecurityAttributeCategoryFragment
}
}
}
input SecurityAttributeCategoryCreateInput {
groupPath: ID! # Full path of the top-level group
name: String! # Category name (e.g., "Application Type")
description: String # Optional category description
multipleSelection: Boolean # true for multi-select, false for single
editableState: EditableStateEnum # LOCKED, PARTIALLY_EDITABLE, EDITABLE
attributes: [SecurityAttributeInput!]! # Initial attributes to create
}securityAttributeCategoryUpdate
mutation securityAttributeCategoryUpdate($input: SecurityAttributeCategoryUpdateInput!) {
securityAttributeCategoryUpdate(input: $input) {
id
errors
securityAttributeCategory {
...SecurityAttributeCategoryFragment
}
}
}
input SecurityAttributeCategoryUpdateInput {
id: ID! # Category ID to update
name: String # Optional updates
description: String
multipleSelection: Boolean
editableState: EditableStateEnum
attributes: [SecurityAttributeInput!]! # Modified list of attributes (can include existing or new)
}- should we include
groupPathas well?
securityAttributeCategoryDelete
mutation securityAttributeCategoryDelete($input: SecurityAttributeCategoryDeleteInput!) {
securityAttributeCategoryDelete(input: $input) {
errors
}
}
input SecurityAttributeCategoryDeleteInput {
id: ID! # ID of the category to delete
groupPath: ID! # For context/authorization
}- can
groupPathbe avoided?
securityAttributeDelete
mutation securityAttributeDelete($input: SecurityAttributeDeleteInput!) {
securityAttributeDelete(input: $input) {
errors
}
}
input SecurityAttributeDeleteInput {
id: ID! # ID of the attribute to delete
categoryId: ID! # ID of the category the attribute belongs to (for context or validation)
groupPath: ID! # Full path of the group (for authorization context)
}question:
- can
categoryIdorgroupPathbe avoided?
Filters
- To be evaluated
Edited by 🤖 GitLab Bot 🤖