Skip to content

Azure redis #65

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

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f04c8dc
🥍 Tue Oct 22 19:37:43 UTC 2024
briandenicola Oct 22, 2024
58352f2
🏓 Tue Oct 22 19:50:52 UTC 2024
briandenicola Oct 22, 2024
6ec0817
🏏 Tue Oct 22 19:52:16 UTC 2024
briandenicola Oct 22, 2024
9d0d9a8
🏀 Tue Oct 22 19:53:43 UTC 2024
briandenicola Oct 22, 2024
14fc204
🏓 Tue Oct 22 20:17:07 UTC 2024
briandenicola Oct 22, 2024
76cb79f
Resolves #2
briandenicola Oct 22, 2024
f34b624
Merge pull request #3 from briandenicola/feature-branch-item-2
briandenicola Oct 22, 2024
6b1c662
IaaC
briandenicola Oct 22, 2024
e951894
Merge branch 'main' of github.com:briandenicola/TechExcel-Accelerate-…
briandenicola Oct 22, 2024
18253c9
Update deploy.yml
briandenicola Oct 23, 2024
c577599
Create sample
briandenicola Oct 23, 2024
513f8ef
Update and rename sample to sample.yaml
briandenicola Oct 23, 2024
bebd687
Update deploy.yml
briandenicola Oct 23, 2024
83adc47
Update deploy.yml
briandenicola Oct 23, 2024
81560a0
Update deploy.yml
briandenicola Oct 23, 2024
6981bfb
Update deploy.yml
briandenicola Oct 23, 2024
ef329b5
Update deploy.yml
briandenicola Oct 23, 2024
2aa1f09
Update deploy.yml
briandenicola Oct 23, 2024
db74265
Update deploy.yml
briandenicola Oct 23, 2024
c62e282
🥍 Wed Oct 23 15:56:12 UTC 2024
briandenicola Oct 23, 2024
91e1fb9
🏓 Wed Oct 23 16:06:43 UTC 2024
briandenicola Oct 23, 2024
e5191c4
Create dotnet.yml
briandenicola Oct 23, 2024
8e54154
🥊 Wed Oct 23 16:22:38 UTC 2024
briandenicola Oct 23, 2024
c22fe29
🏈 Wed Oct 23 16:35:01 UTC 2024
briandenicola Oct 23, 2024
87bd7dc
🏀 Wed Oct 23 16:37:23 UTC 2024
briandenicola Oct 23, 2024
29fcd6b
🎮 Wed Oct 23 16:46:50 UTC 2024
briandenicola Oct 23, 2024
84e443c
🎲 Wed Oct 23 16:48:12 UTC 2024
briandenicola Oct 23, 2024
580765f
🥍 Wed Oct 23 16:51:59 UTC 2024
briandenicola Oct 23, 2024
0daaac3
⚾ Wed Oct 23 16:56:05 UTC 2024
briandenicola Oct 23, 2024
45c5558
🏈 Wed Oct 23 17:01:36 UTC 2024
briandenicola Oct 23, 2024
99ae1b0
⚾ Wed Oct 23 17:04:20 UTC 2024
briandenicola Oct 23, 2024
2f0de5c
🥊 Wed Oct 23 17:15:16 UTC 2024
briandenicola Oct 23, 2024
82f9f29
🎲 Wed Oct 23 17:24:28 UTC 2024
briandenicola Oct 23, 2024
8d82945
created code owners
briandenicola Oct 23, 2024
fbeaaff
⚾ Wed Oct 23 17:38:14 UTC 2024
briandenicola Oct 23, 2024
e13385e
🏒 Wed Oct 23 17:39:09 UTC 2024
briandenicola Oct 23, 2024
f3b2777
Merge pull request #4 from briandenicola/code-owners-update
briandenicola Oct 23, 2024
1fb6559
🥊 Wed Oct 23 17:40:42 UTC 2024
briandenicola Oct 23, 2024
89b7a60
Updated Page
briandenicola Oct 23, 2024
56f3ac2
Security Policy Update
briandenicola Oct 23, 2024
428ca59
Merge pull request #5 from briandenicola/feature-branch-item-3
briandenicola Oct 23, 2024
3ca3fb9
Merge pull request #6 from briandenicola/security-policy-update
briandenicola Oct 23, 2024
7a05128
Create codeql.yml
briandenicola Oct 23, 2024
f58db2c
Merge pull request #7 from briandenicola/briandenicola-patch-1
briandenicola Oct 23, 2024
4364c7b
Fix code scanning alert no. 1: Arbitrary file access during archive e…
briandenicola Oct 23, 2024
b441f25
Merge pull request #9 from briandenicola/alert-autofix-1
briandenicola Oct 23, 2024
26b6c15
🎲 Wed Oct 23 19:01:31 UTC 2024
briandenicola Oct 23, 2024
13a1419
Updated connection string value
briandenicola Oct 23, 2024
66329a7
Bug fix
briandenicola Oct 23, 2024
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
94 changes: 94 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '42 2 * * 1'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: none
- language: ruby
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Azure Bicep
on:
workflow_dispatch

env:
targetEnv: dev
RG: TechExcel_RG

permissions:
id-token: write
contents: read

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Run ARM deploy
uses: azure/arm-deploy@v1
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resourceGroupName: ${{ env.RG }}
template: ./src/InfrastructureAsCode/main.bicep
parameters: environment=${{ env.targetEnv }}
89 changes: 89 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET Build

on:
workflow_dispatch:
push:
paths:
- src/Application/**
pull_request:
paths:
- src/Application/**

# defaults:
# run:
# shell: bash
# working-directory: ./src/Application/src/RazorPagesTestSample

permissions:
id-token: write
contents: read

env:
ACR_NAME: 'f3jiczwhl7laimpnpreg.azurecr.io'
CONTAINER_NAME: 'razorpagestestsample'
WEB_APP_NAME: 'f3jiczwhl7lai-dev'
TAG_NAME: ${{ github.sha }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 8.0.x
# - name: Restore dependencies
# run: dotnet restore
# - name: Build
# run: dotnet build --no-restore
# - name: Test
# run: dotnet test --no-build --verbosity normal

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Log into registry ACR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.ACR_NAME }}
username: ${{ secrets.AZURE_CLIENT_ID }}
password: ${{ secrets.AZURE_CLIENT_SECRET }}

- name: Build and push container image to registry
uses: docker/build-push-action@v2
with:
context: ./src/Application/src/RazorPagesTestSample
push: true
tags: ${{ env.ACR_NAME }}/${{ env.CONTAINER_NAME }}:${{ env.TAG_NAME }}
file: ./src/Application/src/RazorPagesTestSample/Dockerfile

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Deploys to WebApp
uses: Azure/webapps-deploy@v2
with:
app-name: ${{ env.WEB_APP_NAME }}
images: '${{ env.ACR_NAME }}/${{ env.CONTAINER_NAME }}:${{ env.TAG_NAME }}'
25 changes: 25 additions & 0 deletions .github/workflows/first-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: First Workflow
on:
workflow_dispatch:

jobs:
job1:
runs-on: ubuntu-latest
env:
COW_SAYS: "Moo"
steps:
- name: Step one
run: echo "Step 1 Cow says ${{ env.COW_SAYS }}!"
- name: Step two
run: echo "Step 2 complete!"


job2:
needs: job1
runs-on: ubuntu-latest
steps:
- name: Cowsays
uses: mscoutermarsh/cowsays-action@master
with:
text: 'Ready for prod--ship it!'
color: 'magenta'
62 changes: 0 additions & 62 deletions .github/workflows/pages.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Specify owners for all files
* @briandenicola

# Specify owners for specific directories
/src/ @briandenicola

# Specify owners for specific files
#/scripts/deploy.sh @devops-owner

# Specify owners for files with specific extensions
#*.js @js-owner
#*.css @css-owner
10 changes: 10 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ Microsoft takes the security of our software products and services seriously, wh

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.

## Supported Versions

We release patches for security vulnerabilities in the following versions:

| Version | Supported |
| ------- | ------------------ |
| 1.x | :white_check_mark: |
| 0.x | :x: |

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**
Expand Down Expand Up @@ -38,4 +47,5 @@ We prefer all communications to be in English.

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).

We will respond to your report within 48 hours and keep you updated on the progress. We appreciate your help in keeping our project secure.
<!-- END MICROSOFT SECURITY.MD BLOCK -->
2 changes: 1 addition & 1 deletion src/Application/src/RazorPagesTestSample/Data/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Message

[Required]
[DataType(DataType.Text)]
[StringLength(200, ErrorMessage = "There's a 200 character limit on messages. Please shorten your message.")]
[StringLength(250, ErrorMessage = "There's a 250 character limit on messages. Please shorten your message.")]
public string Text { get; set; }
}
#endregion
Expand Down
10 changes: 10 additions & 0 deletions src/Application/src/RazorPagesTestSample/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release --nologo -o publish/linux

FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /src/publish/linux .
ENTRYPOINT [ "dotnet", "RazorPagesTestSample.dll" ]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Munson's Pickles and Preserves Team Messaging System";
ViewData["Title"] = "Brian's Pickles Team Messaging System";
}

<h1>@ViewData["Title"]</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ public async Task<IActionResult> OnPostAnalyzeMessagesAsync()

public static void WriteToDirectory(ZipArchiveEntry entry, string destDirectory)
{
string destFileName = Path.Combine(destDirectory, entry.FullName);
string destFileName = Path.GetFullPath(Path.Combine(destDirectory, entry.FullName));
string fullDestDirPath = Path.GetFullPath(destDirectory + Path.DirectorySeparatorChar);
if (!destFileName.StartsWith(fullDestDirPath))
{
throw new InvalidOperationException("Entry is outside the target dir: " + destFileName);
}
entry.ExtractToFile(destFileName);
}
}
Expand Down
Loading
Loading