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

Add Security guidelines #16

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The following guides are offered to help you improve your repository:
- [Code of Conduct Guide](./guides/CODE_OF_CONDUCT_GUIDE.md): Provide guidelines to ensure
everyone can safely contribute.
- [License Guide](./guides/LICENSE_GUIDE.md): Pick an appropriate license.
- [Security Guide](./guides/SECURITY_GUIDE.md): Provide guidelines for optimizing the security of
the repository and its content.

> [!TIP]
> GitHub Community Standards are a great source of information and best practices. You can check
Expand Down
1 change: 1 addition & 0 deletions public/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
* [Contributor's Handbook](/guides/CONTRIBUTING_GUIDE.md)
* [Pull Request Manual](/guides/PULL_REQUEST_GUIDE.md)
* [Code of Conduct Guidelines](/guides/CODE_OF_CONDUCT_GUIDE.md)
* [Security policy Guidelines](/guides/SECURITY_GUIDE.md)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* [Security policy Guidelines](/guides/SECURITY_GUIDE.md)
* [Security Policy Guidelines](/guides/SECURITY_GUIDE.md)

82 changes: 82 additions & 0 deletions public/guides/SECURITY_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# GitHub Security Guide

## Repository Access Settings
For products with sensitive information or proprietary code, set the repository as private to
maintain confidentiality and control access. For open-source projects or non-sensitive content,
consider making the repository public to encourage collaboration and transparency.

## Enable Dependency Graph for Private Repositories
Copy link
Member

Choose a reason for hiding this comment

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

Why only for private repositories?

We could also look to have Dependency Graph enabled by default for every repositories in the SRGSSR organisation: https://docs.github.com/en/code-security/getting-started/securing-your-organization

Copy link
Member

Choose a reason for hiding this comment

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

The dependency graph is enabled for public repositories by default (and cannot be disabled AFAIK). Here is an example with our Pillarbox Apple repository:

Screenshot 2024-03-06 at 09 39 23

Enable the Dependency Graph feature for private repositories to automatically track and manage
dependencies.
This feature helps identify and address vulnerabilities in project dependencies by providing
insights into package versions and usage.

## Enable Dependabot Alerts, Security Updates, and Version Updates
Enable Dependabot alerts to receive notifications about vulnerable dependencies in your
repositories.
Configure Dependabot to automatically apply security updates and version updates when available.
Regularly review and merge Dependabot pull requests to keep dependencies up-to-date and secure.
Comment on lines +14 to +18
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should also explain how to enable and configure these features? Or provide links to relevant documentation?


## Code Scanning
You may enable GitHub code scanning to automatically detect and flag potential security
vulnerabilities in your code.
You can also integrate code scanning into your CI/CD pipeline to catch issues early in the
development process.
Address identified vulnerabilities promptly and thoroughly to minimize security risks.

## Secret Scanning
You may enable secret scanning to detect and prevent the exposure of sensitive information, such as
API keys, passwords, and tokens, in your repositories.
Regularly review secret scanning alerts and take action to remove or secure any exposed secrets.

---

*You can find more information about these security features in the official [GitHub documentation][github-doc].*

## Write a security policy
Having a security policy ensures easy access to maintained versions list, major security rules and
vulnerabilities report guidelines among other things.

This template will assist you in creating a concise SECURITY POLICY for your project which should
be a `SECURITY.md` file at the root of the repository.
Comment on lines +40 to +41
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This template will assist you in creating a concise SECURITY POLICY for your project which should
be a `SECURITY.md` file at the root of the repository.
This template will assist you in creating a concise security policy for your project, which should
be a `SECURITY.md` file at the root of the repository.


```markdown
# Security Policy

## Supported versions
> Use this section to tell people about which versions of your project are currently being
> supported with security updates.

Sample table:
| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Dependencies
Only supported versions of software, libraries, and frameworks shall be used. Regularly update
dependencies to ensure compliance with supported versions and address known vulnerabilities.

## Secrets
Under no circumstances shall sensitive information, such as passwords, API keys, or access tokens,
be stored in the repository. Securely manage secrets using a dedicated secrets management tool
or environment variables.

## Reporting a Vulnerability
To report a vulnerability, open an issue with the "security" label on GitHub. Additionally, open a
Jira SMAC issue with a link to the GitHub issue for tracking and coordination.
Comment on lines +68 to +69
Copy link
Member

Choose a reason for hiding this comment

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

  • It's a detail, but by default, I don't think that the "security" label exists. So it would be nice to mention that it needs to be created first (or see if it's possible to create it at the organisation level)
  • Add a link to Jira SMAC?
Suggested change
To report a vulnerability, open an issue with the "security" label on GitHub. Additionally, open a
Jira SMAC issue with a link to the GitHub issue for tracking and coordination.
To report a vulnerability, open an issue with the "security" label on GitHub.
Additionally, open a
[Jira SMAC](https://srgssr-ch.atlassian.net/browse/SMAC) issue with a link to the GitHub issue for tracking and coordination.


## Code Reviews
All code changes must undergo thorough review by at least one other team member before being merged
into the main branch. Code reviewers shall ensure that changes meet coding standards, security
requirements, and best practices.

## Compliance
This repository shall comply with relevant laws, regulations, and industry standards governing the
protection of data and intellectual property. Regular audits and assessments shall be conducted to
verify compliance and address any non-compliance issues promptly.
```

[github-doc]: https://docs.github.com/en/code-security/getting-started/securing-your-repository