Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates providers #300

Merged
merged 12 commits into from
Nov 27, 2024
Merged

Templates providers #300

merged 12 commits into from
Nov 27, 2024

Conversation

Aboisier
Copy link
Collaborator

@Aboisier Aboisier commented Oct 4, 2024

This PR adds the "source" concept for jobs, job templates and subscriptions. The code is not optimal as it contains duplication. Might refine later, but I wanted to get this up quick to fix licensing problems.

Highlights:

  1. templateOrdering renaming — renamed it to category

To-do:

  1. Resilience — the system is currently not resilient to an import failure. For instance
    1. If a certain source is down, all jobs/subs/templates will be deleted (oops)
    2. If a specific item can't be imported, the whole server crashes
  2. CustomJobMetadataV1 — Can this be deleted?
  3. Versioniong — It may be interesting to add versioning to subscriptions for future-proofing. By that, I mean the subscription yaml version (stalker-specific), not a version-per-template
  4. GitSource duplication — The code pulling the repo is duplicated. Maybe refactor?
  5. Tests — The tests are absolutely exploding
  6. Update periodically? — Should we have a cron job synchronizing jobs?

@Aboisier Aboisier marked this pull request as ready for review November 3, 2024 01:30
@lm-sec
Copy link
Collaborator

lm-sec commented Nov 7, 2024

On a perdu la belle arborescence qu'on avait ici avant, dans les templates:

image

Avant on avait les built-in dans un folder et les autres templates dans un autre folder. Ils étaient aussi classés par language. Je sais pas si c'est quelque chose qu'on veut garder.

C'etait un truc du genre:

  • python
    • Template 1
    • Template 2
  • built-in (greyed out)
    • python
      • Template 3
      • Template 4
    • Nuclei
      • Template 5

@Aboisier
Copy link
Collaborator Author

On a perdu la belle arborescence qu'on avait ici avant, dans les templates:

image

Avant on avait les built-in dans un folder et les autres templates dans un autre folder. Ils étaient aussi classés par language. Je sais pas si c'est quelque chose qu'on veut garder.

C'etait un truc du genre:

  • python

    • Template 1
    • Template 2
  • built-in (greyed out)

    • python

      • Template 3
      • Template 4
    • Nuclei

      • Template 5

Je crois que c'est brisé parce que les templates dans ta db sont outdated possiblement? Je veux pas être ce gars-là, mais, works on my machine.
image

Copy link
Collaborator

@lm-sec lm-sec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai review vite fait pour trouver les endroits où j'aurais pu oublier de considérer la branch et j'en ai trouvé plusieurs. À date c'est très fort

@Aboisier Aboisier merged commit e6e7107 into main Nov 27, 2024
5 checks passed
@Aboisier Aboisier deleted the templates-providers branch November 27, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants