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

(hactoberfest): Fix code scanning alert #3821 #3872

Conversation

BLANKatGITHUB
Copy link
Contributor

As first a student and first time contributor, I didn't understand fully what I had to do , but I tried my best. Thanks for giving me opportunity to learn :) .

step-security-bot and others added 2 commits October 5, 2024 20:16
…_1728159415

[StepSecurity] Apply security best practices
@romange
Copy link
Collaborator

romange commented Oct 6, 2024

Thanks! A few questions:

  1. Why github actions use hashes?
  2. what step-security/harden-runner does? why do we need it in all the workflows?

with:
egress-policy: audit

- name: Checkout repository
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should checkout with submodules. See how we checkout in other places.

what this action does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used to monitor and log all outgoing network traffic during your CI/CD workflows without blocking any traffic.

@@ -30,3 +30,23 @@ repos:
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/gitleaks/gitleaks
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gitleaks repo is used to detect and prevent hardcoded secrets like passwords, API keys and tokens in git repositries.

@romange
Copy link
Collaborator

romange commented Oct 6, 2024

My main comment is that this PR is huge and I prefer we take it by baby steps - since both you and I do not have much experience in this domain. Please choose 1-2 improvements you want to add and submit only them, no need to add everything at once.

@BLANKatGITHUB
Copy link
Contributor Author

I appreciate your feedback, and I am sorry for inconvenience that I may have caused, I am somewhat familiar with GitHub Actions but never used them in real projects, I will try my best to solve these and add them incrementally . I hope you can guide me if I face a problem thanks.

@BLANKatGITHUB
Copy link
Contributor Author

Thanks! A few questions:

  1. Why github actions use hashes?

GitHub actions use hashes to use the specific commit or SHA of an action to ensure stability.

  1. what step-security/harden-runner does? why do we need it in all the workflows?

step-security/harden-runner provides some security features like network egress filtering and runtime security.

@romange
Copy link
Collaborator

romange commented Oct 6, 2024

I prefer we won't use hashes and not add harden-runner - this should reduce the diff significantly.

@BLANKatGITHUB
Copy link
Contributor Author

I will create a new pull request requesting change in one workflow.

@BLANKatGITHUB BLANKatGITHUB marked this pull request as draft October 6, 2024 13:56
@BLANKatGITHUB BLANKatGITHUB deleted the Fix_code_scanning_alert---Token-Permissions branch October 6, 2024 13:58
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.

3 participants