gitlab.gosec.G301-1

unknown
Download Count*
License

Poor file permissions used when creating a directory

Run Locally

Run in CI

Defintion

rules:
  - id: gosec.G301-1
    patterns:
      - pattern-either:
          - pattern: os.Mkdir(...,$MASK)
          - pattern: os.MkdirAll(...,$MASK)
      - metavariable-comparison:
          metavariable: $MASK
          comparison: $MASK > 0o750
          base: 8
    message: |
      Poor file permissions used when creating a directory
    metadata:
      cwe: "CWE-732: Incorrect Permission Assignment for Critical Resource"
      owasp: "A6: Security Misconfiguration"
      primary_identifier: gosec.G301-1
      secondary_identifiers:
        - name: Gosec Rule ID G301
          type: gosec_rule_id
          value: G301
      license: MIT
    severity: WARNING
    languages:
      - go