Compare commits
1 Commits
v2.0.0
...
snyk-fix-6
Author | SHA1 | Date | |
---|---|---|---|
|
08c5bc9d84 |
4
.github/workflows/build_all.yml
vendored
4
.github/workflows/build_all.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Create Build Dir
|
- name: Create Build Dir
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
- name: Clone
|
- name: Clone
|
||||||
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
- name: Build VCPKG
|
- name: Build VCPKG
|
||||||
run: cd vcpkg && bootstrap-vcpkg.bat
|
run: cd vcpkg && bootstrap-vcpkg.bat
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
- name: Create Build Dir
|
- name: Create Build Dir
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
- name: Clone
|
- name: Clone
|
||||||
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
- name: Build VCPKG
|
- name: Build VCPKG
|
||||||
run: cd vcpkg && ./bootstrap-vcpkg.sh
|
run: cd vcpkg && ./bootstrap-vcpkg.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
|
20
.github/workflows/changelog.yml
vendored
20
.github/workflows/changelog.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Changelog Generator
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- run: docker run -v $PWD:/workdir quay.io/git-chglog/git-chglog --next-tag vNext --output CHANGELOG-new.md vNext..
|
|
||||||
- name: GitHub Upload Release Artifacts
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: CHANGELOG-new.md
|
|
||||||
path: |
|
|
||||||
./CHANGELOG-new.md
|
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Create Build Dir
|
- name: Create Build Dir
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
- name: Clone
|
- name: Clone
|
||||||
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
- name: Build VCPKG
|
- name: Build VCPKG
|
||||||
run: cd vcpkg && bootstrap-vcpkg.bat
|
run: cd vcpkg && bootstrap-vcpkg.bat
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Create Build Dir
|
- name: Create Build Dir
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
- name: Clone
|
- name: Clone
|
||||||
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
- name: Build VCPKG
|
- name: Build VCPKG
|
||||||
run: cd vcpkg && ./bootstrap-vcpkg.sh
|
run: cd vcpkg && ./bootstrap-vcpkg.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
|
6
Build.md
6
Build.md
@@ -25,9 +25,8 @@ sudo apt install git cmake build-essential curl zip unzip tar pkg-config
|
|||||||
Open a Terminal window.
|
Open a Terminal window.
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
./bootstrap-vcpkg.sh
|
./bootstrap-vcpkg.sh
|
||||||
./vcpkg install cpprestsdk[websockets]
|
./vcpkg install cpprestsdk[websockets]
|
||||||
```
|
```
|
||||||
@@ -69,9 +68,8 @@ Steps below are for Windows 10 and Visual Studio 2019 Professional.
|
|||||||
Open an x64 Native Tools Command Prompt for Visual Studio 2019.
|
Open an x64 Native Tools Command Prompt for Visual Studio 2019.
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
bootstrap-vcpkg.bat
|
bootstrap-vcpkg.bat
|
||||||
vcpkg install cpprestsdk[websockets]:x64-windows-static
|
vcpkg install cpprestsdk[websockets]:x64-windows-static
|
||||||
```
|
```
|
||||||
|
42
CHANGELOG.md
42
CHANGELOG.md
@@ -1,45 +1,3 @@
|
|||||||
<a name="v2.0.0"></a>
|
|
||||||
## v2.0.0
|
|
||||||
|
|
||||||
### Build
|
|
||||||
- bump version to v1.3.0
|
|
||||||
- bump version to v2.0.0
|
|
||||||
|
|
||||||
### Ci
|
|
||||||
- update scanning
|
|
||||||
|
|
||||||
### Docs
|
|
||||||
- **readme:** wording
|
|
||||||
- **readme:** update readme
|
|
||||||
- **security:** added SECURITY.md file
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
- update to OpenSSL 1.1.1l
|
|
||||||
- update workflows and Docker build.
|
|
||||||
- Update to latest vcpkg
|
|
||||||
- Update docs and scripts for Windows and Ubuntu.
|
|
||||||
- format json status messages
|
|
||||||
- add AMT wireless adapter info to amtinfo LAN settings.
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
- klockwork reported success / failure check fix
|
|
||||||
- **spelling:** lan inteface -> lan interface in amtinfo
|
|
||||||
|
|
||||||
<a name="v1.2.2"></a>
|
|
||||||
## [v1.2.2] - 2021-06-22
|
|
||||||
### Ci
|
|
||||||
- remove Jenkins chron
|
|
||||||
- **changelog:** add automation for changelog generation
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
- update examples text and version
|
|
||||||
|
|
||||||
<a name="v1.2.1"></a>
|
|
||||||
## [v1.2.1] - 2021-05-06
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
**docker:** add missing ca-certs
|
|
||||||
|
|
||||||
<a name="v1.2.0"></a>
|
<a name="v1.2.0"></a>
|
||||||
## v1.2.0
|
## v1.2.0
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required (VERSION 3.1)
|
cmake_minimum_required (VERSION 3.1)
|
||||||
|
|
||||||
project (rpc VERSION 2.0.0)
|
project (rpc VERSION 1.2.0)
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
@@ -50,9 +50,8 @@ export PATH=/home/user/Downloads/git:$PATH
|
|||||||
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
|
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
./bootstrap-vcpkg.sh
|
./bootstrap-vcpkg.sh
|
||||||
./vcpkg install cpprestsdk[websockets]
|
./vcpkg install cpprestsdk[websockets]
|
||||||
```
|
```
|
||||||
|
@@ -28,9 +28,8 @@ sudo yum install cmake
|
|||||||
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
|
Using a Terminal window with the PATH and devtoolset enabled per the Dependencies.
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
./bootstrap-vcpkg.sh
|
./bootstrap-vcpkg.sh
|
||||||
./vcpkg install cpprestsdk[websockets]
|
./vcpkg install cpprestsdk[websockets]
|
||||||
```
|
```
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#*********************************************************************/
|
#*********************************************************************/
|
||||||
|
|
||||||
FROM ubuntu:20.04 AS rpc-builder
|
FROM ubuntu:20.10 AS rpc-builder
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
@@ -11,11 +11,11 @@ RUN \
|
|||||||
apt-get update -y -qq && \
|
apt-get update -y -qq && \
|
||||||
apt install -y -qq \
|
apt install -y -qq \
|
||||||
git cmake build-essential libssl-dev zlib1g-dev \
|
git cmake build-essential libssl-dev zlib1g-dev \
|
||||||
curl unzip zip pkg-config ca-certificates
|
curl unzip zip pkg-config
|
||||||
RUN git clone https://github.com/open-amt-cloud-toolkit/rpc.git
|
RUN git clone https://github.com/open-amt-cloud-toolkit/rpc.git
|
||||||
WORKDIR /rpc
|
WORKDIR /rpc
|
||||||
RUN mkdir -p build
|
RUN mkdir -p build
|
||||||
RUN git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
RUN git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
RUN cd vcpkg && ./bootstrap-vcpkg.sh
|
RUN cd vcpkg && ./bootstrap-vcpkg.sh
|
||||||
RUN ./vcpkg/vcpkg install cpprestsdk[websockets]
|
RUN ./vcpkg/vcpkg install cpprestsdk[websockets]
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ WORKDIR /rpc/build
|
|||||||
RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
||||||
RUN cmake --build .
|
RUN cmake --build .
|
||||||
|
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.10
|
||||||
|
|
||||||
LABEL license='SPDX-License-Identifier: Apache-2.0' \
|
LABEL license='SPDX-License-Identifier: Apache-2.0' \
|
||||||
copyright='Copyright (c) 2021: Intel'
|
copyright='Copyright (c) 2021: Intel'
|
||||||
|
164
Jenkinsfile
vendored
164
Jenkinsfile
vendored
@@ -1,14 +1,17 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent none
|
||||||
label 'docker-amt'
|
triggers {cron '@daily'}
|
||||||
}
|
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '5', daysToKeepStr: '30'))
|
buildDiscarder(logRotator(numToKeepStr: '5', daysToKeepStr: '30'))
|
||||||
timestamps()
|
timestamps()
|
||||||
timeout(unit: 'HOURS', time: 2)
|
timeout(unit: 'HOURS', time: 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage ('Parallel') {
|
||||||
|
parallel {
|
||||||
|
stage ('Linux') {
|
||||||
|
agent { label 'docker-amt' }
|
||||||
stages {
|
stages {
|
||||||
stage ('Cloning Repository') {
|
stage ('Cloning Repository') {
|
||||||
steps {
|
steps {
|
||||||
@@ -19,15 +22,41 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Static Code Scan - Protex') {
|
|
||||||
environment{
|
|
||||||
PROJECT_NAME = 'OpenAMT - RPC'
|
|
||||||
SCANNERS = 'protex'
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
stage ('Windows') {
|
||||||
|
agent { label 'openamt-win' }
|
||||||
|
stages {
|
||||||
|
stage ('Cloning Repository') {
|
||||||
steps {
|
steps {
|
||||||
rbheStaticCodeScan()
|
script {
|
||||||
|
scmCheckout {
|
||||||
|
clean = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage ('Static Code Scan - Protex') {
|
||||||
|
agent { label 'docker-amt' }
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
staticCodeScan {
|
||||||
|
// generic
|
||||||
|
scanners = ['protex']
|
||||||
|
scannerType = ['c','c++']
|
||||||
|
|
||||||
|
protexProjectName = 'OpenAMT - RPC'
|
||||||
|
// internal, do not change
|
||||||
|
protexBuildName = 'rrs-generic-protex-build'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage ('Parallel Builds') {
|
stage ('Parallel Builds') {
|
||||||
parallel {
|
parallel {
|
||||||
stage ('Linux') {
|
stage ('Linux') {
|
||||||
@@ -43,7 +72,6 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh './scripts/jenkins-pre-build.sh'
|
sh './scripts/jenkins-pre-build.sh'
|
||||||
sh './scripts/jenkins-build.sh'
|
sh './scripts/jenkins-build.sh'
|
||||||
stash includes: 'build/rpc', name: 'linux-rpc-app'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage ('Archive') {
|
stage ('Archive') {
|
||||||
@@ -51,6 +79,7 @@ pipeline {
|
|||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/rpc', caseSensitive: false, onlyIfSuccessful: true
|
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/rpc', caseSensitive: false, onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage ('Windows') {
|
stage ('Windows') {
|
||||||
@@ -61,7 +90,7 @@ pipeline {
|
|||||||
bat 'scripts\\jenkins-pre-build.cmd'
|
bat 'scripts\\jenkins-pre-build.cmd'
|
||||||
bat 'scripts\\jenkins-build.cmd'
|
bat 'scripts\\jenkins-build.cmd'
|
||||||
// prepare stash for the binary scan
|
// prepare stash for the binary scan
|
||||||
stash includes: '**/*.exe', name: 'win-rpc-app'
|
stash includes: "**/*.exe", name: 'rpc-app'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage ('Archive') {
|
stage ('Archive') {
|
||||||
@@ -73,81 +102,70 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage ('Parallel Scans') {
|
||||||
stage('Prep Binary') {
|
parallel {
|
||||||
|
stage ('Static Code Scan Linux') {
|
||||||
|
agent { label 'docker-amt' }
|
||||||
steps {
|
steps {
|
||||||
sh 'mkdir -p ./bin'
|
script {
|
||||||
dir('./bin') {
|
staticCodeScan {
|
||||||
unstash 'linux-rpc-app'
|
// generic
|
||||||
unstash 'win-rpc-app'
|
scanners = ['bdba','klocwork']
|
||||||
}
|
scannerType = 'c++'
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Linux Scans') {
|
|
||||||
environment{
|
|
||||||
PROJECT_NAME = 'OpenAMT - RPC - Linux'
|
|
||||||
SCANNERS = 'bdba,klocwork'
|
|
||||||
|
|
||||||
// protecode details
|
protecodeGroup = '25'
|
||||||
PROTECODE_BIN_DIR = './bin'
|
protecodeScanName = 'rpc-zip'
|
||||||
PROTECODE_INCLUDE_SUB_DIRS = true
|
protecodeDirectory = './build/rpc'
|
||||||
|
|
||||||
// klocwork details
|
|
||||||
KLOCWORK_SCAN_TYPE = 'c++'
|
|
||||||
KLOCWORK_PRE_BUILD_SCRIPT = './scripts/jenkins-pre-build.sh'
|
|
||||||
KLOCWORK_BUILD_COMMAND = './scripts/jenkins-build.sh'
|
|
||||||
KLOCWORK_IGNORE_COMPILE_ERRORS = true
|
|
||||||
|
|
||||||
// publishArtifacts details
|
|
||||||
PUBLISH_TO_ARTIFACTORY = true
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
rbheStaticCodeScan()
|
|
||||||
dir('artifacts/Klockwork'){
|
|
||||||
sh 'cp kw_report.html kw_report_linux.html'
|
|
||||||
sh 'cp kw_report.csv kw_report_linux.csv'
|
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_linux.html'
|
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_linux.csv'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
klockworkPreBuildScript = './scripts/jenkins-pre-build.sh'
|
||||||
|
klockworkBuildCommand = './scripts/jenkins-build.sh'
|
||||||
|
klockworkProjectName = 'Panther Point Creek'
|
||||||
|
klockworkIgnoreCompileErrors = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Windows Scans'){
|
}
|
||||||
agent { label 'openamt-win' }
|
}
|
||||||
|
stage ('Static Code Scan Windows') {
|
||||||
stages {
|
stages {
|
||||||
stage ('Windows Scans - klocwork') {
|
stage ('Static Code Scan Windows - Klockwork') {
|
||||||
environment {
|
agent { label 'openamt-win' }
|
||||||
PROJECT_NAME = 'OpenAMT - RPC - Windows'
|
|
||||||
SCANNERS = 'klocwork'
|
|
||||||
|
|
||||||
// klocwork details
|
|
||||||
KLOCWORK_SCAN_TYPE = 'c++'
|
|
||||||
KLOCWORK_PRE_BUILD_SCRIPT = 'scripts\\jenkins-pre-build.cmd'
|
|
||||||
KLOCWORK_BUILD_COMMAND = 'scripts\\jenkins-build.cmd'
|
|
||||||
KLOCWORK_IGNORE_COMPILE_ERRORS = true
|
|
||||||
|
|
||||||
// publishArtifacts details
|
|
||||||
PUBLISH_TO_ARTIFACTORY = true
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
rbheStaticCodeScan()
|
script {
|
||||||
dir('artifacts\\Klockwork'){
|
staticCodeScan {
|
||||||
bat 'copy kw_report.html kw_report_windows.html'
|
// generic
|
||||||
bat 'copy kw_report.csv kw_report_windows.csv'
|
scanners = ['klocwork']
|
||||||
stash includes: 'kw_report_windows.*', name: 'win-kwreports'
|
scannerType = 'c++'
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_windows.html'
|
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'kw_report_windows.csv'
|
klockworkPreBuildScript = 'scripts\\jenkins-pre-build.cmd'
|
||||||
|
klockworkBuildCommand = 'scripts\\jenkins-build.cmd'
|
||||||
|
klockworkProjectName = 'Panther Point Creek'
|
||||||
|
klockworkIgnoreCompileErrors = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage ('Static Code Scan Windows - BDBA') {
|
||||||
stage('Publish Artifacts'){
|
agent { label 'docker-amt' }
|
||||||
steps {
|
steps {
|
||||||
dir('artifacts/Klockwork'){
|
script {
|
||||||
unstash 'win-kwreports'
|
sh "mkdir -p bdbaScanDir"
|
||||||
|
dir("bdbaScanDir") {
|
||||||
|
unstash 'rpc-app'
|
||||||
|
}
|
||||||
|
staticCodeScan {
|
||||||
|
// generic
|
||||||
|
scanners = ['bdba']
|
||||||
|
scannerType = 'c++'
|
||||||
|
|
||||||
|
protecodeGroup = '25'
|
||||||
|
protecodeScanName = 'rpc-zip'
|
||||||
|
protecodeDirectory = 'bdbaScanDir'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
publishArtifacts()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
README.md
29
README.md
@@ -4,43 +4,26 @@
|
|||||||
|
|
||||||
The Remote Provisioning Client (RPC) is an application that enables remote capabilities for Intel® AMT, such as as device activation and configuration. To accomplish this, RPC communicates with the Remote Provisioning Server (RPS) to activate and connect the edge device.
|
The Remote Provisioning Client (RPC) is an application that enables remote capabilities for Intel® AMT, such as as device activation and configuration. To accomplish this, RPC communicates with the Remote Provisioning Server (RPS) to activate and connect the edge device.
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
**For detailed documentation** about RPC or other features of the Open AMT Cloud Toolkit, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/).
|
**For detailed documentation** about RPC or other features of the Open AMT Cloud Toolkit, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/).
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
We leverage GitHub Actions as a means to build RPC automatically leveraging Github's CI/CD Infrastructure. This avoids having to deal with the challenges of getting your build environment just right on your local machine and allows you to get up and running much faster. Read more about GitHub Actions [here](https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/#:~:text=GitHub%20Actions%20is%20an%20API,every%20step%20along%20the%20way.)
|
We leverage GitHub Actions as a means to build RPC automatically leveraging Github's CI/CD Infrastructure. This avoids having to deal with the challenges of getting your build environment just right on your local machine and allows you to get up and running much faster. Read more about GitHub Actions [here](https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/#:~:text=GitHub%20Actions%20is%20an%20API,every%20step%20along%20the%20way.)
|
||||||
|
|
||||||
|
## Build the Remote Provisioning Client (RPC)
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="assets/animations/forkandbuild.gif" width="650" />
|
<img src="assets/animations/forkandbuild.gif" width="650" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Build the Remote Provisioning Client (RPC)
|
1. Create a fork of the rpc repository [here](https://github.com/open-amt-cloud-toolkit/rpc/fork) or via the Fork button in the top-right corner of the rpc repository.
|
||||||
|
|
||||||
1. <a href="https://github.com/open-amt-cloud-toolkit/rpc/fork" target="_blank">Create a fork of rpc on GitHub.</a>
|
2. Click on "Actions" and Select "Build RPC (Native)" Workflow.
|
||||||
|
|
||||||
2. Click on the **Actions** tab at the top and select **Build RPC (Native) Debug/Release**.
|
3. Click "Run Workflow", select branch "master", and click "Run Workflow".
|
||||||
|
|
||||||
3. Click the **Run Workflow** dropdown.
|
4. Grab a coffee. The build for Windows will take approximately 30 minutes and the build for Linux will take approximately 5 minutes.
|
||||||
|
|
||||||
4. Select the **Branch: master**, or a preferred version, from the **Use workflow from** dropdown.
|
5. Once complete, click the completed job, and download the appropriate RPC for your OS under the "Artifacts" section.
|
||||||
|
|
||||||
5. By default, the Build Type should be **release**.
|
|
||||||
|
|
||||||
6. Click the **Run Workflow** button. Grab a coffee and take a break! The build time ranges from 15 to 20 minutes.
|
|
||||||
|
|
||||||
8. Once the download is complete, click the completed job which will feature a green checkmark.
|
|
||||||
|
|
||||||
9. Download the appropriate RPC for your managed device's OS under the **Artifacts** section.
|
|
||||||
|
|
||||||
### To Delete your workflow run
|
|
||||||
|
|
||||||
1. Click the ellipsis ( **...** ) menu for the workflow.
|
|
||||||
|
|
||||||
2. Choose the **Delete workflow run** option.
|
|
||||||
|
|
||||||
For detailed documentation about RPC and using it to activate a device, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/)
|
For detailed documentation about RPC and using it to activate a device, see the [docs](https://open-amt-cloud-toolkit.github.io/docs/)
|
@@ -1,5 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
|
|
11
commands.cpp
11
commands.cpp
@@ -282,10 +282,8 @@ bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries)
|
|||||||
for (int i = 0; i < (int) amt_hash_handles.Length; i++)
|
for (int i = 0; i < (int) amt_hash_handles.Length; i++)
|
||||||
{
|
{
|
||||||
// get each entry
|
// get each entry
|
||||||
AMT_STATUS amt_status = pthi_GetCertificateHashEntry(amt_hash_handles.Handles[i], &certhash_entry);
|
AMT_STATUS status = pthi_GetCertificateHashEntry(amt_hash_handles.Handles[i], &certhash_entry);
|
||||||
|
|
||||||
if (amt_status == 0)
|
|
||||||
{
|
|
||||||
int hashSize;
|
int hashSize;
|
||||||
cert_hash_entry tmp;
|
cert_hash_entry tmp;
|
||||||
switch (certhash_entry.HashAlgorithm) {
|
switch (certhash_entry.HashAlgorithm) {
|
||||||
@@ -331,7 +329,6 @@ bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries)
|
|||||||
hash_entries.push_back(tmp);
|
hash_entries.push_back(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -380,14 +377,14 @@ bool cmd_get_remote_access_connection_status(int& network_status, int& remote_st
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings, bool wired_interface)
|
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings)
|
||||||
{
|
{
|
||||||
// initialize HECI interface
|
// initialize HECI interface
|
||||||
if (heci_Init(NULL, PTHI_CLIENT) == 0) return false;
|
if (heci_Init(NULL, PTHI_CLIENT) == 0) return false;
|
||||||
|
|
||||||
// get wired interface
|
// get wired interface
|
||||||
LAN_SETTINGS lan_settings;
|
LAN_SETTINGS lan_settings;
|
||||||
UINT32 interface_settings = (wired_interface) ? 0 : 1; // wired=0, wireless=1
|
UINT32 interface_settings = 0; // wired=0, wireless=1
|
||||||
AMT_STATUS amt_status = pthi_GetLanInterfaceSettings(interface_settings, &lan_settings);
|
AMT_STATUS amt_status = pthi_GetLanInterfaceSettings(interface_settings, &lan_settings);
|
||||||
if (amt_status == 0)
|
if (amt_status == 0)
|
||||||
{
|
{
|
||||||
@@ -396,13 +393,11 @@ bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settin
|
|||||||
lan_interface_settings.dhcp_enabled = lan_settings.DhcpEnabled;
|
lan_interface_settings.dhcp_enabled = lan_settings.DhcpEnabled;
|
||||||
lan_interface_settings.link_status = lan_settings.LinkStatus;
|
lan_interface_settings.link_status = lan_settings.LinkStatus;
|
||||||
|
|
||||||
lan_interface_settings.ip_address.clear();
|
|
||||||
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 24) & 0xff);
|
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 24) & 0xff);
|
||||||
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 16) & 0xff);
|
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 16) & 0xff);
|
||||||
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 8) & 0xff);
|
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address >> 8) & 0xff);
|
||||||
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address) & 0xff);
|
lan_interface_settings.ip_address.push_back((lan_settings.Ipv4Address) & 0xff);
|
||||||
|
|
||||||
lan_interface_settings.mac_address.clear();
|
|
||||||
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[0]);
|
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[0]);
|
||||||
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[1]);
|
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[1]);
|
||||||
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[2]);
|
lan_interface_settings.mac_address.push_back(lan_settings.MacAddress[2]);
|
||||||
|
@@ -49,6 +49,6 @@ bool cmd_get_dns_suffix(std::string& suffix);
|
|||||||
bool cmd_get_wired_mac_address(std::vector<unsigned char>& address);
|
bool cmd_get_wired_mac_address(std::vector<unsigned char>& address);
|
||||||
bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries);
|
bool cmd_get_certificate_hashes(std::vector<cert_hash_entry>& hash_entries);
|
||||||
bool cmd_get_remote_access_connection_status(int& network_status, int& remote_status, int& remote_trigger, std::string& mps_hostname);
|
bool cmd_get_remote_access_connection_status(int& network_status, int& remote_status, int& remote_trigger, std::string& mps_hostname);
|
||||||
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings, bool wired_interface = true);
|
bool cmd_get_lan_interface_settings(lan_interface_settings& lan_interface_settings);
|
||||||
|
|
||||||
#endif
|
#endif
|
32
info.cpp
32
info.cpp
@@ -20,7 +20,7 @@ void out_text(const std::string name, const std::vector<unsigned char> value, co
|
|||||||
for (unsigned char tmp : value)
|
for (unsigned char tmp : value)
|
||||||
{
|
{
|
||||||
(hex) ? std::cout << std::setfill('0') << std::setw(2) << std::hex << (unsigned int)tmp
|
(hex) ? std::cout << std::setfill('0') << std::setw(2) << std::hex << (unsigned int)tmp
|
||||||
: std::cout << std::dec << (unsigned int)tmp;
|
: std::cout << (unsigned int)tmp;
|
||||||
|
|
||||||
if (char_count++ < value.size())
|
if (char_count++ < value.size())
|
||||||
{
|
{
|
||||||
@@ -270,43 +270,17 @@ bool info_get_lan_interface_settings()
|
|||||||
tmp.ip_address.clear();
|
tmp.ip_address.clear();
|
||||||
tmp.mac_address.clear();
|
tmp.mac_address.clear();
|
||||||
|
|
||||||
bool hasWired = cmd_get_lan_interface_settings(tmp);
|
if (!cmd_get_lan_interface_settings(tmp)) return false;
|
||||||
if (hasWired)
|
|
||||||
{
|
|
||||||
out_text("LAN Interface", "wired");
|
|
||||||
out_text("DHCP Enabled", (tmp.dhcp_enabled) ? "true" : "false");
|
out_text("DHCP Enabled", (tmp.dhcp_enabled) ? "true" : "false");
|
||||||
out_text("DHCP Mode", (tmp.dhcp_mode == 1) ? "active" : "passive");
|
out_text("DHCP Mode", (tmp.dhcp_mode == 1) ? "active" : "passive");
|
||||||
out_text("Link Status", (tmp.link_status) ? "up" : "down");
|
out_text("Link Status", (tmp.link_status) ? "up" : "down");
|
||||||
out_text("IP Address", tmp.ip_address, '.', false);
|
out_text("IP Address", tmp.ip_address, '.', false);
|
||||||
out_text("MAC Address", tmp.mac_address, ':');
|
out_text("MAC Address", tmp.mac_address, ':');
|
||||||
}
|
|
||||||
|
|
||||||
tmp.is_enabled = false;
|
|
||||||
tmp.link_status = false;
|
|
||||||
tmp.dhcp_enabled = false;
|
|
||||||
tmp.dhcp_mode = 0;
|
|
||||||
tmp.ip_address.clear();
|
|
||||||
tmp.mac_address.clear();
|
|
||||||
|
|
||||||
bool hasWireless = cmd_get_lan_interface_settings(tmp, false);
|
|
||||||
if (hasWireless)
|
|
||||||
{
|
|
||||||
out_text("LAN Interface", "wireless");
|
|
||||||
out_text("DHCP Enabled", (tmp.dhcp_enabled) ? "true" : "false");
|
|
||||||
out_text("DHCP Mode", (tmp.dhcp_mode == 1) ? "active" : "passive");
|
|
||||||
out_text("Link Status", (tmp.link_status) ? "up" : "down");
|
|
||||||
out_text("IP Address", tmp.ip_address, '.', false);
|
|
||||||
out_text("MAC Address", tmp.mac_address, ':');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasWired || hasWireless)
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool info_get(const std::string info)
|
bool info_get(const std::string info)
|
||||||
{
|
{
|
||||||
if (info.compare("ver") == 0)
|
if (info.compare("ver") == 0)
|
||||||
|
31
main.cpp
31
main.cpp
@@ -7,7 +7,6 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <cpprest/ws_client.h>
|
#include <cpprest/ws_client.h>
|
||||||
#include <cpprest/json.h>
|
#include <cpprest/json.h>
|
||||||
#include <algorithm>
|
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "lms.h"
|
#include "lms.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
@@ -272,22 +271,7 @@ int main(int argc, char* argv[])
|
|||||||
g_timeout_val = 0;
|
g_timeout_val = 0;
|
||||||
|
|
||||||
// exit
|
// exit
|
||||||
try {
|
|
||||||
std::cout << std::endl;
|
|
||||||
utility::string_t tmp = utility::conversions::convertstring(msgMessage);
|
|
||||||
web::json::value parsed = web::json::value::parse(tmp);
|
|
||||||
for (const auto& obj : parsed.as_object()) {
|
|
||||||
std::string key = utility::conversions::to_utf8string(obj.first);
|
|
||||||
std::string value = utility::conversions::to_utf8string(obj.second.serialize());
|
|
||||||
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
|
|
||||||
std::cout << key << ": " << value << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
std::cout << std::endl << msgMessage << std::endl;
|
std::cout << std::endl << msgMessage << std::endl;
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (msgStatus.compare("failed")==0)
|
else if (msgStatus.compare("failed")==0)
|
||||||
@@ -296,22 +280,7 @@ int main(int argc, char* argv[])
|
|||||||
g_timeout_val = 0;
|
g_timeout_val = 0;
|
||||||
|
|
||||||
// exit
|
// exit
|
||||||
try {
|
|
||||||
std::cout << std::endl;
|
|
||||||
utility::string_t tmp = utility::conversions::convertstring(msgMessage);
|
|
||||||
web::json::value parsed = web::json::value::parse(tmp);
|
|
||||||
for (const auto& obj : parsed.as_object()) {
|
|
||||||
std::string key = utility::conversions::to_utf8string(obj.first);
|
|
||||||
std::string value = utility::conversions::to_utf8string(obj.second.serialize());
|
|
||||||
value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
|
|
||||||
std::cout << key << ": " << value << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
std::cout << std::endl << msgMessage << std::endl;
|
std::cout << std::endl << msgMessage << std::endl;
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,9 +15,8 @@ set VCPKG_DIR=C:\opt\vcpkg-source
|
|||||||
cd %VCPKG_DIR%
|
cd %VCPKG_DIR%
|
||||||
|
|
||||||
REM build vcpkg
|
REM build vcpkg
|
||||||
git clone https://github.com/microsoft/vcpkg.git
|
git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
cmd /c bootstrap-vcpkg.bat
|
cmd /c bootstrap-vcpkg.bat
|
||||||
|
|
||||||
REM install CPPRestSDK
|
REM install CPPRestSDK
|
||||||
|
@@ -12,9 +12,8 @@ apt install git cmake build-essential curl zip unzip tar pkg-config -y
|
|||||||
|
|
||||||
#cd "$BASE_DIR"/rpc
|
#cd "$BASE_DIR"/rpc
|
||||||
## build vcpkg
|
## build vcpkg
|
||||||
git -C vcpkg pull || git clone https://github.com/microsoft/vcpkg.git vcpkg
|
git -C vcpkg pull || git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git vcpkg
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
git checkout 772d435ba18bf2f342458e0187ab7b48b84fe3f0
|
|
||||||
./bootstrap-vcpkg.sh
|
./bootstrap-vcpkg.sh
|
||||||
|
|
||||||
## install CPPRestSDK
|
## install CPPRestSDK
|
||||||
|
@@ -49,15 +49,15 @@ void usage_show_help()
|
|||||||
std::cout << "Examples:" << std::endl;
|
std::cout << "Examples:" << std::endl;
|
||||||
std::cout << " # Activate platform using profile1" << std::endl;
|
std::cout << " # Activate platform using profile1" << std::endl;
|
||||||
std::cout << " " << PROJECT_NAME << \
|
std::cout << " " << PROJECT_NAME << \
|
||||||
" --url wss://192.168.86.100/activate --cmd \"-t activate --profile profile1\"" << std::endl;
|
" --url wss://localhost:8080 --cmd \"-t activate --profile profile1\"" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << " # Activate platform using profile1 and override DNS detection" << std::endl;
|
std::cout << " # Activate platform using profile1 and override DNS detection" << std::endl;
|
||||||
std::cout << " " << PROJECT_NAME << \
|
std::cout << " " << PROJECT_NAME << \
|
||||||
" --url wss://mycloud.com/activate --cmd \"-t activate --profile profile1\" --dns corp.com" << std::endl;
|
" --url wss://localhost:8080 --cmd \"-t activate --profile profile1\" --dns corp.com" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << " # Deactivate platform and connect through a proxy" << std::endl;
|
std::cout << " # Deactivate platform and connect through a proxy" << std::endl;
|
||||||
std::cout << " " << PROJECT_NAME << \
|
std::cout << " " << PROJECT_NAME << \
|
||||||
" -u wss://mycloud.com/activate -c \"-t deactivate --password P@ssw0rd\" -p http://proxy.com:1000" << std::endl;
|
" -u wss://localhost:8080 -c \"-t deactivate --password P@ssw0rd\" -p http://proxy.com:1000" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << " # Show all informational items" << std::endl;
|
std::cout << " # Show all informational items" << std::endl;
|
||||||
std::cout << " " << PROJECT_NAME << " --amtinfo all" << std::endl;
|
std::cout << " " << PROJECT_NAME << " --amtinfo all" << std::endl;
|
||||||
|
Reference in New Issue
Block a user