Skip to content

Commit e164c3d

Browse files
authored
Merge pull request #129 from IBM/develop
Release to master
2 parents 3320720 + 8ef9762 commit e164c3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4832
-2019
lines changed

.github/workflows/python-push.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
name: Trestle Deploy
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
schedule:
11+
# Run once per day to ensure we have no build failures due to dependency updates.
12+
# * is a special character in YAML so you have to quote this string
13+
- cron: '0 22 * * *'
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
python-version: [3.7, 3.8]
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install build tools
32+
run: |
33+
make develop
34+
- name: Install dependencies
35+
run: |
36+
make install
37+
- name: Run code formatting (yapf)
38+
run: |
39+
make code-format
40+
- name: Run code linting (flake8)
41+
run: |
42+
make code-lint
43+
- name: Pytest
44+
run: |
45+
make test
46+
- name: Push code-cov
47+
uses: codecov/codecov-action@v1
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
file: ./coverage.xml
51+
deploy:
52+
runs-on: ubuntu-latest
53+
needs: build
54+
if: github.ref == 'refs/heads/master'
55+
steps:
56+
- uses: actions/checkout@v2
57+
with:
58+
submodules: true
59+
fetch-depth: 0
60+
token: ${{ secrets.ADMIN_PAT }}
61+
- name: Set up Python 3.7
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: 3.7
65+
- name: Install build tools
66+
run: |
67+
make develop
68+
- name: Create release
69+
shell: bash
70+
env:
71+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
72+
GH_TOKEN: ${{ secrets.ADMIN_PAT }}
73+
run: |
74+
make release

.github/workflows/python-test.yml

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
name: Trestle CI
3+
name: Trestle PR Pipeline
44

55

6-
on: [push, pull_request]
6+
on: [pull_request]
77

88
jobs:
99
build:
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: [ 3.7, 3.8]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
python-version: [3.7, 3.8]
1415

1516
steps:
1617
- uses: actions/checkout@v2
@@ -39,28 +40,4 @@ jobs:
3940
uses: codecov/codecov-action@v1
4041
with:
4142
token: ${{ secrets.CODECOV_TOKEN }}
42-
file: ./coverage.xml
43-
deploy:
44-
runs-on: ubuntu-latest
45-
needs: build
46-
if: github.ref == 'refs/heads/master'
47-
steps:
48-
- uses: actions/checkout@v2
49-
with:
50-
submodules: true
51-
fetch-depth: 0
52-
token: ${{ secrets.ADMIN_PAT }}
53-
- name: Set up Python 3.7
54-
uses: actions/setup-python@v2
55-
with:
56-
python-version: 3.7
57-
- name: Install build tools
58-
run: |
59-
make develop
60-
- name: Create release
61-
shell: bash
62-
env:
63-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
64-
GH_TOKEN: ${{ secrets.ADMIN_PAT }}
65-
run: |
66-
make release
43+
file: ./coverage.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
venv
1818
*.egg-info
1919
.vscode/settings.json
20+
.vscode
2021

2122
_*/
2223

@@ -26,6 +27,8 @@ _*/
2627

2728
build
2829
dist
30+
tmp
2931

3032
.coverage
3133
coverage.xml
34+

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ repos:
44
hooks:
55
- id: yapf
66
args: [--in-place, --parallel, --recursive, --style, .yapf-config]
7-
files: "^(trestle|tests)"
7+
files: "^(trestle|tests|scripts)"
88
exclude: "oscal"
99
stages: [commit]
1010
- repo: https://gitlab.com/pycqa/flake8
1111
rev: 3.8.4
1212
hooks:
1313
- id: flake8
14-
args: [--extend-ignore, "P1,C812,C813,C814,C815,C816,W503"]
14+
args: [--extend-ignore, "P1,C812,C813,C814,C815,C816,W503,W605"]
1515
additional_dependencies:
1616
[
1717
flake8-2020,
@@ -31,7 +31,7 @@ repos:
3131
flake8-use-fstring,
3232
pep8-naming,
3333
]
34-
files: "^(trestle|tests)"
34+
files: "^(trestle|tests|scripts)"
3535
exclude: "oscal"
3636
stages: [commit]
3737
- repo: https://github.com/hukkinj1/mdformat

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pip install -q -e ".[dev]" --upgrade --upgrade-strategy eager
9999

100100
### Testing python in `vscode`
101101

102-
Tests should be in the test subdirectory. Each file should be named test\_\*.py and each test function should be named \*\_test().
102+
Tests should be in the test subdirectory. Each file should be named test\_\*.py and each test function should be named \*\_test().
103103

104104
Note that with Python3 there should be no need for __init__.py in directories.
105105

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ release::
3939
semantic-release publish
4040

4141
gen-oscal::
42-
./scripts/gen_oscal.sh
42+
python ./scripts/gen_oscal.py

README.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
1-
# Trestle
1+
# Compliance-trestle aka trestle
22

3-
Trestle is a tool to which enables the creation and validation of documentation artifacts for compliance requirements. It leverages NIST's [OSCAL](<https://pages.nist.gov/OSCAL/documentation/>) as a standard data format for interchange between tools & people and provides an opinionated approach to OSCAL adoption.
3+
Trestle is a tool that enables the creation and validation of documentation artifacts for compliance requirements. It leverages NIST's [OSCAL](<https://pages.nist.gov/OSCAL/documentation/>) as a standard data format for interchange between tools and people, and provides an opinionated approach to OSCAL adoption.
44

5-
By design Trestle runs as a CICD pipeline running on top of compliance artifacts in `git` to provide transparency to the state of compliance across multiple stakeholders in an environment friendly to developers. Trestle passes the artifacts generated on to tools to orchestrate the enforcement, measurement and reporting of compliance.
5+
By design Trestle runs as a CICD pipeline running on top of compliance artifacts in `git` to provide transparency to the state of compliance across multiple stakeholders in an environment friendly to developers. Trestle passes the artifacts generated to tools that orchestrate the enforcement, measurement and reporting of compliance.
66

7-
It also provides tooling to manage OSCAL in a more human-friendly manner. By expanding the large OSCAL data structures into smaller, easier to edit, sub-structures, creation and maintenance of these artifacts can follow normal `git` workflows (peer review via pull request, versioning, releases/tagging).
7+
It also provides tooling to manage OSCAL in a more human-friendly manner. By expanding the large OSCAL data structures into smaller and easier to edit sub-structures, creation and maintenance of these artifacts can follow normal `git` workflows (peer review via pull request, versioning, releases/tagging).
88

9-
## Why Trestle?
9+
## Why Trestle
1010

11-
Compliance suffers from being a complex problem that is hard to articulate simply. It requires complete & accurate execution of multiple procedures, across many disciplines (IT, HR, management), with periodic verification and audit of said procedures against controls.
11+
Compliance suffers from being a complex problem that is hard to articulate simply. It requires complete and accurate execution of multiple procedures across many disciplines (e.g. IT, HR, management) with periodic verification and audit of those procedures against controls.
1212

13-
While its possible to manage the description of controls & how an organisation implements them in ad hoc ways, with general tools (spreadsheets, documents), this is hard to maintain for multiple accreditations and, in the IT domain at least, creates a barrier between the compliance efforts and people doing daily work (DevOps staff).
13+
While it is possible to manage the description of controls and how an organisation implements them in ad hoc ways with general tools (spreadsheets, documents), this is hard to maintain for multiple accreditations and, in the IT domain at least, creates a barrier between the compliance efforts and the people doing daily work (DevOps staff).
1414

15-
Trestle aims to reduce or remove this barrier by bringing the maintenance of control descriptions into the DevOps domain. The aim is to have changes to the system (for example, updates to configuration management) easily related to the controls impacted & those controls be modified if required in concert with the system change.
15+
Trestle aims to reduce or remove this barrier by bringing the maintenance of control descriptions into the DevOps domain. The goal is to have changes to the system (for example, updates to configuration management) easily related to the controls impacted, and to enable modification of those controls as required in concert with the system changes.
1616

17-
Trestle implicitly provides an core opinionated workflow driven by it's pipeline steps to allow standardized interlocks with other compliance tooling platforms.
17+
Trestle implicitly provides a core opinionated workflow driven by its pipeline steps to allow standardized interlocks with other compliance tooling platforms.
18+
19+
## Development status
20+
21+
Compliance trestle is currently alpha. The expectation is that throughout the remainder of 2020 there may be unnannounced changes that are breaking within the trestle codebase. If you are using trestle please contact us so we are aware your usecase.
22+
23+
The underlying OSCAL schema is also currently changing. The current approach until the formal release of OSCAL 1.0.0 is for compliance trestle to regularly update our models to reflect NIST's changes.
1824

