Skip to content

Commit 6a26466

Browse files
authored
Merge pull request #4 from pandasauce/main
Fix Linux builds && Node version && add Windows support
2 parents ae867f0 + 762f2c2 commit 6a26466

10 files changed

Lines changed: 69 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ jobs:
2929
fi
3030
- uses: actions/setup-node@v3
3131
with:
32-
node-version: '16'
32+
node-version: '20'
3333
- run: |
34+
sudo apt update && sudo apt install p7zip-full nsis
3435
CLI_VERSION=${{ steps.set-version.outputs.version }} node cli/.ci/set-package-vars.js
3536
CI_CD_BUILD=1 cli/.ci/package.sh
3637
- name: Archive artifacts
3738
uses: actions/upload-artifact@v3
3839
with:
3940
name: Linux
4041
path: |
41-
cli/dist/deb
42+
cli/tmp/artifacts
4243
4344
build-on-macos:
4445
name: Build, sign and notarize .pkg files for Mac
@@ -58,7 +59,7 @@ jobs:
5859
fi
5960
- uses: actions/setup-node@v3
6061
with:
61-
node-version: '16'
62+
node-version: '20'
6263
- name: Install the Apple certificate and provisioning profile
6364
env:
6465
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:22.04
2+
3+
RUN DEBIAN_FRONTEND=noninteractive apt update && \
4+
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
5+
apt-utils build-essential ca-certificates curl git p7zip-full p7zip nsis sudo
6+
7+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
8+
export NVM_DIR="$HOME/.nvm" && \
9+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
10+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
11+
nvm install 20 && \
12+
npm install -g yarn
13+
RUN git config --global --add safe.directory /build

