Skip to content

Commit 2c5faae

Browse files
Add OctoLint SHA-1 certificate check
1 parent 4fea48d commit 2c5faae

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

domain/requests/github/copilot_request_context.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
octolint_duplicate_variables_wrapper,
110110
)
111111
from domain.tools.wrapper.octolint_empty_projects import octolint_empty_projects_wrapper
112+
from domain.tools.wrapper.octolint_sha1_certificates import (
113+
octolint_sha1_certificates_wrapper,
114+
)
112115
from domain.tools.wrapper.octolint_unhealthy_targets import (
113116
octolint_unhealthy_targets_wrapper,
114117
)
@@ -982,6 +985,19 @@ def build_form_tools(query, req: func.HttpRequest):
982985
log_query,
983986
),
984987
),
988+
FunctionDefinition(
989+
octolint_sha1_certificates_wrapper(
990+
octolint_callback(
991+
lambda: get_api_key_and_url(req),
992+
get_github_user_from_form(req),
993+
query,
994+
"OctoLintSha1Certificates",
995+
get_redirections(req),
996+
get_redirections_api_key(req),
997+
),
998+
log_query,
999+
),
1000+
),
9851001
FunctionDefinition(
9861002
create_feed_wrapper(
9871003
query,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
def octolint_sha1_certificates_wrapper(callback, logging):
2+
def octolint_sha1_certificates(space=None, project=None, **kwargs):
3+
"""
4+
Checks for uses of SHA-1 certificates for deployment targets, workers or the Octopus Server itself.
5+
Example prompts include:
6+
* Check for SHA-1 certificate usage in the space "MySpace".
7+
* Find SHA1 certificates in the space "MySpace" to improve security.
8+
9+
Args:
10+
space: The name of the space to run the check in.
11+
project: The name of the project to run the check in.
12+
"""
13+
14+
if logging:
15+
logging("Enter:", "octolint_sha1_certificates")
16+
17+
for key, value in kwargs.items():
18+
if logging:
19+
logging(f"Unexpected Key: {key}", "Value: {value}")
20+
21+
return callback(space, project)
22+
23+
return octolint_sha1_certificates

0 commit comments

Comments
 (0)