1925
### Machine readable compliance format
2026

21-
Compliance activities at scale, be that size of estate, or number of accreditations, require automation to be successful & repeatable. OSCAL as a standard allows teams to bridge between the "Governance" layer and operational tools.
27+
Compliance activities at scale, whether size of estate or number of accreditations, require automation to be successful and repeatable. OSCAL as a standard allows teams to bridge between the "Governance" layer and operational tools.
2228

23-
By building human managed artifacts into OSCAL, Trestle is not only able to validate the integrity of the artifacts that people generate, it also enables reuse and sharing of artifacts and can also provide suitable input into tools which automate operational compliance.
29+
By building human managed artifacts into OSCAL, Trestle is not only able to validate the integrity of the artifacts that people generate - it also enables reuse and sharing of artifacts, and furthermore can provide suitable input into tools that automate operational compliance.
2430

2531
## Using Trestle
2632

27-
Trestle converts complex schema/data structures into simple files in a directory structure. The aim of this is to make it easier to manage for humans - individual objects can be versioned & reviewed, then 'compiled' into the larger structure of a Catalog, SSP or Assessment Plan.
33+
Trestle converts complex schema/data structures into simple files in a directory structure. The aim of this is to make it easier to manage for humans: Individual objects can be versioned & reviewed, then 'compiled' into the larger structure of a Catalog, SSP or Assessment Plan.
2834

29-
### Install and Run:
35+
### Install and Run
3036

3137
Install from PYPI and run:
32-
~~~shell
38+
39+
```shell
3340
# Setup virtual environement
3441
python3 -m venv venv
3542
. ./venv/bin/activate
@@ -39,10 +46,11 @@ pip install compliance-trestle
3946

4047
# Run Trestle CLI
4148
trestle -h # For command line help
42-
~~~
49+
```
4350

4451
In order to install Trestle from source, run the following command:
45-
~~~shell
52+
53+
```shell
4654
# Clone
4755
git clone https://github.com/IBM/compliance-trestle.git
4856
cd compliance-trestle
@@ -54,14 +62,30 @@ pip install -q -e ".[dev]" --upgrade --upgrade-strategy eager
5462

5563
# Run Trestle CLI
5664
trestle -h
57-
~~~
65+
```
66+
67+
## Supported OSCAL elements and extensions
68+
69+
`trestle` implicitly supports all OSCAL schemas for use within the object model. The development roadmap for `trestle` includes
70+
adding workflow around specific elements / objects that is opinionated.
71+
72+
In addition to the core OSCAL objects, trestle supports the definition of a `target`. The `target` (and its container
73+
`target-definition`) is a generalization of the `component` model that is designed specifically to support configuration.
74+
75+
`catalog` and `profile` objects can define parameters. However, by their nature the parameter definitions are at the
76+
regulatory level. The `trestle` team has seen a need for an object that can define parameters at the `control-implemenation`
77+
level, e.g. `component` is an implementation and `target` is the definition of capabilities of the component.
78+
79+
### Conformance criteria ontop of OSCAL
5880

5981
## Contributing to Trestle
60-
Our project welcomes external contributions. Please checkout [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
82+
83+
Our project welcomes external contributions. Please consult [CONTRIBUTING.md](<CONTRIBUTING.md>) to get started.
6184

6285
## License & Authors
63-
If you would like to see the detailed LICENSE click [here](LICENSE).
64-
Check out [MAINTAINERS](MAINTAINERS.md) for list of authors.
86+
87+
If you would like to see the detailed LICENSE click [here](<LICENSE>).
88+
Consult [MAINTAINERS](<MAINTAINERS.md>) for a list of authors.
6589

6690
```text
6791
# Copyright (c) 2020 IBM Corp. All rights reserved.
@@ -78,4 +102,4 @@ Check out [MAINTAINERS](MAINTAINERS.md) for list of authors.
78102
# See the License for the specific language governing permissions and
79103
# limitations under the License.
80104
81-
```
105+
```

0 commit comments

Comments
 (0)