Skip to content

Commit c19b651

Browse files
[StepSecurity] Apply security best practices (PowerShell#21480)
* [StepSecurity] Apply security best practices Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> * Update dependabot.yml * Delete tools/releaseBuild/Images/microsoft_powershell_centos7 directory * Delete tools/releaseBuild/Images/microsoft_powershell_ubuntu16.04 directory * Delete tools/releaseBuild/Images/microsoft_powershell_ubuntu18.04 directory * Delete tools/releaseBuild/Images/microsoft_powershell_windowsservercore/Dockerfile --------- Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent d370d7d commit c19b651

17 files changed

Lines changed: 122 additions & 153 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM mcr.microsoft.com/powershell/test-deps:ubuntu-18.04
6+
FROM mcr.microsoft.com/powershell/test-deps:ubuntu-18.04@sha256:20154a16708d4a92ebe81393361f27c7567e6553869e89dd6abdd198cc8ba309
77

88
# Avoid warnings by switching to noninteractive
99
ENV DEBIAN_FRONTEND=noninteractive

.devcontainer/fedora30/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM mcr.microsoft.com/powershell:preview-fedora-30
6+
FROM mcr.microsoft.com/powershell:preview-fedora-30@sha256:f405d4d60f8d196532da75038c76c052084ef02121f8e2d3852080ff4a230a5a
77

88
# Configure apt and install packages
99
RUN dnf install -y git procps wget findutils \

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ updates:
5858
interval: "daily"
5959
labels:
6060
- "CL-BuildPackaging"
61+
62+
- package-ecosystem: docker
63+
directory: /
64+
schedule:
65+
interval: daily
66+
labels:
67+
- "CL-BuildPackaging"

.github/workflows/AssignPrs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: Auto Assign PR Maintainer
22
on:
33
pull_request:
44
types: [opened, edited]
5+
permissions:
6+
contents: read
7+
58
jobs:
69
run:
710
runs-on: ubuntu-latest
811
permissions:
912
issues: write
1013
pull-requests: write
1114
steps:
12-
- uses: wow-actions/auto-assign@v3
15+
- uses: wow-actions/auto-assign@67fafa03df61d7e5f201734a2fa60d1ab111880d # v3.0.2
1316
with:
1417
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1518
# using the `org/team_slug` or `/team_slug` syntax to add git team as reviewers

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4141
with:
4242
fetch-depth: '0'
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v3
46+
uses: github/codeql-action/init@df5a14dc28094dc936e103b37d749c6628682b60 # v3.25.0
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,4 +66,4 @@ jobs:
6666
name: Build
6767
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v3
69+
uses: github/codeql-action/analyze@df5a14dc28094dc936e103b37d749c6628682b60 # v3.25.0

.github/workflows/createReminders.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616

1717
steps:
1818
- name: check for reminder
19-
uses: agrc/create-reminder-action@v1
19+
uses: agrc/create-reminder-action@922893a5705067719c4c4751843962f56aabf5eb # v1.1.13
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout Repository'
20+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
21+
- name: 'Dependency Review'
22+
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1

.github/workflows/markdownLink.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
markdown-link-check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
16-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
15+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16+
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1
1717
with:
1818
use-quiet-mode: 'yes'
1919
use-verbose-mode: 'yes'
@@ -26,13 +26,13 @@ jobs:
2626
statuses: write
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3030
with:
3131
# Full git history is needed to get a proper
3232
# list of changed files within `super-linter`
3333
fetch-depth: 0
3434
- name: Lint Markdown
35-
uses: super-linter/super-linter@v5
35+
uses: super-linter/super-linter@a8150b40c89574adb5f68bf9502b890a236a06b3 # v5.7.2
3636
env:
3737
VALIDATE_ALL_CODEBASE: false
3838
DEFAULT_BRANCH: master

.github/workflows/markdownLinkDaily.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
if: github.repository == 'PowerShell/PowerShell'
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2222
- name: Check Links
23-
uses: gaurav-nelson/github-action-markdown-link-check@v1
23+
uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1
2424
with:
2525
use-quiet-mode: 'yes'
2626
use-verbose-mode: 'yes'
2727
config-file: .github/workflows/markdown-link/config.json
2828
- name: Microsoft Teams Notifier
29-
uses: skitionek/notify-microsoft-teams@master
29+
uses: skitionek/notify-microsoft-teams@77cc88b484449e2318245a54c115c5dca0eae4ef # master
3030
if: failure()
3131
with:
3232
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}

.github/workflows/processReminders.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717

1818
steps:
1919
- name: check reminders and notify
20-
uses: agrc/reminder-action@v1
20+
uses: agrc/reminder-action@e59091b4e9705a6108120cb50823108df35b5392 # v1.0.12

0 commit comments

Comments
 (0)