Skip to content
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

FINOS Security Scanning #808

Merged
merged 31 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b72c423
Adding Security Scanning
robmoffat Aug 17, 2022
9779ac8
Added semgrep
robmoffat Aug 17, 2022
67bf94b
Added semgrepignore
robmoffat Aug 17, 2022
ecd1b72
Updated cve scanning for tsx issue
robmoffat Aug 17, 2022
f30b075
using wildcards
robmoffat Aug 17, 2022
445ee59
Re-adding FDC3 Explained
robmoffat Aug 17, 2022
de72c23
Update cve-scanning.yml
robmoffat Sep 6, 2022
6c0e26b
making it work if some tests fail
robmoffat Sep 6, 2022
0273942
Merge remote-tracking branch 'fdc3/master' into merge-master
robmoffat Sep 16, 2022
ea2a29a
Merge pull request #1 from robmoffat/merge-master
robmoffat Sep 16, 2022
ebf6481
Add files via upload
openfin-johans Feb 10, 2023
2f59902
Add files via upload
openfin-johans Feb 10, 2023
62acc4b
Add files via upload
openfin-johans Feb 10, 2023
8175aa9
Merge branch 'finos:master' into master
robmoffat Feb 10, 2023
6a8a1a4
Merge pull request #2 from robmoffat/explained-semgrep-fix
robmoffat Feb 10, 2023
749c443
Add files via upload
openfin-johans Feb 10, 2023
34d2360
Add files via upload
openfin-johans Feb 10, 2023
8eafb3d
Add files via upload
openfin-johans Feb 10, 2023
3b87609
Add files via upload
openfin-johans Feb 10, 2023
0c79d42
Merge pull request #3 from robmoffat/explained-version-selector-fix
robmoffat Feb 10, 2023
8cc9b67
Merge pull request #4 from finos/docusaurus-upgrade
robmoffat Feb 22, 2023
cb05342
Merge pull request #6 from finos/docusaurus-upgrade
robmoffat Feb 28, 2023
8b5db3a
Merge pull request #7 from finos/docusaurus-upgrade
robmoffat Feb 28, 2023
213db94
Merge pull request #9 from finos/docusaurus-upgrade
robmoffat Mar 2, 2023
cb50728
Merge pull request #10 from finos/docusaurus-upgrade
robmoffat Mar 2, 2023
cb6e52f
Merge branch 'finos:master' into master
robmoffat Mar 9, 2023
20deedb
Merge branch 'finos:master' into master
robmoffat Apr 24, 2023
eec661d
Fixing semgrep issue
robmoffat Apr 25, 2023
6e5095d
Moved all deps into dev
robmoffat Apr 25, 2023
8ecdac1
Moved dependencies to dev
robmoffat Apr 25, 2023
5d57491
Update .github/workflows/cve-scanning.yml
robmoffat Apr 26, 2023
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
50 changes: 50 additions & 0 deletions .github/workflows/cve-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Node.js CVE Scanning

on:
pull_request:
paths:
- 'package.json'
- 'toolbox/fdc3-workbench/package.json'
- '.github/workflows/cve-scanning.yml'
- 'website/package.json'
push:
paths:
- 'package.json'
- 'toolbox/fdc3-workbench/package.json'
- '.github/workflows/cve-scanning.yml'
- 'website/package.json'
schedule:
# Run every day at 5am and 5pm
- cron: '0 5,17 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: npm install

- run: npm install
working-directory: toolbox/fdc3-workbench

- run: npm install
working-directory: website

- run: npx --yes auditjs ossi --whitelist allow-list.json
if: success() || failure()

- run: npx --yes auditjs ossi --whitelist ../../allow-list.json
working-directory: toolbox/fdc3-workbench
if: success() || failure()

- run: npx --yes auditjs ossi --whitelist ../allow-list.json
working-directory: website
if: success() || failure()
15 changes: 15 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Static code analysis

on: [push, pull_request]

