This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from JupiterOne/add-questions-to-graph
INT-3469 Add Questions, Workflows, Misc QoL updates #166
- Loading branch information
Showing
8 changed files
with
141 additions
and
12 deletions.
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,45 @@ | ||
name: 'CodeQL' | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
# NOTE: This is the template default. | ||
# "At 04:41 on Tuesday." | ||
- cron: '41 4 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- id: setup-node | ||
name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Run build | ||
run: yarn build | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
# `javascript` tests both JavaScript code and TypeScript code | ||
languages: 'javascript' | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
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,40 @@ | ||
name: Questions | ||
on: [pull_request_target] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- id: setup-node | ||
name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Check out `main` branch | ||
uses: actions/checkout@v2 | ||
with: | ||
path: source | ||
|
||
- name: Check out target branch questions | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
path: target | ||
|
||
- name: Install dependencies for `main` branch | ||
run: yarn install --cwd source | ||
|
||
- name: Validate questions on target branch | ||
env: | ||
MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID: | ||
${{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }} | ||
MANAGED_QUESTIONS_JUPITERONE_API_KEY: | ||
${{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }} | ||
run: | ||
yarn --cwd source j1-integration validate-question-file -a | ||
$MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID -k | ||
$MANAGED_QUESTIONS_JUPITERONE_API_KEY -p | ||
../target/jupiterone/questions/questions.yaml |
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,9 +1,9 @@ | ||
node_modules/ | ||
dist/ | ||
.j1-integration/ | ||
.j1-integration-cache/ | ||
.env | ||
dist/ | ||
|
||
.eslintcache | ||
tsconfig.tsbuildinfo | ||
coverage/ | ||
yarn-error.log | ||
tsconfig.tsbuildinfo |
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,3 +1,5 @@ | ||
dist | ||
coverage/ | ||
.j1-integration | ||
coverage | ||
.j1-integration-cache | ||
.gitleaks.yml |
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
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,32 @@ | ||
--- | ||
sourceId: managed:slack | ||
integrationDefinitionId: "${integration_definition_id}" | ||
questions: | ||
- id: managed-question-workflow-slack-channel-users | ||
title: How many users are in each of my Slack channels? | ||
description: Returns a list of slack channels and the number of users they have. | ||
queries: | ||
- query: | | ||
FIND slack_channel AS c | ||
THAT HAS slack_user AS u | ||
RETURN | ||
c.name AS Channel, | ||
COUNT(u) AS UsersCount | ||
ORDER BY UsersCount DESC | ||
tags: | ||
- slack | ||
- user | ||
- workflow | ||
- id: managed-question-workflow-slack-external-users | ||
title: Who are the external users within Slack? | ||
description: Returns a list of external Slack users and the corporate channels they're in. | ||
queries: | ||
- query: | | ||
FIND slack_channel AS c | ||
THAT HAS slack_user WITH email !~= "{{@yourEmailDomain.com}}" AS u | ||
RETURN | ||
c.name AS Channel, | ||
u.email AS User | ||
tags: | ||
- slack | ||
- user |
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
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