Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tasks/acs-ci-nightly/workflow/harness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sandbox:
GCS_BUCKET: test-platform-results-public
CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE: /etc/openshell-tls/ca-bundle.pem
CURL_CA_BUNDLE: /etc/openshell-tls/ca-bundle.pem
BOTO_CONFIG: /tmp/openshell-boto.cfg

source:
repo: https://github.com/stackrox/acs-triage-agent.git
Expand All @@ -33,6 +34,10 @@ source:
payloads:
- source: CI-NIGHTLY.md
destination: /sandbox/CI-NIGHTLY.md
- content: |
[Boto]
ca_certificates_file = /etc/openshell-tls/ca-bundle.pem
destination: /tmp/openshell-boto.cfg

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using a predictable filename in /tmp can lead to a race condition. A malicious actor could create a symbolic link at this path to trick the application into overwriting an arbitrary file or using a malicious Boto configuration. It is safer to create this file in a more secure, less predictable location, for instance under the /sandbox directory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using a predictable filename in /tmp can lead to a race condition. A malicious actor could create a symbolic link at this path to trick the application into overwriting an arbitrary file or using a malicious Boto configuration. It is safer to create this file in a more secure, less predictable location, for instance under the /sandbox directory.


agent:
type: claude
Expand Down
29 changes: 18 additions & 11 deletions tasks/acs-ci-nightly/workflow/preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ sandbox:
GCS_BUCKET: test-platform-results-public
CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE: /etc/openshell-tls/ca-bundle.pem
CURL_CA_BUNDLE: /etc/openshell-tls/ca-bundle.pem
BOTO_CONFIG: /tmp/openshell-boto.cfg

payloads:
- content: |
[Boto]
ca_certificates_file = /etc/openshell-tls/ca-bundle.pem
destination: /tmp/openshell-boto.cfg

agent:
type: /bin/sh
Expand All @@ -32,17 +39,6 @@ agent:
echo "Jira URL: $JIRA_URL"
echo

echo "GCS: gsutil ls -b gs://$GCS_BUCKET"
if timeout 30s /opt/gsutil/bin/gsutil ls -b "gs://$GCS_BUCKET" >/dev/null 2>"$gcs_error"; then
echo "GCS: PASS"
else
gcs_status=$?
echo "GCS: FAIL (exit $gcs_status)"
sed -n '1,20p' "$gcs_error"
status=1
fi
echo

echo "Jira: GET $JIRA_URL/rest/api/2/myself"
jira_status=$(curl --silent --show-error --output /dev/null \
--write-out '%{http_code}' --connect-timeout 10 --max-time 30 \
Expand All @@ -58,6 +54,17 @@ agent:
echo "Jira: FAIL (HTTP $jira_status)"
status=1
fi
echo

echo "GCS: gsutil ls -b gs://$GCS_BUCKET"
if timeout 30s /opt/gsutil/bin/gsutil ls -b "gs://$GCS_BUCKET" >/dev/null 2>"$gcs_error"; then
echo "GCS: PASS"
else
gcs_status=$?
echo "GCS: FAIL (exit $gcs_status)"
sed -n '1,20p' "$gcs_error"
status=1
fi
} >"$log" 2>&1

cat "$log"
Expand Down
Loading