Conversation
Signed-off-by: Uk-jake <mag0225@naver.com>
|
@Uk-jake I've actually worked on this yesterday; here are my changes: https://github.com/cncf/automation/compare/sbomit-integration?expand=1 The problem is, when we have it this way, because of the wrapping I assume, the communication between github and the runner is lost. In my case, the flow actually runs and uploads attestations and SBOM files to the S3 bucket; however, the job is not reflected on the GitHub Actions page. This doesn't look promising; I'm looking into it. |
|
@koksay |
|
@koksay I think the issue here is:
As for why this is not streamed to GitHub actions ledger, because the listener is activated after this step of sudo check. As the sudo check fails, listener is never activated. https://github.com/actions/runner/blob/759385a3510197a58b5c08dc1f373b74b9f4643b/src/Misc/layoutroot/run-helper.sh.template#L35-L37 (listener is started after the sudo check) Can you try something like this once: sudo -E \
HOME=/home/ubuntu \
PATH="$PATH:/home/ubuntu/.local/bin:/home/ubuntu/.cargo/bin:/home/ubuntu/.rustup/bin" \
NVM_DIR=/home/ubuntu/.nvm \
witness run \
--experimental \
--step build \
-a network-trace \
--trace \
--attestor-command-run-trace-backend ebpf \
--signer-file-key-path ./signing-key.pem \
-o attestation.json \
-- \
setpriv \
--reuid=ubuntu \
--regid=ubuntu \
--init-groups \
env \
-u SUDO_UID \
-u SUDO_GID \
-u SUDO_USER \
HOME=/home/ubuntu \
USER=ubuntu \
LOGNAME=ubuntu \
NVM_DIR=/home/ubuntu/.nvm \
RUNNER_MANUALLY_TRAP_SIG=1 \
PATH="$PATH:/home/ubuntu/.local/bin:/home/ubuntu/.cargo/bin:/home/ubuntu/.rustup/bin" \
bash /home/ubuntu/run.sh \
--jitconfig "${ACTIONS_RUNNER_INPUT_JITCONFIG}"
I have one quick question. During this integration, there might be a few bugs too iron out, how do we invoke this setup? Locally setting up things might not reproduce the prod env, is there any way you suggest? |
|
Adding to this, a few questions: Is the only possible way to "wrap" the build workflow to wrap around the As Vyom points out, the issue seems to be that of running the thing as Also: +1 to Vyom's question on replicating this locally as that would speed up testing on our end. |
|
I will close and reopen to trigger newly added testing |
|
/hold |
|
/retest |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Needs approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
|
One addition here, is it possible to change the default SBOM generator to https://github.com/kusari-oss/waybill otherwhise comparing quality sizing will be not accurate |
Summary
This PR wraps the GitHub Actions runner with
witness run, so that the VM produces in-toto attestation.This PR only covers invoking
witnesson the VM. This is a follow-up to #639.Changes
Only the last command in
runOnMachine()(cloudrunners/oci/main.go) is changed.The command now does the following in order.
/tmp/witnessfor witness files and/home/ubuntu/_workas the witness working directory.witness runas root.run.shasubuntuunder witness, as before.The resulting process tree
The attestation is stored at
/tmp/witness/attestation.jsonon the VM.Questions
1. Could you check the kernel version of the OCI image?
The network trace requires kernel 6.12 or later. The kernel version of the current OCI image has not been confirmed.
2. Is there another way to call the witness binary on the VM from this file?
In the current code, witness wraps the whole job, including the runner agent and all steps. However, we only want to monitor the job steps inside run.sh. If you have any other ideas, please let me know. Also, wrapping it this way will likely include ACTIONS_RUNNER_INPUT_JITCONFIG in the attestation.
3. Could you also review where the attestation should be saved?
The attestation will be used as input for the sbomit binary. This PR only changes the first step of the SBOMit pipeline (calling witness), but later we will need the path to this attestation file when running sbomit. In addition, it would be great to discuss how we plan to collect the final SBOM file once it is generated.
/kind enhancement
/area ci
/priority medium
/status needs-review