forked from THORCollective/HEARTH
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit.js
More file actions
54 lines (36 loc) · 1.13 KB
/
submit.js
File metadata and controls
54 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('huntSubmissionForm');
form.addEventListener('submit', (e) => {
e.preventDefault();
const formData = new FormData(form);
const data = Object.fromEntries(formData.entries());
const issueTitle = `Hunt Submission: ${data.huntTitle}`;
const issueBody = `
### New Threat Hunt Submission
**Idea / Hypothesis:**
${data.huntTitle}
**Category:**
${data.huntCategory}
**Tactic(s):**
${data.huntTactic}
**Tags:**
${data.huntTags}
---
### Implementation Details
**Notes:**
${data.huntNotes || 'N/A'}
**"Why" Section:**
${data.huntWhy}
**References:**
${data.huntReferences}
---
### Submitter Information
**Submitted by:** ${data.submitterName}
**Profile:** ${data.submitterLink || 'N/A'}
`;
const encodedTitle = encodeURIComponent(issueTitle);
const encodedBody = encodeURIComponent(issueBody);
const githubUrl = `https://github.com/THORCollective/HEARTH/issues/new?title=${encodedTitle}&body=${encodedBody}&labels=hunt-submission`;
window.open(githubUrl, '_blank');
});
});