Skip to content

Commit 8a59be3

Browse files
committed
Add a ruletype that checks if issues are disabled
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 0b1a76d commit 8a59be3

File tree

5 files changed

+796
-0
lines changed

5 files changed

+796
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
tests:
2+
- name: "Issues are disabled"
3+
def: {}
4+
params: {}
5+
expect: "pass"
6+
entity: &test-repo
7+
type: repository
8+
entity:
9+
owner: "coolhead"
10+
name: "haze-wave"
11+
http:
12+
body_file: disabled.json
13+
- name: "Issues should be disabled"
14+
def: {}
15+
params: { }
16+
expect: "fail"
17+
entity: *test-repo
18+
http:
19+
body_file: enabled.json
20+
- name: "Not found should fail"
21+
def: {}
22+
params: {}
23+
expect: "fail"
24+
entity: *test-repo
25+
http:
26+
status: 404
27+
body_file: notfound.json
28+
- name: "Internal server error should fail"
29+
def: {}
30+
params: {}
31+
expect: "fail"
32+
entity: *test-repo
33+
http:
34+
status: 500
35+
body: |
36+
{ "message": "Internal server error" }
Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
{
2+
"id": 666.5,
3+
"node_id": "R_kgDOJGa8UQ",
4+
"name": "haze-wave",
5+
"full_name": "coolhead/haze-wave",
6+
"private": true,
7+
"owner": {
8+
"login": "coolhead",
9+
"id": 777,
10+
"node_id": "MDQ6VXNlcjE0NTU2NA==",
11+
"gravatar_id": "",
12+
"url": "https://api.github.com/users/coolhead",
13+
"html_url": "https://github.com/coolhead",
14+
"followers_url": "https://api.github.com/users/coolhead/followers",
15+
"following_url": "https://api.github.com/users/coolhead/following{/other_user}",
16+
"gists_url": "https://api.github.com/users/coolhead/gists{/gist_id}",
17+
"starred_url": "https://api.github.com/users/coolhead/starred{/owner}{/repo}",
18+
"subscriptions_url": "https://api.github.com/users/coolhead/subscriptions",
19+
"organizations_url": "https://api.github.com/users/coolhead/orgs",
20+
"repos_url": "https://api.github.com/users/coolhead/repos",
21+
"events_url": "https://api.github.com/users/coolhead/events{/privacy}",
22+
"received_events_url": "https://api.github.com/users/coolhead/received_events",
23+
"type": "User",
24+
"site_admin": false
25+
},
26+
"html_url": "https://github.com/coolhead/haze-wave",
27+
"description": "A daemon that will help you with your user audit needs for linux",
28+
"fork": true,
29+
"url": "https://api.github.com/repos/coolhead/haze-wave",
30+
"forks_url": "https://api.github.com/repos/coolhead/haze-wave/forks",
31+
"keys_url": "https://api.github.com/repos/coolhead/haze-wave/keys{/key_id}",
32+
"collaborators_url": "https://api.github.com/repos/coolhead/haze-wave/collaborators{/collaborator}",
33+
"teams_url": "https://api.github.com/repos/coolhead/haze-wave/teams",
34+
"hooks_url": "https://api.github.com/repos/coolhead/haze-wave/hooks",
35+
"issue_events_url": "https://api.github.com/repos/coolhead/haze-wave/issues/events{/number}",
36+
"events_url": "https://api.github.com/repos/coolhead/haze-wave/events",
37+
"assignees_url": "https://api.github.com/repos/coolhead/haze-wave/assignees{/user}",
38+
"branches_url": "https://api.github.com/repos/coolhead/haze-wave/branches{/branch}",
39+
"tags_url": "https://api.github.com/repos/coolhead/haze-wave/tags",
40+
"blobs_url": "https://api.github.com/repos/coolhead/haze-wave/git/blobs{/sha}",
41+
"git_tags_url": "https://api.github.com/repos/coolhead/haze-wave/git/tags{/sha}",
42+
"git_refs_url": "https://api.github.com/repos/coolhead/haze-wave/git/refs{/sha}",
43+
"trees_url": "https://api.github.com/repos/coolhead/haze-wave/git/trees{/sha}",
44+
"statuses_url": "https://api.github.com/repos/coolhead/haze-wave/statuses/{sha}",
45+
"languages_url": "https://api.github.com/repos/coolhead/haze-wave/languages",
46+
"stargazers_url": "https://api.github.com/repos/coolhead/haze-wave/stargazers",
47+
"contributors_url": "https://api.github.com/repos/coolhead/haze-wave/contributors",
48+
"subscribers_url": "https://api.github.com/repos/coolhead/haze-wave/subscribers",
49+
"subscription_url": "https://api.github.com/repos/coolhead/haze-wave/subscription",
50+
"commits_url": "https://api.github.com/repos/coolhead/haze-wave/commits{/sha}",
51+
"git_commits_url": "https://api.github.com/repos/coolhead/haze-wave/git/commits{/sha}",
52+
"comments_url": "https://api.github.com/repos/coolhead/haze-wave/comments{/number}",
53+
"issue_comment_url": "https://api.github.com/repos/coolhead/haze-wave/issues/comments{/number}",
54+
"contents_url": "https://api.github.com/repos/coolhead/haze-wave/contents/{+path}",
55+
"compare_url": "https://api.github.com/repos/coolhead/haze-wave/compare/{base}...{head}",
56+
"merges_url": "https://api.github.com/repos/coolhead/haze-wave/merges",
57+
"archive_url": "https://api.github.com/repos/coolhead/haze-wave/{archive_format}{/ref}",
58+
"downloads_url": "https://api.github.com/repos/coolhead/haze-wave/downloads",
59+
"issues_url": "https://api.github.com/repos/coolhead/haze-wave/issues{/number}",
60+
"pulls_url": "https://api.github.com/repos/coolhead/haze-wave/pulls{/number}",
61+
"milestones_url": "https://api.github.com/repos/coolhead/haze-wave/milestones{/number}",
62+
"notifications_url": "https://api.github.com/repos/coolhead/haze-wave/notifications{?since,all,participating}",
63+
"labels_url": "https://api.github.com/repos/coolhead/haze-wave/labels{/name}",
64+
"releases_url": "https://api.github.com/repos/coolhead/haze-wave/releases{/id}",
65+
"deployments_url": "https://api.github.com/repos/coolhead/haze-wave/deployments",
66+
"created_at": "2023-03-07T10:29:53Z",
67+
"updated_at": "2024-06-17T08:00:06Z",
68+
"pushed_at": "2024-08-05T15:40:18Z",
69+
"git_url": "git://github.com/coolhead/haze-wave.git",
70+
"ssh_url": "[email protected]:coolhead/haze-wave.git",
71+
"clone_url": "https://github.com/coolhead/haze-wave.git",
72+
"svn_url": "https://github.com/coolhead/haze-wave",
73+
"homepage": null,
74+
"size": 504,
75+
"stargazers_count": 0,
76+
"watchers_count": 0,
77+
"language": "Go",
78+
"has_issues": false,
79+
"has_projects": true,
80+
"has_downloads": true,
81+
"has_wiki": false,
82+
"has_pages": false,
83+
"has_discussions": false,
84+
"forks_count": 0,
85+
"mirror_url": null,
86+
"archived": false,
87+
"disabled": false,
88+
"open_issues_count": 6,
89+
"license": {
90+
"key": "apache-2.0",
91+
"name": "Apache License 2.0",
92+
"spdx_id": "Apache-2.0",
93+
"url": "https://api.github.com/licenses/apache-2.0",
94+
"node_id": "MDc6TGljZW5zZTI="
95+
},
96+
"allow_forking": true,
97+
"is_template": false,
98+
"web_commit_signoff_required": false,
99+
"topics": [],
100+
"visibility": "private",
101+
"forks": 0,
102+
"open_issues": 6,
103+
"watchers": 0,
104+
"default_branch": "main",
105+
"permissions": {
106+
"admin": true,
107+
"maintain": true,
108+
"push": true,
109+
"triage": true,
110+
"pull": true
111+
},
112+
"temp_clone_token": "",
113+
"allow_squash_merge": true,
114+
"allow_merge_commit": true,
115+
"allow_rebase_merge": true,
116+
"allow_auto_merge": false,
117+
"delete_branch_on_merge": false,
118+
"allow_update_branch": false,
119+
"use_squash_pr_title_as_default": false,
120+
"squash_merge_commit_message": "COMMIT_MESSAGES",
121+
"squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
122+
"merge_commit_message": "PR_TITLE",
123+
"merge_commit_title": "MERGE_MESSAGE",
124+
"parent": {
125+
"id": 666.7,
126+
"node_id": "R_kgDOJE5eUA",
127+
"name": "haze-wave",
128+
"full_name": "JAORMX/haze-wave",
129+
"private": false,
130+
"owner": {
131+
"login": "JAORMX",
132+
"id": 666.2,
133+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjg4MTM1NjAw",
134+
"gravatar_id": "",
135+
"url": "https://api.github.com/users/JAORMX",
136+
"html_url": "https://github.com/JAORMX",
137+
"followers_url": "https://api.github.com/users/JAORMX/followers",
138+
"following_url": "https://api.github.com/users/JAORMX/following{/other_user}",
139+
"gists_url": "https://api.github.com/users/JAORMX/gists{/gist_id}",
140+
"starred_url": "https://api.github.com/users/JAORMX/starred{/owner}{/repo}",
141+
"subscriptions_url": "https://api.github.com/users/JAORMX/subscriptions",
142+
"organizations_url": "https://api.github.com/users/JAORMX/orgs",
143+
"repos_url": "https://api.github.com/users/JAORMX/repos",
144+
"events_url": "https://api.github.com/users/JAORMX/events{/privacy}",
145+
"received_events_url": "https://api.github.com/users/JAORMX/received_events",
146+
"type": "Organization",
147+
"site_admin": false
148+
},
149+
"html_url": "https://github.com/JAORMX/haze-wave",
150+
"description": "haze-wave is a daemon that monitors OpenSSH server logins and produces structured audit events describing what authenticated users did while logged in.",
151+
"fork": false,
152+
"url": "https://api.github.com/repos/JAORMX/haze-wave",
153+
"forks_url": "https://api.github.com/repos/JAORMX/haze-wave/forks",
154+
"keys_url": "https://api.github.com/repos/JAORMX/haze-wave/keys{/key_id}",
155+
"collaborators_url": "https://api.github.com/repos/JAORMX/haze-wave/collaborators{/collaborator}",
156+
"teams_url": "https://api.github.com/repos/JAORMX/haze-wave/teams",
157+
"hooks_url": "https://api.github.com/repos/JAORMX/haze-wave/hooks",
158+
"issue_events_url": "https://api.github.com/repos/JAORMX/haze-wave/issues/events{/number}",
159+
"events_url": "https://api.github.com/repos/JAORMX/haze-wave/events",
160+
"assignees_url": "https://api.github.com/repos/JAORMX/haze-wave/assignees{/user}",
161+
"branches_url": "https://api.github.com/repos/JAORMX/haze-wave/branches{/branch}",
162+
"tags_url": "https://api.github.com/repos/JAORMX/haze-wave/tags",
163+
"blobs_url": "https://api.github.com/repos/JAORMX/haze-wave/git/blobs{/sha}",
164+
"git_tags_url": "https://api.github.com/repos/JAORMX/haze-wave/git/tags{/sha}",
165+
"git_refs_url": "https://api.github.com/repos/JAORMX/haze-wave/git/refs{/sha}",
166+
"trees_url": "https://api.github.com/repos/JAORMX/haze-wave/git/trees{/sha}",
167+
"statuses_url": "https://api.github.com/repos/JAORMX/haze-wave/statuses/{sha}",
168+
"languages_url": "https://api.github.com/repos/JAORMX/haze-wave/languages",
169+
"stargazers_url": "https://api.github.com/repos/JAORMX/haze-wave/stargazers",
170+
"contributors_url": "https://api.github.com/repos/JAORMX/haze-wave/contributors",
171+
"subscribers_url": "https://api.github.com/repos/JAORMX/haze-wave/subscribers",
172+
"subscription_url": "https://api.github.com/repos/JAORMX/haze-wave/subscription",
173+
"commits_url": "https://api.github.com/repos/JAORMX/haze-wave/commits{/sha}",
174+
"git_commits_url": "https://api.github.com/repos/JAORMX/haze-wave/git/commits{/sha}",
175+
"comments_url": "https://api.github.com/repos/JAORMX/haze-wave/comments{/number}",
176+
"issue_comment_url": "https://api.github.com/repos/JAORMX/haze-wave/issues/comments{/number}",
177+
"contents_url": "https://api.github.com/repos/JAORMX/haze-wave/contents/{+path}",
178+
"compare_url": "https://api.github.com/repos/JAORMX/haze-wave/compare/{base}...{head}",
179+
"merges_url": "https://api.github.com/repos/JAORMX/haze-wave/merges",
180+
"archive_url": "https://api.github.com/repos/JAORMX/haze-wave/{archive_format}{/ref}",
181+
"downloads_url": "https://api.github.com/repos/JAORMX/haze-wave/downloads",
182+
"issues_url": "https://api.github.com/repos/JAORMX/haze-wave/issues{/number}",
183+
"pulls_url": "https://api.github.com/repos/JAORMX/haze-wave/pulls{/number}",
184+
"milestones_url": "https://api.github.com/repos/JAORMX/haze-wave/milestones{/number}",
185+
"notifications_url": "https://api.github.com/repos/JAORMX/haze-wave/notifications{?since,all,participating}",
186+
"labels_url": "https://api.github.com/repos/JAORMX/haze-wave/labels{/name}",
187+
"releases_url": "https://api.github.com/repos/JAORMX/haze-wave/releases{/id}",
188+
"deployments_url": "https://api.github.com/repos/JAORMX/haze-wave/deployments",
189+
"created_at": "2023-03-03T12:08:37Z",
190+
"updated_at": "2023-12-08T22:51:08Z",
191+
"pushed_at": "2024-10-15T11:46:11Z",
192+
"git_url": "git://github.com/JAORMX/haze-wave.git",
193+
"ssh_url": "[email protected]:JAORMX/haze-wave.git",
194+
"clone_url": "https://github.com/JAORMX/haze-wave.git",
195+
"svn_url": "https://github.com/JAORMX/haze-wave",
196+
"homepage": "",
197+
"size": 609,
198+
"stargazers_count": 2,
199+
"watchers_count": 2,
200+
"language": "Go",
201+
"has_issues": false,
202+
"has_projects": true,
203+
"has_downloads": true,
204+
"has_wiki": false,
205+
"has_pages": false,
206+
"has_discussions": false,
207+
"forks_count": 5,
208+
"mirror_url": null,
209+
"archived": false,
210+
"disabled": false,
211+
"open_issues_count": 12,
212+
"license": {
213+
"key": "apache-2.0",
214+
"name": "Apache License 2.0",
215+
"spdx_id": "Apache-2.0",
216+
"url": "https://api.github.com/licenses/apache-2.0",
217+
"node_id": "MDc6TGljZW5zZTI="
218+
},
219+
"allow_forking": true,
220+
"is_template": false,
221+
"web_commit_signoff_required": false,
222+
"topics": [],
223+
"visibility": "public",
224+
"forks": 5,
225+
"open_issues": 12,
226+
"watchers": 2,
227+
"default_branch": "main"
228+
},
229+
"source": {
230+
"id": 666.7,
231+
"node_id": "R_kgDOJE5eUA",
232+
"name": "haze-wave",
233+
"full_name": "JAORMX/haze-wave",
234+
"private": false,
235+
"owner": {
236+
"login": "JAORMX",
237+
"id": 777,
238+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjg4MTM1NjAw",
239+
"gravatar_id": "",
240+
"url": "https://api.github.com/users/JAORMX",
241+
"html_url": "https://github.com/JAORMX",
242+
"followers_url": "https://api.github.com/users/JAORMX/followers",
243+
"following_url": "https://api.github.com/users/JAORMX/following{/other_user}",
244+
"gists_url": "https://api.github.com/users/JAORMX/gists{/gist_id}",
245+
"starred_url": "https://api.github.com/users/JAORMX/starred{/owner}{/repo}",
246+
"subscriptions_url": "https://api.github.com/users/JAORMX/subscriptions",
247+
"organizations_url": "https://api.github.com/users/JAORMX/orgs",
248+
"repos_url": "https://api.github.com/users/JAORMX/repos",
249+
"events_url": "https://api.github.com/users/JAORMX/events{/privacy}",
250+
"received_events_url": "https://api.github.com/users/JAORMX/received_events",
251+
"type": "Organization",
252+
"site_admin": false
253+
},
254+
"html_url": "https://github.com/JAORMX/haze-wave",
255+
"description": "haze-wave is a daemon that monitors OpenSSH server logins and produces structured audit events describing what authenticated users did while logged in.",
256+
"fork": false,
257+
"url": "https://api.github.com/repos/JAORMX/haze-wave",
258+
"forks_url": "https://api.github.com/repos/JAORMX/haze-wave/forks",
259+
"keys_url": "https://api.github.com/repos/JAORMX/haze-wave/keys{/key_id}",
260+
"collaborators_url": "https://api.github.com/repos/JAORMX/haze-wave/collaborators{/collaborator}",
261+
"teams_url": "https://api.github.com/repos/JAORMX/haze-wave/teams",
262+
"hooks_url": "https://api.github.com/repos/JAORMX/haze-wave/hooks",
263+
"issue_events_url": "https://api.github.com/repos/JAORMX/haze-wave/issues/events{/number}",
264+
"events_url": "https://api.github.com/repos/JAORMX/haze-wave/events",
265+
"assignees_url": "https://api.github.com/repos/JAORMX/haze-wave/assignees{/user}",
266+
"branches_url": "https://api.github.com/repos/JAORMX/haze-wave/branches{/branch}",
267+
"tags_url": "https://api.github.com/repos/JAORMX/haze-wave/tags",
268+
"blobs_url": "https://api.github.com/repos/JAORMX/haze-wave/git/blobs{/sha}",
269+
"git_tags_url": "https://api.github.com/repos/JAORMX/haze-wave/git/tags{/sha}",
270+
"git_refs_url": "https://api.github.com/repos/JAORMX/haze-wave/git/refs{/sha}",
271+
"trees_url": "https://api.github.com/repos/JAORMX/haze-wave/git/trees{/sha}",
272+
"statuses_url": "https://api.github.com/repos/JAORMX/haze-wave/statuses/{sha}",
273+
"languages_url": "https://api.github.com/repos/JAORMX/haze-wave/languages",
274+
"stargazers_url": "https://api.github.com/repos/JAORMX/haze-wave/stargazers",
275+
"contributors_url": "https://api.github.com/repos/JAORMX/haze-wave/contributors",
276+
"subscribers_url": "https://api.github.com/repos/JAORMX/haze-wave/subscribers",
277+
"subscription_url": "https://api.github.com/repos/JAORMX/haze-wave/subscription",
278+
"commits_url": "https://api.github.com/repos/JAORMX/haze-wave/commits{/sha}",
279+
"git_commits_url": "https://api.github.com/repos/JAORMX/haze-wave/git/commits{/sha}",
280+
"comments_url": "https://api.github.com/repos/JAORMX/haze-wave/comments{/number}",
281+
"issue_comment_url": "https://api.github.com/repos/JAORMX/haze-wave/issues/comments{/number}",
282+
"contents_url": "https://api.github.com/repos/JAORMX/haze-wave/contents/{+path}",
283+
"compare_url": "https://api.github.com/repos/JAORMX/haze-wave/compare/{base}...{head}",
284+
"merges_url": "https://api.github.com/repos/JAORMX/haze-wave/merges",
285+
"archive_url": "https://api.github.com/repos/JAORMX/haze-wave/{archive_format}{/ref}",
286+
"downloads_url": "https://api.github.com/repos/JAORMX/haze-wave/downloads",
287+
"issues_url": "https://api.github.com/repos/JAORMX/haze-wave/issues{/number}",
288+
"pulls_url": "https://api.github.com/repos/JAORMX/haze-wave/pulls{/number}",
289+
"milestones_url": "https://api.github.com/repos/JAORMX/haze-wave/milestones{/number}",
290+
"notifications_url": "https://api.github.com/repos/JAORMX/haze-wave/notifications{?since,all,participating}",
291+
"labels_url": "https://api.github.com/repos/JAORMX/haze-wave/labels{/name}",
292+
"releases_url": "https://api.github.com/repos/JAORMX/haze-wave/releases{/id}",
293+
"deployments_url": "https://api.github.com/repos/JAORMX/haze-wave/deployments",
294+
"created_at": "2023-03-03T12:08:37Z",
295+
"updated_at": "2023-12-08T22:51:08Z",
296+
"pushed_at": "2024-10-15T11:46:11Z",
297+
"git_url": "git://github.com/JAORMX/haze-wave.git",
298+
"ssh_url": "[email protected]:JAORMX/haze-wave.git",
299+
"clone_url": "https://github.com/JAORMX/haze-wave.git",
300+
"svn_url": "https://github.com/JAORMX/haze-wave",
301+
"homepage": "",
302+
"size": 609,
303+
"stargazers_count": 2,
304+
"watchers_count": 2,
305+
"language": "Go",
306+
"has_issues": false,
307+
"has_projects": true,
308+
"has_downloads": true,
309+
"has_wiki": false,
310+
"has_pages": false,
311+
"has_discussions": false,
312+
"forks_count": 5,
313+
"mirror_url": null,
314+
"archived": false,
315+
"disabled": false,
316+
"open_issues_count": 12,
317+
"license": {
318+
"key": "apache-2.0",
319+
"name": "Apache License 2.0",
320+
"spdx_id": "Apache-2.0",
321+
"url": "https://api.github.com/licenses/apache-2.0",
322+
"node_id": "MDc6TGljZW5zZTI="
323+
},
324+
"allow_forking": true,
325+
"is_template": false,
326+
"web_commit_signoff_required": false,
327+
"topics": [],
328+
"visibility": "public",
329+
"forks": 5,
330+
"open_issues": 12,
331+
"watchers": 2,
332+
"default_branch": "main"
333+
},
334+
"security_and_analysis": {
335+
"secret_scanning": {
336+
"status": "enabled"
337+
},
338+
"secret_scanning_push_protection": {
339+
"status": "enabled"
340+
},
341+
"dependabot_security_updates": {
342+
"status": "disabled"
343+
},
344+
"secret_scanning_non_provider_patterns": {
345+
"status": "disabled"
346+
},
347+
"secret_scanning_validity_checks": {
348+
"status": "disabled"
349+
}
350+
},
351+
"network_count": 5,
352+
"subscribers_count": 1
353+
}

0 commit comments

Comments
 (0)