Back to catalog

Linux Group Add Execution

No violationsstackroxhighruntime

Detects when the 'addgroup' or 'groupadd' binary is executed, which can be used to add a new linux group.

Rationale
Groups added in run time can be used to take ownership of files and processes
Remediation
Consider using a base image that doesn't have a shell such as SCRATCH or gcr.io/distroless. If not, modify your Dockerfile to use the exec form of CMD/ENTRYPOINT (["using braces"]) instead of the shell form (no braces)
CategoriesPrivilegesSystem Modification
Compliance mappingsView coverage →
DORA EU 2022/2554
Art. 9.2
ISO/IEC 27001 2022
A.8.2
NIST SP 800-53 rev. 5
AC-6SI-4
PCI DSS 4.0
7.2.1
SOC 2 2017 TSC
CC6.1

Generated artifacts

1 of 5 targets supported
linux-group-add-execution.yaml
- rule: linux-group-add-execution
  desc: Detects when the 'addgroup' or 'groupadd' binary is executed, which can be used to add a new linux group.
  condition: proc.name in ("addgroup|groupadd")
  output: Process %proc.name executed by user %user.name (uid=%user.uid) in container %container.id image=%container.image.repository (policy=Linux Group Add Execution)
  priority: ERROR
  source: syscall
  tags:
    - stackrox-import
    - policy
    - s
IR (canonical)
{
  "id": "a05e063b-f37f-4d36-99f3-7ff0cb2b3ba8",
  "name": "Linux Group Add Execution",
  "description": "Detects when the 'addgroup' or 'groupadd' binary is executed, which can be used to add a new linux group.",
  "rationale": "Groups added in run time can be used to take ownership of files and processes",
  "remediation": "Consider using a base image that doesn't have a shell such as SCRATCH or gcr.io/distroless. If not, modify your Dockerfile to use the exec form of CMD/ENTRYPOINT ([\"using braces\"]) instead of the shell form (no braces)",
  "severity": "high",
  "categories": [
    "Privileges",
    "System Modification"
  ],
  "lifecycle": [
    "runtime"
  ],
  "eventSource": "deployment",
  "scope": [],
  "exclusions": [],
  "enforcement": {
    "failBuild": false
  },
  "expression": {
    "op": "criterion",
    "field": "process-name",
    "values": [
      "addgroup|groupadd"
    ],
    "valuesOp": "or",
    "negate": false
  },
  "disabled": false
}
Original StackRox JSON
{
  "id": "a05e063b-f37f-4d36-99f3-7ff0cb2b3ba8",
  "name": "Linux Group Add Execution",
  "description": "Detects when the 'addgroup' or 'groupadd' binary is executed, which can be used to add a new linux group.",
  "rationale": "Groups added in run time can be used to take ownership of files and processes",
  "remediation": "Consider using a base image that doesn't have a shell such as SCRATCH or gcr.io/distroless. If not, modify your Dockerfile to use the exec form of CMD/ENTRYPOINT ([\"using braces\"]) instead of the shell form (no braces)",
  "disabled": false,
  "categories": [
    "Privileges",
    "System Modification"
  ],
  "lifecycleStages": [
    "RUNTIME"
  ],
  "eventSource": "DEPLOYMENT_EVENT",
  "exclusions": [],
  "scope": [],
  "severity": "HIGH_SEVERITY",
  "enforcementActions": [],
  "policySections": [
    {
      "sectionName": "",
      "policyGroups": [
        {
          "fieldName": "Process Name",
          "booleanOperator": "OR",
          "negate": false,
          "values": [
            {
              "value": "addgroup|groupadd"
            }
          ]
        }
      ]
    }
  ],
  "notifiers": [],
  "lastUpdated": null,
  "SORTName": "",
  "SORTLifecycleStage": "",
  "SORTEnforcement": false,
  "policyVersion": "1.1",
  "mitreAttackVectors": [
    {
      "tactic": "TA0003",
      "techniques": [
        "T1098",
        "T1136"
      ]
    }
  ],
  "criteriaLocked": true,
  "mitreVectorsLocked": true,
  "isDefault": true,
  "source": "IMPERATIVE"
}