-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add '--tamper-proof' flag and Azure Confidential Ledger Logic #2772
Open
PallabPaul
wants to merge
13
commits into
Azure:main
Choose a base branch
from
PallabPaul:ppaul/tamper-proof-acl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PallabPaul
requested review from
gapra-msft,
adreed-msft,
dphulkar-msft,
vibhansa-msft,
seanmcc-msft,
souravgupta-msft and
tanyasethi-msft
as code owners
September 19, 2024 18:43
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The goal of this PR is to introduce a new flag
--tamper-proof
. The design document to accompany this PR can be found here.The
--tamper-proof
flag introduces the ability for AzCopy to store the calculated MD5 Hash to an Azure Confidential Ledger (ACL) instance when using the--put-md5
flag. In addition, the flag will retrieve and compare the stored MD5 Hash with the re-calculated hash when using the '--check-md5' flag.Implementation
Aside from adding the
--tamper-proof
flag to the necessary Job Part files and common library, the main logic for the ACL and tamper-proof checks can be found inste/ledgerHelper.go
. This is where the main logic and calls to ACL can be found, specifically in theuploadHash
anddownloadHash
methods.Testing
More tests will be added soon but so far, the upload/download of the MD5 hash is working as expected.
To prepare for tests you can:
go build -o test_azcopy.exe
.export AZCOPY_AUTO_LOGIN_TYPE=AZCLI
.Upload
Command:
./test_azcopy.exe copy "<local_file>" "<remote_storage_account>" --put-md5 --recursive --tamper-proof "<ledger_url>"
Example:
./test_azcopy.exe copy "tool_clean.sh" "https://blobmanagedapptest.blob.core.windows.net/testaz" --put-md5 --recursive --tamper-proof "https://a79test1ledger20240710T061149652.confidential-ledger.azure.com"
Command Successfully Executed:
MD5 Hash Successfully Stored in ACL:
Download
Command:
./test_azcopy.exe copy "<remote_storage_account>" "<local_file>" --check-md5 FailIfDifferentOrMissing --recursive --tamper-proof "<ledger_url>"
Example:
./test_azcopy.exe copy "https://blobmanagedapptest.blob.core.windows.net/testaz" "testaz" --check-md5 FailIfDifferentOrMissing --recursive --tamper-proof "https://a79test1ledger20240710T061149652.confidential-ledger.azure.com"
Command Successfully Executed and Hash Matching:
Logs of Hash Matching:
Command Successfully Executed and Hash Not Matching:
Logs of Hash Not Matching: