Skip to content

Invalid Scheduled Scan name #2706

Closed

Description

@adrianmarcu18

🐞 Bug report

Describe the bug

Auto-discovery cannot create scheduled scans for containers whose names violate the metadata.name naming convention. This should be taken into account as in the container image name there are additional characters allowed, such as "_". I think this should be taken into account and discard/replace characters that are not allowed by metadata.name while creating the scheduled scan name.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install auto-discovery and activate container scans
  2. Deploy a pod with a container which has in its image name an invalid character such as "_", which is an allowed character for the container image name
  3. Check autodiscovery logs and see that it will fail to create the scheduled scan:

Failed to create scheduled scan, metadata.name: Invalid value: a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(\.a-z0-9?)*')"}

While is good to not have such names in container image names, it can still happen.

Expected behavior

The expected behaviour is for the autodiscovery controller to detect such names and fix them before creating the scan.

System (please complete the following information):

  • secureCodeBox 4.9.0
  • OS: Ubuntu
  • Kubernetes Version: Server Version: version.Info{Major:"1", Minor:"29", GitVersion:"v1.29.5", GitCommit:"59755ff595fa4526236b0cc03aa2242d941a5171", GitTreeState:"clean", BuildDate:"2024-05-22T15:00:52Z", GoVersion:"go1.21.9", Compiler:"gc", Platform:"linux/amd64"}
  • Docker Version: N\A
  • Browser: N\A

Screenshots / Logs

Additional context

Activity

  1. J12934 commented on Oct 11, 2024

    @J12934
    Member

    Ah thanks for pointing that out 🙌
    Wasn't aware that container names had a different set of allowed characters.

  2. moved this from Backlog to Todo in secureCodeBoxon Oct 11, 2024
  3. self-assigned this
    on Feb 13, 2025
  4. moved this from Todo to In Progress in secureCodeBoxon Feb 13, 2025
  5. added a commit that references this issue on Feb 13, 2025
  6. added a commit that references this issue on Mar 6, 2025
  7. moved this from In Progress to Done in secureCodeBoxon Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugBugshelp wantedExtra attention is needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions