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

Remove and replace additional operations in enclave start #1289

Merged
merged 21 commits into from
Jan 30, 2025

Conversation

abuabraham-ttd
Copy link
Contributor

@abuabraham-ttd abuabraham-ttd commented Jan 16, 2025

Remove unused files, and extra logic that is not needed. To keep startup simple

When enclave starts, get config from flask.

Verify all mandatory params are set.
Ensure only allowed overrides are allowed.
Disable url override in prod.
Ensure debug is not enabled in prod.

NOTE: Tested manually, e2e is broken atm with a bore issue

OPTOUT_BASE_URL=$(jq -r ".optout_base_url" < "${PARAMETERIZED_CONFIG}")
DEPLOYMENT_ENVIRONMENT=$(jq -r ".environment" < "${OPERATOR_CONFIG}")
DEBUG_MODE=$(jq -r ".debug_mode" < "${OPERATOR_CONFIG}")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need to ensure CORE_BASE_URL is not set to random core, as this will result in operator sending token + pcr0 to overridden malicious core.

Basically, updates the logic to always replace URL in config. If prod, use default prod URL otherwise allow override.

This check is not done in GCP, as we attest GCP confidential compute by calling GCP endpoints. Please correct if wrong @atarassov-ttd

exit 1
fi
done
FILTER=$(printf '. | {')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do this logic differently in each implementation: In GCP in Java code, in Azure in MAA attestation, and in AWS it was in make_config.py.

@@ -10,25 +10,6 @@ def get_config():
with open('/etc/secret/secret-value/config', 'r') as secret_file:
secret_value = secret_file.read().strip()
secret_value_json = json.loads(secret_value)
secret_value_json["environment"] = secret_value_json["environment"].lower()
Copy link
Contributor Author

@abuabraham-ttd abuabraham-ttd Jan 16, 2025

Choose a reason for hiding this comment

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

Is this needed now? @Ian-Nara
We populate configs after processing in

config_path = "/etc/secret/secret-value/config"

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the lower() calls to these is still useful, unless I missed that in the ec2.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we ensure it is lower as part of validations

@abuabraham-ttd abuabraham-ttd force-pushed the abu-UID2-4633-remove-unusued-aws branch from 30167dd to 8c08a13 Compare January 16, 2025 19:33
@abuabraham-ttd abuabraham-ttd force-pushed the abu-UID2-4633-remove-unusued-aws branch from 4fdd34b to 8192fbc Compare January 16, 2025 21:15
#TODO: Remove below logic after remote config management is implemented

if [[ "$DEPLOYMENT_ENVIRONMENT" != "prod" ]]; then
#Allow override of base URL in non-prod environments
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to remove all configs we pass and keep it simple, but there are lot of intricacies

This bit, can be removed once we complete remote config management, and use optour url returned by core.

@abuabraham-ttd abuabraham-ttd force-pushed the abu-UID2-4633-remove-unusued-aws branch from 0aa65c2 to d852887 Compare January 30, 2025 00:20
@abuabraham-ttd abuabraham-ttd force-pushed the abu-UID2-4633-remove-unusued-aws branch from 466bff4 to cf357f8 Compare January 30, 2025 00:26
@abuabraham-ttd abuabraham-ttd merged commit 775bacf into main Jan 30, 2025
2 of 3 checks passed
@abuabraham-ttd abuabraham-ttd deleted the abu-UID2-4633-remove-unusued-aws branch January 30, 2025 18:45
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.

2 participants