Skip to content

* Catchup 21/03/2026 - #3244

Merged
PWagner1 merged 10 commits into
goldfrom
master
Mar 21, 2026
Merged

PWagner1 merged 10 commits into
goldfrom
master

Conversation

@PWagner1

Copy link
Copy Markdown
Contributor

No description provided.

PWagner1 and others added 10 commits March 19, 2026 18:33
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions (#3239)

Potential fix for
[https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/5](https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/5)

To fix the problem, define explicit minimal `GITHUB_TOKEN` permissions
in the workflow. The safest general approach is to add a top-level
`permissions` block (applies to all jobs) with `contents: read`, and
then only grant broader permissions at the job level if a particular job
truly needs them. In this case, both `build` and `release` jobs only
read the repository and talk to external endpoints, so `contents: read`
is sufficient.

The best fix without changing existing functionality is:

- Add a top-level `permissions:` block right after `name: Build` (before
`on:`) setting `contents: read`.
- This will apply to both `build` and `release` jobs since they do not
define their own `permissions` blocks.
- No additional imports, methods, or definitions are needed because this
is purely a YAML configuration change within
`.github/workflows/build.yml`.

Concretely:
- In `.github/workflows/build.yml`, between line 4 (`name: Build`) and
line 6 (`on:`), insert:

```yaml
permissions:
  contents: read
```

This explicitly restricts the `GITHUB_TOKEN` to read-only access to
repository contents for the entire workflow.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
…n permissions (#3238)

Potential fix for
[https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/1](https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/1)

To fix the issue, add an explicit `permissions` block that grants only
the minimal scopes needed. This workflow’s steps use `actions/checkout`,
which needs `contents: read`, and they do not need to write to the repo
or interact with issues/PRs. Therefore, setting `permissions: contents:
read` at the workflow root (top-level, alongside `name` and `on`) is
sufficient and will apply to all jobs unless overridden.

Concretely:
- Edit `.github/workflows/canary-lts-release.yml`.
- Insert a `permissions:` section after the `name: Canary LTS Release`
line (line 8) and before the `on:` block (line 10).
- Set `contents: read` inside this block.
- No additional imports, actions, or code changes are necessary.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
…n permissions (#3237)

Potential fix for
[https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/2](https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/2)

In general, the fix is to add an explicit `permissions` block that
scopes `GITHUB_TOKEN` to the minimal rights needed. For a pure build
workflow that only checks out code, restores packages, and builds
artifacts, `contents: read` is usually sufficient; if it needs to read
packages from GitHub Packages, `packages: read` can be added as well.
This block can be declared at the workflow root (applies to all jobs) or
per job.

The best minimal change here is to add a single workflow-level
`permissions` block right after the `on:` section and before `jobs:`.
This will apply to both `build` and `release` jobs without changing any
steps. Based on the visible steps (checkout, cache, restore, build,
pack, version detection), they only need to read repository contents, so
`contents: read` is adequate. No imports or additional code are needed;
only YAML configuration changes within `.github/workflows/build.yml`.

Concretely, in `.github/workflows/build.yml`, between the existing
`workflow_dispatch:` line (20) and the `jobs:` key (21), insert:

```yaml
permissions:
  contents: read
```

This explicitly limits the default `GITHUB_TOKEN` permissions for all
jobs in this workflow.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
…n permissions (#3236)

Potential fix for
[https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/3](https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/3)

In general, fix this by adding an explicit `permissions` block that
grants only the minimal GitHub API permissions needed. Since this
workflow builds, publishes to NuGet, and calls external services but
does not modify GitHub resources (no pushing commits, creating releases,
or managing issues/PRs), it can safely use `contents: read` only.

The best fix here is to add a workflow‑level `permissions` block
(applies to all jobs) near the top of `.github/workflows/canary.yml`,
just after the `name:` (or before `jobs:`). This keeps the configuration
simple: a single block that limits `GITHUB_TOKEN` to read‑only
repository contents. No additional methods, imports, or changes to steps
are required, because none of the existing steps rely on elevated token
permissions.

Concretely:
- Edit `.github/workflows/canary.yml`.
- Insert:
  ```yaml
  permissions:
    contents: read
  ```
between the `on:` section and the `jobs:` section (e.g., after line 17
or line 18).
This will satisfy CodeQL’s requirement and enforce least privilege
without changing current behavior.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
…n permissions (#3235)

Potential fix for
[https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/4](https://github.com/Krypton-Suite/Standard-Toolkit/security/code-scanning/4)

To fix the problem, explicitly set the `permissions` for the workflow or
for the `nightly` job so that the `GITHUB_TOKEN` follows the principle
of least privilege. Since the workflow only needs to read repository
contents (for checkout and build) and does not perform any GitHub write
operations, we can safely restrict permissions to `contents: read` at
the top level. This will apply to all jobs (there is only `nightly`) and
satisfies the CodeQL recommendation.

The single best fix without changing functionality is:

- Add a root-level `permissions:` block after the `name:` declaration
(around line 8–9).
- Set `contents: read` as a minimal permission; other scopes are not
needed based on the provided steps.

Concretely, in `.github/workflows/nightly.yml`, insert:

```yaml
permissions:
  contents: read
```

between `name: Nightly Release` and the `on:` block. No imports or
additional definitions are needed; this is purely a YAML configuration
change.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
@PWagner1
PWagner1 requested a review from a team as a code owner March 21, 2026 17:31
@PWagner1
PWagner1 merged commit 5e3b3b1 into gold Mar 21, 2026
16 checks passed

This branch was previously deployed

1 inactive deployment
production — 34b00ad6 Deployed Mar 24, 2026 by PWagner1 via nightly #142
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.

1 participant