Skip to content

github: Use IAM Roles to push files on AWS S3 #815

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

Merged
merged 4 commits into from
Dec 12, 2024
Merged

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Dec 12, 2024

For security reasons long lived credentials are not considered secure.
To overcome this issue we can configure Github Workflows to use AWS OpenID Connect instead:
For further details: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect

Tested:

For security reasons long lived credentials are not considered secure.
To overcome this issue we can configure Github Workflows to use AWS OpenID Connect instead:
For further details: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.97%. Comparing base (d3d2d59) to head (19f540a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #815   +/-   ##
=======================================
  Coverage   89.97%   89.97%           
=======================================
  Files          44       44           
  Lines        6772     6772           
=======================================
  Hits         6093     6093           
  Misses        555      555           
  Partials      124      124           
Flag Coverage Δ
unit 89.97% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This reverts commit fa85b31.
@alessio-perugini alessio-perugini marked this pull request as ready for review December 12, 2024 14:04
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }}
Copy link
Member

Choose a reason for hiding this comment

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

Can we check if env.DIST_DIR, secrets.DOWNLOADS_BUCKET, and env.AWS_PLUGIN_TARGET are defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are defined at the top of the workflow. I've also checked that the files are present in our s3 bucket.
https://github.com/arduino/arduino-lint/blob/iam-roles/.github/workflows/release-go-task.yml#L6-L12

The download_bucket is a secret that you can find defined in the settings of this repo.

@alessio-perugini alessio-perugini merged commit d873159 into main Dec 12, 2024
15 checks passed
@alessio-perugini alessio-perugini deleted the iam-roles branch December 12, 2024 15:48
@alessio-perugini alessio-perugini added topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants