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

Web tools #358

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Web tools #358

merged 3 commits into from
Nov 13, 2024

Conversation

shaunwbell
Copy link
Collaborator

No description provided.

@shaunwbell shaunwbell merged commit 530c3cc into main Nov 13, 2024
6 of 7 checks passed
@shaunwbell shaunwbell deleted the web-tools branch November 13, 2024 15:54

print("""
print(("Cruise:\t\t{0}").format(Mooring_Meta_sum[args.MooringID]["CruiseNumber"]))
print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.

Copilot Autofix AI about 2 months ago

To fix the problem, we should avoid logging sensitive information such as latitude and longitude in clear text. Instead, we can either mask the sensitive data or avoid logging it altogether. In this case, we will mask the sensitive data to ensure that it is not exposed in the logs while still providing some level of information for debugging purposes.

We will modify the lines that log the latitude and longitude data to replace the actual values with masked versions. This can be done by replacing the sensitive parts of the data with asterisks or another placeholder.

Suggested changeset 1
tools/mooring_config_creator.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/mooring_config_creator.py b/tools/mooring_config_creator.py
--- a/tools/mooring_config_creator.py
+++ b/tools/mooring_config_creator.py
@@ -162,4 +162,8 @@
     print(("Cruise:\t\t{0}").format(Mooring_Meta_sum[args.MooringID]["CruiseNumber"]))
-    print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))
-    print(("Longitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Longitude"]))
+    latitude = Mooring_Meta_sum[args.MooringID]["Latitude"]
+    longitude = Mooring_Meta_sum[args.MooringID]["Longitude"]
+    masked_latitude = f"{latitude[:2]}**.****"
+    masked_longitude = f"{longitude[:2]}**.****"
+    print(("Latitude:\t{0}").format(masked_latitude))
+    print(("Longitude:\t{0}").format(masked_longitude))
     print(
EOF
@@ -162,4 +162,8 @@
print(("Cruise:\t\t{0}").format(Mooring_Meta_sum[args.MooringID]["CruiseNumber"]))
print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))
print(("Longitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Longitude"]))
latitude = Mooring_Meta_sum[args.MooringID]["Latitude"]
longitude = Mooring_Meta_sum[args.MooringID]["Longitude"]
masked_latitude = f"{latitude[:2]}**.****"
masked_longitude = f"{longitude[:2]}**.****"
print(("Latitude:\t{0}").format(masked_latitude))
print(("Longitude:\t{0}").format(masked_longitude))
print(
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
print("""
print(("Cruise:\t\t{0}").format(Mooring_Meta_sum[args.MooringID]["CruiseNumber"]))
print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))
print(("Longitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Longitude"]))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.

Copilot Autofix AI about 2 months ago

To fix the problem, we should avoid logging the sensitive longitude data directly. Instead, we can log a message indicating that the data is available without revealing the actual value. This approach maintains the functionality of informing the user that the data exists while protecting the sensitive information.

We will modify the code to replace the direct logging of the longitude value with a placeholder message. This change will be made in the tools/mooring_config_creator.py file, specifically on line 164.

Suggested changeset 1
tools/mooring_config_creator.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/mooring_config_creator.py b/tools/mooring_config_creator.py
--- a/tools/mooring_config_creator.py
+++ b/tools/mooring_config_creator.py
@@ -163,3 +163,3 @@
     print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))
-    print(("Longitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Longitude"]))
+    print("Longitude:\t[REDACTED]")
     print(
EOF
@@ -163,3 +163,3 @@
print(("Latitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Latitude"]))
print(("Longitude:\t{0}").format(Mooring_Meta_sum[args.MooringID]["Longitude"]))
print("Longitude:\t[REDACTED]")
print(
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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.

1 participant