← 输入框|github.com|刷新
Skip to content

How to add a suffix to output files #1137

Closed

Description

@Spritekin

Your Question

I got two scheduled scans to two different sites which appear in the cluster as:

NAME                        TYPE            INTERVAL   FINDINGS
zap-scan-earnd-admin        zap-full-scan   168h       19
zap-scan-egw-adminconsole   zap-full-scan   168h       21

The scans generate pods like these ones.

scan-zap-scan-earnd-admin-1650962558-p77qz-dhn6x
scan-zap-scan-egw-adminconsole-1650962558-82c24-m6zks 

However, when the scan results are written to the S3 bucket, we get folders like:

scan-202639fa-0083-42b0-a401-91b167c44370/
scan-da96b881-9b2f-4b9c-93da-afe3d315ce5c/

There is no way to identify which one is the result of a particular scan or even from a particular run.

What I would like to see is the folders in S3 like this:

zap-scan-earnd-admin-2022-04-03-12-35/
zap-scan-earnd-admin-2022-04-10-12-35/
zap-scan-egw-adminconsole-2022-04-03-12-35/
zap-scan-egw-adminconsole-2022-04-10-12-35/

That is, I would like to see the folder named relative to the scan name and the date/time when it was run.

Is there a way to do this?

Thanks for your help.

Activity

  1. J12934 commented on Apr 26, 2022

    @J12934
    Member

    Hi 👋
    again thanks for the feedback, it always very helpful to hear where the pain points are 🙏

    Short answer: No, it currently not possible to change the naming scheme for the result files in the S3 bucket.

    The names are deterministic though, they are based on the scans uuid, not the name.
    You can list the scans uuid together with the name by running kubectl get scans -o wide
    You can also get full urls to directly download the results from by taking a look at the scans status.

    We've choosen the uuid for the file name in s3 as they are (nearly) guaranteed to be unique, as to avoid problems where a cleanup of previous results have failed and old results would still be present under the same name. (As the scan name can be repeated for non ScheduledScans, also for scans in separate namespaces). This is a edge case scenario, but one we'd rather not have enabled by default.

    It would be possible thought to have this be configurable by allowing the users to pass in a golang template string which could then be used to generate the S3 path. The default would then be something like

    scan-{{ .Scan.Metadata.UID }}/{{ .Filename }}

    and to achieve the structure you've proposed you could pass in something the follwing template:

    {{ .Scan.Metadata.Name }}/{{ .Filename }}

    I'll convert this into a enhancment ticket, as this is somethign which we could add as a feature.

  2. added
    enhancementNew feature or request
    and removed
    questionFurther information is requested
    on Apr 26, 2022
  3. moved this to Backlog in secureCodeBoxon Aug 22, 2022
  4. self-assigned this
    on Sep 27, 2022
  5. moved this from Backlog to In Progress in secureCodeBoxon Sep 27, 2022
  6. Repository owner moved this from In Progress to Done in secureCodeBoxon Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions