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

Pages knowledge base article #2493

Merged
merged 9 commits into from
Apr 29, 2024
Merged

Pages knowledge base article #2493

merged 9 commits into from
Apr 29, 2024

Conversation

Ephraim-G
Copy link
Contributor

Changes proposed in this pull request:

  • Add a knowledge base article outlining some best practices Pages users can apply to their repositories

Security Considerations

N/A

@Ephraim-G Ephraim-G requested a review from a team April 12, 2024 16:27
@Ephraim-G Ephraim-G self-assigned this Apr 12, 2024
Copy link
Contributor

@svenaas svenaas left a comment

Choose a reason for hiding this comment

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

This is a valuable resource. I've made some copyediting suggestions, but maybe others should weigh in before decisions are made about them, in case someone offers a better wording.

_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
@Ephraim-G
Copy link
Contributor Author

@sknep 😀

Copy link
Contributor

@apburnes apburnes left a comment

Choose a reason for hiding this comment

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

Look great! I was iffy on the pros for a private repositories because all branches are published publicly and I don't want to give customers a false sense of security.


Adhering to a set of best practices when it comes to managing GitHub repositories can greatly ease the maintenance burden and drastically improve the developer experience for websites hosted on cloud.gov Pages. This document should serve as a constructive conversation piece for agencies and not as an audit mechanism. But by utilizing certain code scanning tools, agencies may find it easier to identify and cover certain security controls within their respective Customer Responsibility Matrix (CRM). Here is a useful guide for you to get started with implementing some best practices regarding user permissions and security for your GitHub hosted repositories.

## **Public vs Private repositories**
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## **Public vs Private repositories**
## Public vs Private repositories

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to rework the language so enhanced security isn't implied in any way.

_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
### **Public**


#### **Pros**
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### **Pros**
#### Pros

_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
- Compliance with open source and transparency initiatives per agency/program

#### **Cons**
- Any sensitive information inadvertently hardcoded is immediately visible
Copy link
Contributor

Choose a reason for hiding this comment

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

Since all published sites are public, the information would probably affect both public and private repositories. I don't want to inadvertently give a customer a false sense of security with a private repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood but if someone committed API keys to a _config.yml file for example in a private repository is that exposed anywhere other than in the build logs? That's more so what I was looking to convey

Copy link
Contributor

Choose a reason for hiding this comment

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

It starts to become very specific to the static site build engine and how they use their configuration settings. Many attributes in a Jekyll _config.yml get included with the site output. Let's leave this Any sensitive information inadvertently hardcoded is immediately visible here since it is true and let's adjust the other one to be very explicit.

_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved
- Restrict access to authorized collaborators and contributors (for any support issues a Pages engineer will request to be added as a collaborator to the repository if necessary)
- Risk mitigation
- Test/Make changes to a website without exposing commits to the public
- Safeguard against any potential leaks of sensitive information
Copy link
Contributor

Choose a reason for hiding this comment

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

Like the con for a public repo, Since all published sites are public, I don't want to inadvertently give a customer a false sense of security with a private repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

switched it up to explicitly state for any config files

_kbarticlespages/repository-best-practices.md Outdated Show resolved Hide resolved

#### Pros
- Test/Make changes to a website without exposing commits to the public
- Safeguard sensitive data such as API keys, access tokens or other credentials in any configuration files by storing them as environment variables in `config.yml` for Jekyll sites or using `dotenv` to load values from a separate `.env` file for 11ty, Gatsby and Node.js websites as an additional layer of privacy.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Safeguard sensitive data such as API keys, access tokens or other credentials in any configuration files by storing them as environment variables in `config.yml` for Jekyll sites or using `dotenv` to load values from a separate `.env` file for 11ty, Gatsby and Node.js websites as an additional layer of privacy.
- Safeguard sensitive data such as API keys, access tokens or other credentials by [using environment variables](https://cloud.gov/pages/documentation/env-vars-on-pages-builds/) in our build runtime.

@Ephraim-G Ephraim-G added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit 60d0975 Apr 29, 2024
5 of 6 checks passed
@Ephraim-G Ephraim-G deleted the pages-kb branch April 29, 2024 20:39
@apburnes
Copy link
Contributor

Closes cloud-gov/product#2952

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