cli/.ci/package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ copy_lib sarif
5151
if [[ "$OS" == 'Darwin' ]]; then
5252
yarn package-macos
5353
else
54+
mkdir -p tmp/artifacts
5455
yarn package-deb
56+
cp dist/deb/* tmp/artifacts/
57+
yarn package-win
58+
cp dist/win32/* tmp/artifacts/
5559
fi
5660

5761
if [ -n "${LINKED}" ]; then

cli/README.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $ npm install -g @nowsecure/platform-cli
2222
$ ns-cli COMMAND
2323
running command...
2424
$ ns-cli (--version)
25-
@nowsecure/platform-cli/1.0.0 darwin-x64 node-v16.19.1
25+
@nowsecure/platform-cli/1.1.0 linux-x64 node-v20.16.0
2626
$ ns-cli --help [COMMAND]
2727
USAGE
2828
$ ns-cli COMMAND
@@ -86,7 +86,7 @@ DESCRIPTION
8686
Commands to manipulate applications for analysis
8787
```
8888

89-
_See code: [dist/commands/app/index.ts](https://github.com/cosdon/nowsecure-cli/blob/v1.0.0/dist/commands/app/index.ts)_
89+
_See code: [dist/commands/app/index.ts](https://github.com/nowsecure/nowsecure-cli/blob/v1.1.0/dist/commands/app/index.ts)_
9090

9191
## `ns-cli app archive [PLATFORM] [PACKAGENAME]`
9292

@@ -340,9 +340,9 @@ ARGUMENTS
340340
341341
FLAGS
342342
-g, --group=<value> Group name
343-
-t, --analysis-type=<option> The type of analysis to perform
343+
-t, --analysis-type=<option> The type of analysis to perform.
344344
<options: full|static|dependencies>
345-
-v, --set-version=<value> Set the version of the uploaded binary
345+
-v, --set-version=<value> Set the version of the uploaded binary.
346346
--group-ref=<value> Group reference
347347
348348
GLOBAL FLAGS
@@ -354,11 +354,33 @@ GLOBAL FLAGS
354354
--token=<value> Platform API token
355355
--ui=<value> URL of the UI server
356356
357-
DESCRIPTION
358-
Upload and analyze an application binary
359-
360357
EXAMPLES
361358
$ ns-cli app process my_application.apk
359+
360+
FLAG DESCRIPTIONS
361+
-t, --analysis-type=full|static|dependencies The type of analysis to perform.
362+
363+
"static": Perform a static analysis only.
364+
"dependencies": Analyze the application's library dependencies.
365+
"full": Run a complete assessment including dynamic analysis.
366+
367+
If the flag is not specified a full analysis will be run.
368+
369+
Static-only and dependency-only analyses do not attempt to decrypt encrypted binaries as
370+
these analyses are intended to provide a rapid result for e.g. a CI/CD pipeline. An encrypted
371+
binary will fail to analyze.
372+
373+
Please note:
374+
The assessment status on NowSecure Platform UI does not reflect successful completion of
375+
static-only or dependencies-only analysis. The labels in the UI will be "Partial Results"
376+
and "Failed Dynamic Analysis" due to the lack of a dynamic analysis.
377+
378+
-v, --set-version=<value> Set the version of the uploaded binary.
379+
380+
Attached a custom version string to the uploaded build,
381+
overriding the version string contained in the package file.
382+
383+
The custom string will be displayed in the "Version" column of the application list in Platform.
362384
```
363385

364386
## `ns-cli app update [PLATFORM] [PACKAGENAME] [STDIN]`
@@ -483,7 +505,7 @@ DESCRIPTION
483505
Commands to retrieve assessment data
484506
```
485507

486-
_See code: [dist/commands/assessment/index.ts](https://github.com/cosdon/nowsecure-cli/blob/v1.0.0/dist/commands/assessment/index.ts)_
508+
_See code: [dist/commands/assessment/index.ts](https://github.com/nowsecure/nowsecure-cli/blob/v1.1.0/dist/commands/assessment/index.ts)_
487509

488510
## `ns-cli assessment cancel ASSESSMENT`
489511

@@ -813,7 +835,7 @@ FLAGS
813835
--ui=<value> URL of the UI server
814836
```
815837

816-
_See code: [dist/commands/configure/index.ts](https://github.com/cosdon/nowsecure-cli/blob/v1.0.0/dist/commands/configure/index.ts)_
838+
_See code: [dist/commands/configure/index.ts](https://github.com/nowsecure/nowsecure-cli/blob/v1.1.0/dist/commands/configure/index.ts)_
817839

818840
## `ns-cli help [COMMANDS]`
819841

@@ -847,7 +869,7 @@ DESCRIPTION
847869
Commands for the user's organization
848870
```
849871

850-
_See code: [dist/commands/organization/index.ts](https://github.com/cosdon/nowsecure-cli/blob/v1.0.0/dist/commands/organization/index.ts)_
872+
_See code: [dist/commands/organization/index.ts](https://github.com/nowsecure/nowsecure-cli/blob/v1.1.0/dist/commands/organization/index.ts)_
851873

852874
## `ns-cli organization groups`
853875

@@ -1244,7 +1266,7 @@ DESCRIPTION
12441266
Commands for users & accounts
12451267
```
12461268

1247-
_See code: [dist/commands/user/index.ts](https://github.com/cosdon/nowsecure-cli/blob/v1.0.0/dist/commands/user/index.ts)_
1269+
_See code: [dist/commands/user/index.ts](https://github.com/nowsecure/nowsecure-cli/blob/v1.1.0/dist/commands/user/index.ts)_
12481270

12491271
## `ns-cli user account`
12501272

cli/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"bin": {
77
"ns-cli": "./bin/run"
88
},
9-
"homepage": "https://github.com/cosdon/nowsecure-cli",
9+
"homepage": "https://github.com/nowsecure/nowsecure-cli",
1010
"license": "MIT",
1111
"main": "dist/index.js",
12-
"repository": "cosdon/nowsecure-cli",
12+
"repository": "nowsecure/nowsecure-cli",
1313
"files": [
1414
"/bin",
1515
"/dist",
@@ -91,17 +91,18 @@
9191
"prepack": "yarn build && oclif manifest && oclif readme",
9292
"package-macos": "oclif pack macos",
9393
"package-deb": "oclif pack deb",
94+
"package-win": "oclif pack win",
9495
"make-package": ".ci/package.sh",
9596
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
9697
"version": "oclif readme && git add README.md",
9798
"link-deps": "yarn link @nowsecure/platform-lib @nowsecure/sarif @nowsecure/github-snapshot"
9899
},
99100
"engines": {
100-
"node": ">=16.0.0"
101+
"node": ">=20.0.0"
101102
},
102-
"bugs": "https://github.com/cosdon/nowsecure-cli/issues",
103+
"bugs": "https://github.com/nowsecure/nowsecure-cli/issues",
103104
"keywords": [
104105
"oclif"
105106
],
106107
"types": "dist/index.d.ts"
107-
}
108+
}

cli/src/commands/configure/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { checkJWT, CliConfigFile, ConfigInput } from "../../utils";
66
import inquirer, { DistinctQuestion } from "inquirer";
77

88
function configPath(input: string | undefined) {
9-
input = (input || "").trim() || "~/.nsclirc";
9+
input = (input || "").trim() || path.join(os.homedir(), ".nsclirc");
1010
if (input === "~") {
1111
return os.homedir();
1212
}
1313
if (input.startsWith("~" + path.sep)) {
14-
return os.homedir + input.substring(1);
14+
return path.join(os.homedir(), input.substring(2));
1515
}
1616
return input;
1717
}

github-snapshot/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "jest"
1616
},
1717
"engines": {
18-
"node": ">=16"
18+
"node": ">=20"
1919
},
2020
"files": [
2121
"/lib"
@@ -39,4 +39,4 @@
3939
"dependencies": {
4040
"@nowsecure/platform-lib": "file:../lib"
4141
}
42-
}
42+
}

lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"makedocs": "docs/makedocs.sh"
2020
},
2121
"engines": {
22-
"node": ">=16"
22+
"node": ">=20"
2323
},
2424
"files": [
2525
"/lib"
@@ -57,4 +57,4 @@
5757
"graphql-tag": "^2.12.6",
5858
"lodash": "4.17.21"
5959
}
60-
}
60+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"make-package": "yarn run deps:dev && yarn run link && yarn run clean && yarn --cwd cli run link-deps && yarn --cwd cli run make-package"
3232
},
3333
"engines": {
34-
"node": ">=16"
34+
"node": ">=20"
3535
}
3636
}

sarif/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "jest"
1616
},
1717
"engines": {
18-
"node": ">=16"
18+
"node": ">=20"
1919
},
2020
"files": [
2121
"/lib"
@@ -39,4 +39,4 @@
3939
"@nowsecure/platform-lib": "file:../lib",
4040
"ripgrep-js": "3.0.0"
4141
}
42-
}
42+
}

0 commit comments

Comments
 (0)