jobs:
semgrep:
name: run-semgrep
runs-on: ubuntu-20.04
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep scan --error --config auto
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
4 changes: 4 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
website/**

# Just used for build so ignoring
quicktypeUtil.js
11 changes: 0 additions & 11 deletions toolbox/fdc3-explained/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@
<td><span id="providerDetails">FDC3 Not Available</span></td>
</tr>

<tr>
<td class="header">FDC3 Version:</td>
<td>
<select id="versions" onchange="window.location.href=`../${this.value}`">
<option value="1.0" selected>1.0</option>
<option value="1.1">1.1</option>
<option value="1.2">1.2</option>
</select>
</td>
</tr>

<tr>
<td colspan="3"><hr/></td>
</tr>
Expand Down
11 changes: 8 additions & 3 deletions toolbox/fdc3-explained/1.0/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,23 @@ const broadcastText = document.getElementById("broadcastText")
function enablePage() {
console.log('FDC3 is available');

// NOTE: conceptually replaced with fdc3.getInfo
if (window.FSBL) {
window.FSBL.getFSBLInfo().then(info => providerDetails.innerHTML = 'Available - Finsemble ' + info.FSBLVersion);
window.FSBL.getFSBLInfo().then(info => updateProviderDetails('Available - Finsemble ' + info.FSBLVersion));
} else if (window.fin) {
providerDetails.innerHTML = 'Available - OpenFin ' + fin.desktop.getVersion();
updateProviderDetails('Available - OpenFin ' + fin.desktop.getVersion());
} else {
providerDetails.innerHTML = 'Available - Unknown';
updateProviderDetails('Available - Unknown');
}

broadcastButton.disabled = false;
broadcastText.disabled = false;
}

function updateProviderDetails(details){
providerDetails.innerText = details;
}

function broadcastFDC3Context() {
var context = JSON.parse(broadcastText.value);
fdc3.broadcast(context);
Expand Down
11 changes: 0 additions & 11 deletions toolbox/fdc3-explained/1.1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@
<td><span id="providerDetails">None</span></td>
</tr>

<tr>
<td class="header">FDC3 Version:</td>
<td>
<select id="versions" onchange="window.location.href=`../${this.value}`">
<option value="1.0">1.0</option>
<option value="1.1" selected>1.1</option>
<option value="1.2">1.2</option>
</select>
</td>
</tr>

<tr>
<td colspan="3"><hr/></td>
</tr>
Expand Down
15 changes: 10 additions & 5 deletions toolbox/fdc3-explained/1.1/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,23 @@ function displayFDC3Support() {
}

function getPlatform() {
const providerDetails = document.getElementById('providerDetails');


// TODO: add G42 and FDC3 Desktop Agent to vendors
// NOTE: conceptually replaced with fdc3.getInfo
if (window.FSBL) {
window.FSBL.getFSBLInfo().then(info => (providerDetails.innerHTML = 'Finsemble ' + info.FSBLVersion));
window.FSBL.getFSBLInfo().then(info => updateProviderDetails('Available - Finsemble ' + info.FSBLVersion));
} else if (window.fin) {
providerDetails.innerHTML = 'OpenFin ' + fin.desktop.getVersion();
updateProviderDetails('Available - OpenFin ' + fin.desktop.getVersion());
} else {
providerDetails.innerHTML = 'Unknown';
updateProviderDetails('Available - Unknown');
}
}

function updateProviderDetails(details){
const providerDetails = document.getElementById('providerDetails');
providerDetails.innerText = details;
}

async function populateHTML() {
try {
//populate available channels list with system channels
Expand Down
12 changes: 3 additions & 9 deletions toolbox/fdc3-explained/1.2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@

<tr>
<td class="header">FDC3 Version:</td>
<td>
<select id="versions" onchange="window.location.href=`../${this.value}`">
<option value="1.0">1.0</option>
<option value="1.1">1.1</option>
<option value="1.2" selected>1.2</option>
</select>
</td>
<td><span id="fdc3Details">None</span></td>
</tr>

<tr>
Expand Down Expand Up @@ -115,8 +109,8 @@

<tr>
<td>
<div id="context-result">
<i>Context result will appear here.</i>
<div>
<pre id="context-result"><i>Context result will appear here.</i></pre>
</div>
</td>
</tr>
Expand Down
25 changes: 20 additions & 5 deletions toolbox/fdc3-explained/1.2/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ function displayFDC3Support() {
}

function getPlatform() {
const providerDetails = document.getElementById('providerDetails');
const fdc3Info = window.fdc3.getInfo();
console.log('FDC3 info', fdc3Info);

providerDetails.innerHTML = `${fdc3Info.provider} ${fdc3Info.providerVersion}`;
//providerDetails.innerHTML = `${fdc3Info.provider} ${fdc3Info.providerVersion}`;
updateProviderDetails(`${fdc3Info.provider} ${fdc3Info.providerVersion}`);
updateFDC3Version(`${fdc3Info.fdc3Version}`);
}

function updateProviderDetails(details){
const providerDetails = document.getElementById('providerDetails');
providerDetails.innerText = details;
}

function updateFDC3Version(details){
const fdc3Details = document.getElementById('fdc3Details');
fdc3Details.innerText = details;
}

async function populateHTML() {
Expand Down Expand Up @@ -147,25 +158,29 @@ async function broadcastFDC3Context() {

async function getContext(contextType) {
try {
let contextResultBox = document.getElementById('context-result');
if (contextListener) contextListener.unsubscribe();

// if context type is passed in then only listen on that specific context
if (contextType) {
contextListener = fdc3.addContextListener(
contextType,
context => (contextResultBox.innerHTML = "<pre>" + JSON.stringify(context, null, 2)) + "</pre>"
context => displayContext(JSON.stringify(context, null, 2))
);
} else {
contextListener = fdc3.addContextListener(
context => (contextResultBox.innerHTML= "<pre>" + JSON.stringify(context, null, 2)) + "</pre>"
context => displayContext(JSON.stringify(context, null, 2))
);
}
} catch (error) {
console.error('Unable to add a context listener', error);
}
}

function displayContext(text){
let contextResultBox = document.getElementById('context-result');
contextResultBox.innerText = text;
}

async function addAppChannel() {
try {
let appChannelName = document.getElementById('app-channel').value;
Expand Down
18 changes: 11 additions & 7 deletions toolbox/fdc3-explained/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
color: white;
}

a {
color: white;
text-decoration: none;
}

.main {
margin: 10px 0;
padding: 0;
Expand All @@ -26,7 +31,6 @@
width: 25%;
padding: 5px;
text-align: center;
cursor: pointer;
font-weight: 700;
}

Expand Down Expand Up @@ -66,14 +70,14 @@
</td>
</tr>
<tr>
<td class="linkbox acceptable" onClick="window.location.href='1.0/';">
1.0
<td class="linkbox acceptable">
<a href="1.0/"">1.0</a>
</td>
<td class="linkbox acceptable" onClick="window.location.href='1.1/';">
1.1
<td class="linkbox acceptable">
<a href="1.1/"">1.1</a>
</td>
<td class="linkbox optimal" onClick="window.location.href='1.2/';">
1.2
<td class="linkbox optimal">
<a href="1.2/"">1.2</a>
</td>
</tr>
</table>
Expand Down
45 changes: 23 additions & 22 deletions toolbox/fdc3-workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@
"private": true,
"homepage": ".",
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@finos/fdc3": "^1.2.0",
"@fontsource/roboto": "^4.4.5",
"@fontsource/source-code-pro": "^4.5.0",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.59",
"@types/node": "^14.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/uuid": "^8.3.4",
"jsoneditor": "^9.5.6",
"mobx": "^6.3.2",
"mobx-react": "^7.2.0",
"nanoid": "^3.1.31",
"normalize.css": "^8.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.1.2",
"uuid": "^9.0.0",
"web-vitals": "^1.0.1"

},
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -65,7 +45,28 @@
"prettier": "^2.3.1",
"pretty-quick": "^3.1.0",
"terser": "^5.16.1",
"vite": "^4.0.4"
"vite": "^4.0.4",
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@finos/fdc3": "^1.2.0",
"@fontsource/roboto": "^4.4.5",
"@fontsource/source-code-pro": "^4.5.0",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.59",
"@types/node": "^14.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/uuid": "^8.3.4",
"jsoneditor": "^9.5.6",
"mobx": "^6.3.2",
"mobx-react": "^7.2.0",
"nanoid": "^3.1.31",
"normalize.css": "^8.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.1.2",
"uuid": "^9.0.0",
"web-vitals": "^1.0.1"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
Expand Down
14 changes: 6 additions & 8 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
"docusaurus-delete-version": "0.1.1",
"replace-in-files-cli": "2.0.0",
"replace-json-property": "1.8.0",
"rimraf": "5.0.0"
"rimraf": "5.0.0",
"@docusaurus/core": "^2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"clsx": "^1.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"resolutions": {
"got": "^11.8.5",
Expand All @@ -37,12 +42,5 @@
"overrides": {
"got": "^11.8.5",
"trim": "1.0.1"
},
"dependencies": {
"@docusaurus/core": "^2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"clsx": "^1.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}