Skip to content

bug(flag): --generate-default-config does not write license category lists #11737

Backlog

Description

@nikpivkin

Reported in #11275.

--generate-default-config does not write the license category lists (license.forbidden, license.restricted and others). The Custom Classification section in docs/guide/scanner/license.md tells users to generate the default config and edit these lists.

Since #9732 (v0.68.0), config-only flags do not use viper.SetDefault, and their defaults are applied when the flag value is read. --generate-default-config writes only the keys from viper.AllKeys(), so these defaults are lost. The six license category flags are the only config-only flags with a default value. Trivy 0.67.2 writes these lists, and 0.68.2 does not.

Steps to reproduce with Trivy 0.74.0

trivy fs --generate-default-config .

The license section of trivy-default.yaml

license:
    confidencelevel: "0.9"
    full: false
    ignored: []

Expected behavior

trivy-default.yaml contains all six category lists with their built-in licenses, as in Trivy 0.67.2. The built-in permissive list is empty, so it is written as permissive: [].

Activity

  1. added
    kind/bug
    scan/license
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugscan/license

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions