Skip to content
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
Binary file not shown.
Binary file removed assets/images/help/copilot/mcp-icon-in-dropdown.png
Binary file not shown.
2 changes: 1 addition & 1 deletion config/kubernetes/default/deployments/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: webapp
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: webapp
Expand Down
6 changes: 3 additions & 3 deletions config/kubernetes/production/deployments/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: webapp
spec:
replicas: 4
replicas: 6
selector:
matchLabels:
app: webapp
Expand All @@ -23,12 +23,12 @@ spec:
image: docs-internal
resources:
requests:
cpu: 4000m
cpu: 2500m
# Absolute minimum to start app is 1000m
# Node is single-threaded but we want more CPUs
# for OS and image resizing, and other binary executions
# Better to increase replicas or memory than CPU
memory: 8Gi
memory: 6.0Gi
# Absolute minimum to start app is 4500Mi
# Would increase with more pages, versions, or languages supported
# The additional memory helps during traffic surges
Expand Down
25 changes: 24 additions & 1 deletion content/actions/reference/security/secure-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,30 @@ For more information, see [AUTOTITLE](/code-security/code-scanning/introduction-

To help mitigate the risk of an exposed token, consider restricting the assigned permissions. For more information, see [AUTOTITLE](/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token).

### Using third-party actions
{% ifversion custom-org-roles %}

## Mitigating the risks of untrusted code checkout

Similar to script injection attacks, untrusted pull request content that automatically triggers actions processing can also pose a security risk. The `pull_request_target` and `workflow_run` workflow triggers, when used with the checkout of an untrusted pull request, expose the repository to security compromises. These workflows are privileged, which means they share the same cache of the main branch with other privileged workflow triggers, and may have repository write access and access to referenced secrets. These vulnerabilities can be exploited to take over a repository.

For more information on these triggers, how to use them, and the associated risks, see [AUTOTITLE](/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target) and [AUTOTITLE](/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run).

For additional examples and guidance on the risks of untrusted code checkout, see [Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) from {% data variables.product.prodname_security %} and the [Dangerous-Workflow](https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow) documentation from OpenSSF Scorecard.

### Good practices


* Avoid using the `pull_request_target` workflow trigger if it's not necessary. For privilege separation between workflows, `workflow_run` is a better trigger. Only use these workflow triggers when the workflow actually needs the privileged context.

* Avoid using the `pull_request_target` and `workflow_run` workflow triggers with untrusted pull requests or code content. Workflows that use these triggers must not explicitly check out untrusted code, including from pull request forks or from repositories that are not under your control. Workflows triggered on `workflow_run` should treat artifacts uploaded from other workflows with caution.

* {% data variables.product.prodname_codeql %} can scan and detect potentially vulnerable {% data variables.product.prodname_actions %} workflows. You can configure default setup for the repository, and ensure that {% data variables.product.prodname_actions %} scanning is enabled. For more information, see [AUTOTITLE](/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning).

* OpenSSF Scorecards can help you identify potentially vulnerable workflows, along with other security risks when using {% data variables.product.prodname_actions %}. See [Using OpenSSF Scorecards to secure workflow dependencies](#using-openssf-scorecards-to-secure-workflow-dependencies) later in this article.

{% endif %}

## Using third-party actions

The individual jobs in a workflow can interact with (and compromise) other jobs. For example, a job querying the environment variables used by a later job, writing files to a shared directory that a later job processes, or even more directly by interacting with the Docker socket and inspecting other running containers and executing commands in them.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,8 @@ For more information, see the {% data variables.product.prodname_cli %} informat

This event occurs when a workflow run is requested or completed. It allows you to execute a workflow based on execution or completion of another workflow. The workflow started by the `workflow_run` event is able to access secrets and write tokens, even if the previous workflow was not. This is useful in cases where the previous workflow is intentionally not privileged, but you need to take a privileged action in a later workflow.

{% data reusables.actions.workflow-run-permissions-warning %}

In this example, a workflow is configured to run after the separate "Run Tests" workflow completes.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ redirect_from:
This version of this article is for using repository custom instructions on the {% data variables.product.github %} website. Click the tabs above for information on using custom instructions in other environments. <!-- markdownlint-disable-line MD027 -->

{% data reusables.copilot.repository-custom-instructions-support %}
* **{% data variables.copilot.copilot_code-review_short %}**

{% data reusables.copilot.repository-custom-instructions-prerequisites %}

Expand All @@ -31,7 +30,6 @@ This version of this article is for using repository custom instructions on the
This version of this article is for using repository custom instructions and prompt files in {% data variables.product.prodname_vscode_shortname %}. Click the tabs above for instructions on using custom instructions in other environments.

{% data reusables.copilot.repository-custom-instructions-support %}
* **{% data variables.copilot.copilot_code-review_short %}**

{% data reusables.copilot.repository-custom-instructions-prerequisites %}

Expand All @@ -42,7 +40,6 @@ This version of this article is for using repository custom instructions and pro
This version of this article is for using repository custom instructions in {% data variables.product.prodname_vs %}. Click the tabs above for instructions on using custom instructions in other environments.

{% data reusables.copilot.repository-custom-instructions-support %}
* **{% data variables.copilot.copilot_code-review_short %}**

{% data reusables.copilot.repository-custom-instructions-prerequisites %}

Expand All @@ -53,7 +50,6 @@ This version of this article is for using repository custom instructions in {% d
This version of this article is for using repository custom instructions in JetBrains IDEs. Click the tabs above for instructions on using custom instructions in other environments.

{% data reusables.copilot.repository-custom-instructions-support %}
* **{% data variables.copilot.copilot_code-review_short %}**

{% data reusables.copilot.repository-custom-instructions-prerequisites %}

Expand All @@ -76,7 +72,6 @@ This version of this article is for using repository custom instructions in Xcod
This version of this article is for using repository custom instructions in Eclipse. Click the tabs above for instructions on using custom instructions in other environments.

{% data reusables.copilot.repository-custom-instructions-support %}
* **{% data variables.copilot.copilot_code-review_short %}**

{% data reusables.copilot.repository-custom-instructions-prerequisites %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ In this example, the attempted script injection is unsuccessful, which is reflec
PR title did not start with 'octocat'
```

With this approach, the value of the {% raw %}`${{ github.event.issue.title }}`{% endraw %} expression is stored in memory and used as a variable, and doesn't interact with the script generation process. In addition, consider using double quote shell variables to avoid [word splitting](https://github.com/koalaman/shellcheck/wiki/SC2086), but this is [one of many](https://mywiki.wooledge.org/BashPitfalls) general recommendations for writing shell scripts, and is not specific to {% data variables.product.prodname_actions %}.
With this approach, the value of the {% raw %}`${{ github.event.pull_request.title }}`{% endraw %} expression is stored in memory and used as a variable, and doesn't interact with the script generation process. In addition, consider using double quote shell variables to avoid [word splitting](https://github.com/koalaman/shellcheck/wiki/SC2086), but this is [one of many](https://mywiki.wooledge.org/BashPitfalls) general recommendations for writing shell scripts, and is not specific to {% data variables.product.prodname_actions %}.

### Using workflow templates for {% data variables.product.prodname_code_scanning %}

Expand All @@ -152,6 +152,10 @@ For more information, see [AUTOTITLE](/code-security/code-scanning/introduction-

To help mitigate the risk of an exposed token, consider restricting the assigned permissions. For more information, see [AUTOTITLE](/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token).

## Understanding the risks of untrusted code checkout

Untrusted pull request content that automatically triggers actions processing can pose a security risk. For more information, see [AUTOTITLE](/enterprise-cloud@latest/actions/reference/security/secure-use#mitigating-the-risks-of-untrusted-code-checkout) in the {% data variables.product.prodname_ghe_cloud %} documentation.

## Managing permissions for {% data variables.product.prodname_actions %} settings in your organization

You can practice the principle of least privilege for your organization's CI/CD pipeline with {% data variables.product.prodname_actions %} by administering custom organization roles. A custom organization role is a way to grant an individual or team in your organization the ability to control certain subsets of settings without granting full administrative control of the organization and its repositories.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> [!WARNING]
> For workflows that are triggered by the `pull_request_target` event, the `GITHUB_TOKEN` is granted read/write repository permission unless the `permissions` key is specified and the workflow can access secrets, even when it is triggered from a fork. Although the workflow runs in the context of the base of the pull request, you should make sure that you do not check out, build, or run untrusted code from the pull request with this event. Additionally, any caches share the same scope as the base branch. To help prevent cache poisoning, you should not save the cache if there is a possibility that the cache contents were altered. For more information, see [Keeping your GitHub Actions and workflows secure: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests) on the GitHub Security Lab website.
> Running untrusted code on the `pull_request_target` trigger may lead to security vulnerabilities. These vulnerabilities include cache poisoning and granting unintended access to write privileges or secrets. For more information, see [AUTOTITLE](/enterprise-cloud@latest/actions/reference/security/secure-use#mitigating-the-risks-of-untrusted-code-checkout) in the {% data variables.product.prodname_ghe_cloud %} documentation, and [Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests) on the {% data variables.product.prodname_security %} website.
2 changes: 2 additions & 0 deletions data/reusables/actions/workflow-run-permissions-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> [!WARNING]
> Running untrusted code on the `workflow_run` trigger may lead to security vulnerabilities. These vulnerabilities include cache poisoning and granting unintended access to write privileges or secrets. For more information, see [AUTOTITLE](/enterprise-cloud@latest/actions/reference/security/secure-use#mitigating-the-risks-of-untrusted-code-checkout) in the {% data variables.product.prodname_ghe_cloud %} documentation, and [Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests) on the {% data variables.product.prodname_security %} website.
22 changes: 19 additions & 3 deletions data/reusables/copilot/repository-custom-instructions-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences.

Repository custom instructions are currently supported for:
* **{% data variables.copilot.copilot_coding_agent %}**
* **{% data variables.copilot.copilot_chat_short %}**
### Support for repository custom instructions

The following table shows which {% data variables.product.prodname_copilot_short %} features support the `.github/copilot-instructions.md` instructions file.

{% rowheaders %}

| | Eclipse | JetBrains IDEs | {% data variables.product.prodname_vs %} | {% data variables.product.prodname_vscode_shortname %} | {% data variables.product.prodname_dotcom_the_website %} | Xcode |
| --- | --- | --- | --- | --- | --- | --- |
| {% data variables.copilot.copilot_chat_short %} | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>1</sup> |
| {% data variables.copilot.copilot_coding_agent %} | N/A | N/A | N/A | {% octicon "check" aria-label="Included" %} <sup>3</sup> | {% octicon "check" aria-label="Included" %} <sup>3</sup> | N/A |
| {% data variables.copilot.copilot_code-review_short %} | N/A | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} <sup>1</sup> | {% octicon "check" aria-label="Included" %} <sup>2</sup> | {% octicon "check" aria-label="Included" %} <sup>2</sup> | {% octicon "x" aria-label="Not included" %} |

{% endrowheaders %}

**1:** Repository-wide instructions (using the `.github/copilot-instructions.md` file) are supported.<br>
**2:** Repository-wide instructions and path-specific instructions (using `.github/instructions/NAME.instructions.md` files) are supported.<br>
**3:** Repository-wide instructions, path-specific instructions, and agent instructions (using `AGENTS.md`, `CLAUDE.md` or `GEMINI.md` files) are supported.<br>
**X:** Custom instructions are not supported.<br>
**N/A:** Feature not available on this platform.
1 change: 0 additions & 1 deletion data/reusables/profile/copilot_settings.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5942,6 +5942,21 @@
}
]
},
"repository_custom_properties": {
"title": "Custom properties",
"displayTitle": "Repository permissions for \"Custom properties\"",
"permissions": [
{
"category": "repos",
"slug": "create-or-update-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/properties/values",
"additional-permissions": false,
"access": "write"
}
]
},
"vulnerability_alerts": {
"title": "Dependabot alerts",
"displayTitle": "Repository permissions for \"Dependabot alerts\"",
Expand Down Expand Up @@ -6822,6 +6837,15 @@
"additional-permissions": false,
"access": "read"
},
{
"category": "repos",
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values",
"additional-permissions": false,
"access": "read"
},
{
"category": "repos",
"slug": "get-rules-for-a-branch",
Expand Down
12 changes: 12 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -4408,6 +4408,18 @@
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/private-vulnerability-reporting"
},
{
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values"
},
{
"slug": "create-or-update-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/properties/values"
},
{
"slug": "get-a-repository-readme",
"subcategory": "contents",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7458,6 +7458,23 @@
}
]
},
"repository_custom_properties": {
"title": "Custom properties",
"displayTitle": "Repository permissions for \"Custom properties\"",
"permissions": [
{
"category": "repos",
"slug": "create-or-update-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/properties/values",
"access": "write",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
}
]
},
"vulnerability_alerts": {
"title": "Dependabot alerts",
"displayTitle": "Repository permissions for \"Dependabot alerts\"",
Expand Down Expand Up @@ -8537,6 +8554,17 @@
"server-to-server": true,
"additional-permissions": false
},
{
"category": "repos",
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values",
"access": "read",
"user-to-server": true,
"server-to-server": true,
"additional-permissions": false
},
{
"category": "repos",
"slug": "get-rules-for-a-branch",
Expand Down
16 changes: 14 additions & 2 deletions src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2908,7 +2908,7 @@
},
{
"slug": "list-attestations-by-bulk-subject-digests",
"subcategory": "orgs",
"subcategory": "attestations",
"verb": "post",
"requestPath": "/orgs/{org}/attestations/bulk-list"
},
Expand All @@ -2932,7 +2932,7 @@
},
{
"slug": "list-attestations",
"subcategory": "orgs",
"subcategory": "attestations",
"verb": "get",
"requestPath": "/orgs/{org}/attestations/{subject_digest}"
},
Expand Down Expand Up @@ -4540,6 +4540,18 @@
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/private-vulnerability-reporting"
},
{
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values"
},
{
"slug": "create-or-update-custom-property-values-for-a-repository",
"subcategory": "custom-properties",
"verb": "patch",
"requestPath": "/repos/{owner}/{repo}/properties/values"
},
{
"slug": "get-a-repository-readme",
"subcategory": "contents",
Expand Down
Loading