-
Notifications
You must be signed in to change notification settings - Fork 131
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
demo #114
Open
vinod-soni-microsoft
wants to merge
8
commits into
Azure:main
Choose a base branch
from
vinod-soni-microsoft:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
demo #114
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d081e5e
json file
vinod-soni-microsoft 9fd2111
Create codeql.yml
vinod-soni-microsoft 79b177b
Create dependabot.yml
vinod-soni-microsoft 20ac4ce
Update mod4-credential.json
vinod-soni-microsoft 0b9239b
Create mod4-lab1-deploy-test.yml
vinod-soni-microsoft 8430e73
Update text.txt
vinod-soni-microsoft 349fb25
Update text.txt
vinod-soni-microsoft 7ee199a
Update text.txt
vinod-soni-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '22 19 * * 5' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'java' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Use only 'java' to analyze code written in Java, Kotlin or both | ||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# 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. | ||
|
||
# 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 | ||
|
||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
#- name: Autobuild | ||
# uses: github/codeql-action/autobuild@v2 | ||
- name: Build Java | ||
run: | | ||
mvn clean package -f tools/deploy/module2/pom.xml | ||
|
||
# ℹ️ 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 the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'tools/deploy/module4/*text*' | ||
workflow_dispatch: | ||
|
||
env: | ||
TEST_AZURE_CONTAINER_REGISTRY: ${{ vars.TEST_AZURE_CONTAINER_REGISTRY }} | ||
TEST_RESOURCE_GROUP: ${{ vars.TEST_RESOURCE_GROUP }} | ||
TEST_CLUSTER_NAME: ${{ vars.TEST_CLUSTER_NAME }} | ||
TEST_DEPLOYMENT_MANIFEST_PATH: ${{ vars.TEST_DEPLOYMENT_MANIFEST_PATH }} | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
jobs: | ||
PushImagetoACR: | ||
name: Push Sample Image to ACR and AKS | ||
environment: test | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Echo variables | ||
run: | | ||
echo "TEST_AZURE_CONTAINER_REGISTRY: ${{ env.TEST_AZURE_CONTAINER_REGISTRY }}"; | ||
echo "TEST_RESOURCE_GROUP: ${{ env.TEST_RESOURCE_GROUP }}"; | ||
echo "TEST_CLUSTER_NAME: ${{ env.TEST_CLUSTER_NAME }}"; | ||
echo "TEST_DEPLOYMENT_MANIFEST_PATH: ${{ env.TEST_DEPLOYMENT_MANIFEST_PATH }}" | ||
# Checks out the repository this file is in | ||
- uses: actions/checkout@v3 | ||
|
||
# Logs in with your Azure credentials | ||
- name: Azure login | ||
uses: azure/login@v1 | ||
with: | ||
client-id: ${{ secrets.TEST_AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.TEST_AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.TEST_AZURE_SUBSCRIPTION_ID }} | ||
# Pulling an image from Docker Hub to ACR. In a common CD scenario, | ||
# the build and push of developed code would be part of a controlled workflow. | ||
# The intention here is to show how environment variables and secrets work. | ||
# So we will simplify the process. | ||
- name: Pull a sample image from Docker hub to ACR | ||
run: | | ||
az acr import --name ${{ env.TEST_AZURE_CONTAINER_REGISTRY }} --source docker.io/library/nginx:latest --image nginx:latest -g ${{ env.TEST_RESOURCE_GROUP }} | ||
continue-on-error: true | ||
# Builds and pushes an image up to your Azure Container Registry | ||
- name: Build and push image to ACR | ||
run: | | ||
echo "You could build and push an image to ACR here by using the following commented commands" | ||
### az acr build --image "${{env.TEST_AZURE_CONTAINER_REGISTRY}}.azurecr.io/<your-repo-name>:${{ github.sha }}" -r "${{ env.TEST_AZURE_CONTAINER_REGISTRY }}" -g ${{ env.TEST_RESOURCE_GROUP }} . | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
# Use kubelogin to configure your kubeconfig for Azure auth | ||
- name: Set up kubelogin for non-interactive login | ||
uses: azure/use-kubelogin@v1 | ||
with: | ||
kubelogin-version: 'v0.0.25' | ||
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file | ||
- name: Get K8s context | ||
uses: azure/aks-set-context@v3 | ||
with: | ||
resource-group: ${{ env.TEST_RESOURCE_GROUP }} | ||
cluster-name: ${{ env.TEST_CLUSTER_NAME }} | ||
admin: 'true' | ||
use-kubelogin: 'true' | ||
# Deploys application based on given manifest file | ||
- name: Deploys application | ||
uses: Azure/k8s-deploy@v4 | ||
with: | ||
action: deploy | ||
manifests: ${{ env.TEST_DEPLOYMENT_MANIFEST_PATH }} | ||
images: | | ||
${{ env.TEST_AZURE_CONTAINER_REGISTRY }}.azurecr.io/nginx:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- package-ecosystem: "maven" # See documentation for possible values | ||
directory: "/tools/deploy/module3" # Location of package manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "gha-oidc", | ||
"issuer": "https://token.actions.githubusercontent.com", | ||
"subject": "repo:<your-github-username>/AKS-DevSecOps-Workshop:ref:refs/heads/main", | ||
"subject": "repo:vinod-soni-microsoft/AKS-DevSecOps-Workshop:ref:refs/heads/main", | ||
"audiences": ["api://AzureADTokenExchange"], | ||
"description": "Workload Identity for AKS DevSecOps repo - branch mod 4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "gha-mod4-oidc", | ||
"issuer": "https://token.actions.githubusercontent.com", | ||
"subject": "repo:msmarti/AKS-DevSecOps-Workshop:environment:test", | ||
"subject": "repo:vinod-soni-microsoft/AKS-DevSecOps-Workshop:environment:test", | ||
"audiences": ["api://AzureADTokenExchange"], | ||
"description": "Workload Identity for AKS DevSecOps repo - Mod 4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
some comments | ||
some comments | ||
some comments |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok