Skip to content

Commit

Permalink
Merge pull request #60 from Omegapoint/add-pt-and-tm
Browse files Browse the repository at this point in the history
Add pt and tm to cydig config
  • Loading branch information
linnea-oxenwaldt authored Feb 9, 2024
2 parents 0935977 + 3b66bcd commit 5be765f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
repository: Omegapoint/cydig-compliance-action
path: compliance-action

- name: Setup node
uses: actions/setup-node@v3

Expand All @@ -35,11 +36,11 @@ jobs:
npm ci
- name: Install compliance action dependencies
run: |
cd compliance-action
cd compliance-action
npm ci
- name: Install azure compliance action dependencies
run: |
cd azure-compliance-action
cd azure-compliance-action
npm ci
- name: Run upload tests
Expand All @@ -57,7 +58,7 @@ jobs:
- name: Build Upload action
run: |
cd upload-action
cd upload-action
npm run build
- name: Build azure compliance action
run: |
Expand All @@ -84,13 +85,14 @@ jobs:
with:
cydigConfigPath: ${{ github.workspace }}/compliance-action/src/cydigConfig.json
PAT-token: ${{ secrets.MY_GITHUB_PAT }}
accessTokenAzureDevOps: ${{ secrets.DEVOPS_TOKEN_WORK_ITEMS }}

- name: Set dev func URL
run: |
echo "urlUpdate=${{ secrets.URL_UPLOAD_DEV }}" >> $GITHUB_ENV
echo "updateKey=${{ secrets.CYDIG_API_KEY_DEV }}" >> $GITHUB_ENV
echo "urlDashboard=${{ secrets.URL_DASHBOARD_DEV }}" >> $GITHUB_ENV
echo "urlBadgeService=${{ vars.URL_BADGE_SERVICE_DEV }}" >> $GITHUB_ENV
echo "urlUpdate=${{ secrets.URL_UPLOAD_DEV }}" >> $GITHUB_ENV
echo "updateKey=${{ secrets.CYDIG_API_KEY_DEV }}" >> $GITHUB_ENV
echo "urlDashboard=${{ secrets.URL_DASHBOARD_DEV }}" >> $GITHUB_ENV
echo "urlBadgeService=${{ vars.URL_BADGE_SERVICE_DEV }}" >> $GITHUB_ENV
echo "accessKeyBadgeService=${{ vars.ACCESS_KEY_BADGES_DEV }}" >> $GITHUB_ENV
- name: "Run Upload Action"
Expand Down
30 changes: 17 additions & 13 deletions src/cydigConfig.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
{
"teamName": "Test-GitHub",
"usingAzure": false,
"usingAzure": true,
"threatModeling": {
"date": "not specified",
"date": "2023-09-07",
"boardsTag": "TM"
},
"pentest": {
"date": "not specified",
"date": "2023-09-07",
"boardsTag": "PT"
},
"github": {
"usingRepos": true
},
"azureDevOps": {
"usingRepos": false,
"repos": {
"username": "johanna.ahlskog"
"username": "firstname.lastname (usually)"
},
"usingBoards": false,
"usingBoards": true,
"boards": {
"nameOfBoard": "not specified"
}
},
"organizationName": "CyDig",
"projectName": "CyDig"
},
"scaTool": {
"nameOfTool": "not specified",
"nameOfTool": "name-of-tool",
"owaspDependencyCheck": {
"reportPath": "not specified",
"reportPath": "Reports/dependency-check-report.csv",
"csvPath": "not specified"
}
},
"sastTool": {
"nameOfTool": "not specified",
"nameOfTool": "name-of-tool",
"semgrep": {
"reportPath": "not specified"
"reportPath": "semgrep-json.json"
}
},
"codeQualityTool": {
"nameOfTool": "not specified"
"nameOfTool": "name-of-tool"
},
"reposToExclude": {
"nameOfRepos": "not specified"
"nameOfRepos": "not-specified"
}
}

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function runUpdateComplianceStateTask(): Promise<void> {
try {
const codeRepositoryName: string = github.context.repo.repo;
const subscriptionId: string = core.getInput('subscriptionId');
const cydigConfigPath: string = core.getInput('cydigConfigPath'); //Need both string??
const cydigConfigPath: string = core.getInput('cydigConfigPath');
const cydigConfig: CyDigConfig = getContentOfFile(cydigConfigPath);
const teamName: string = cydigConfig.teamName;

Expand Down
11 changes: 8 additions & 3 deletions src/lib/JsonService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@ export function validateConfig(config: unknown): void {
}),
github: Joi.object({
usingRepos: Joi.boolean(),
}),
azureDevOps: {
usingRepos: Joi.boolean(),
repos: Joi.object({
username: Joi.string(),
}),
usingBoards: Joi.boolean(),
boards: Joi.object({
nameOfBoard: Joi.string(),
}),
}),
organizationName: Joi.string(),
projectName: Joi.string(),
},
scaTool: Joi.object({
nameOfTool: Joi.string(),
owaspDependencyCheck: Joi.object({
reportPath: Joi.string(),
csvPath: Joi.string(),
csvPath: Joi.string().optional(),
}),
}),
sastTool: Joi.object({
Expand All @@ -55,7 +60,7 @@ export function validateConfig(config: unknown): void {
nameOfTool: Joi.string(),
}),
reposToExclude: Joi.object({
nameOfRepos: Joi.string(),
nameOfRepos: Joi.string().optional(),
}),
});

Expand Down

0 comments on commit 5be765f

Please sign in to comment.