Skip to content

Commit 7173302

Browse files
committed
GitHub Advanced Security, Rust code scanning example
1 parent fb84402 commit 7173302

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+12961
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.devcontainer/devcontainer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
3+
{
4+
"name": "Rust",
5+
"image": "mcr.microsoft.com/devcontainers/rust:1-bullseye"
6+
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
// "features": {},
9+
10+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
11+
// "forwardPorts": [],
12+
13+
// Use 'postCreateCommand' to run commands after the container is created.
14+
// "postCreateCommand": "rustc --version",
15+
16+
// Configure tool-specific properties.
17+
// "customizations": {},
18+
19+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
20+
// "remoteUser": "root"
21+
}

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/clippy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Rust_Clippy
2+
on:
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
clippy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions-rs/toolchain@v1
11+
with:
12+
profile: minimal
13+
toolchain: stable
14+
components: clippy,rustfmt
15+
override: true
16+
- uses: Swatinem/rust-cache@v2
17+
- run: cargo install clippy-sarif sarif-fmt
18+
# Note: specifying --all-targets emits duplicated results
19+
# - run: cargo clippy --all-targets --all-features --message-format=json |
20+
# clippy-sarif | tee results.sarif | sarif-fmt
21+
- run: cargo clippy --all-features --message-format=json |
22+
clippy-sarif | tee results.sarif | sarif-fmt
23+
- name: Upload SARIF file
24+
uses: github/codeql-action/upload-sarif@v3
25+
with:
26+
sarif_file: results.sarif

.github/workflows/devskim.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Rust_DevSkim
2+
on:
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
lint:
7+
name: DevSkim
8+
runs-on: ubuntu-latest
9+
permissions:
10+
actions: read
11+
contents: read
12+
security-events: write
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
- name: Run DevSkim scanner
17+
uses: microsoft/DevSkim-Action@v1
18+
- name: Upload DevSkim scan results to GitHub Security tab
19+
uses: github/codeql-action/upload-sarif@v3
20+
with:
21+
sarif_file: devskim-results.sarif

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

0 commit comments

Comments
 (0)