Skip to content

Commit

Permalink
Basic pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
gtback committed May 10, 2018
1 parent 9341a66 commit 803fe34
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
_site
.sass-cache
.jekyll-metadata
.jekyll-metadata
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exclude: >
(?x)^(
.*\.svg$|
js/bootstrap.min.js
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.1-1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ install:
- pip install stix2-validator

script:
- ./validate-examples.sh
- ./validate-examples.sh
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<li> <a href="{{ site.baseurl }}/stix/walkthrough">Introductory Walkthrough</a></li>
<li> <a href="{{ site.baseurl }}/stix/examples">Examples</a></li>
<li> <a href="{{ site.baseurl }}/stix/compare">STIX 1.X and STIX 2 Comparison</a></li>
<li> <a href="{{ site.baseurl }}/resources#stix-20-specification">Latest STIX Specifications</a></li>
<li> <a href="{{ site.baseurl }}/resources#stix-20-specification">Latest STIX Specifications</a></li>
</ul>
</li>
<li class="dropdown">
Expand Down
7 changes: 3 additions & 4 deletions _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,14 @@ pre {
/*
* Tables
*/
.table-anchor tbody tr td:nth-of-type(1),
.table-anchor tbody tr td:nth-of-type(1),
.table-col1-width tbody tr td:nth-of-type(1),
.table-col2-width tbody tr td:nth-of-type(2) {
width: 25%;
width: 25%;
}

.table-anchor tbody tr td:nth-of-type(2) {
width: 15%;
width: 15%;
}

.table-anchor tbody tr td a{
Expand All @@ -481,4 +481,3 @@ pre {
.relationshipIcon {
cursor: pointer;
}

16 changes: 8 additions & 8 deletions contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Contribute and Join The Global Community
<div class="col-md-4 info-box well pull-left">
<div>
<p>Let us know how to improve</p>
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Feedback" target="_blank" href="https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=cti">
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Feedback" target="_blank" href="https://www.oasis-open.org/committees/comments/index.php?wg_abbrev=cti">
<span class="glyphicon glyphicon-comment"></span> Submit Feedback
</a>
</div>
Expand All @@ -23,7 +23,7 @@ Contribute and Join The Global Community
<div class="info-box well pull-left">
<p>Want to stay up-to-date on the latest STIX discussions?</p>
<div>
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Mailing List" target="_blank" href="https://www.oasis-open.org/policies-guidelines/mailing-lists">
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Mailing List" target="_blank" href="https://www.oasis-open.org/policies-guidelines/mailing-lists">
<span class="glyphicon glyphicon-envelope"></span> Mailing List Subscription
</a>
</div>
Expand All @@ -39,7 +39,7 @@ Bug reports, suggestions and help requests about spcific OASIS github projects s
<div class="col-md-4 info-box well pull-left">
<p>Contributor License Agreement</p>
<div>
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Contributor License Agreement" target="_blank" href="https://www.oasis-open.org/resources/open-repositories/cla">
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Contributor License Agreement" target="_blank" href="https://www.oasis-open.org/resources/open-repositories/cla">
<span class="glyphicon glyphicon-th-list"></span> License Agreement
</a>
</div>
Expand All @@ -48,11 +48,11 @@ Bug reports, suggestions and help requests about spcific OASIS github projects s
<div class="col-md-6 info-box well pull-left">
<p>Resources</p>
<div>
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Notable Resources" href="{{ site.baseurl }}/resources">
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Notable Resources" href="{{ site.baseurl }}/resources">
<span class="glyphicon glyphicon-th-list"></span> Notable Resources
</a>

<a style="margin-left: 20px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="CTI OASIS Open Repositories" target="_blank" href="https://github.com/oasis-open?utf8=%E2%9C%93&q=cti&type=&language=">
<a style="margin-left: 20px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="CTI OASIS Open Repositories" target="_blank" href="https://github.com/oasis-open?utf8=%E2%9C%93&q=cti&type=&language=">
<img class="icon github-icon" alt="GitHub Octocat" src="{{ site.baseurl }}/img/GitHub-Mark-Light.png"> CTI OASIS Open Repositories
</a>
</div>
Expand All @@ -63,13 +63,13 @@ Bug reports, suggestions and help requests about spcific OASIS github projects s

To be directly involved in the development of the STIX specification one must join OASIS and the Technical Committee(TC). This should only be considered by those willing to have a dedicated commitment to STIX and/or CTI.

<div class="row">
<div class="row">
<div class="col-md-6 info-box well pull-left">
<div>
<p>Join the Technical Committee</p>
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Join Technical Committee" target="_blank" href="https://www.oasis-open.org/join">
<a class="btn btn-primary btn-spec" data-toggle="tooltip" title="Join Technical Committee" target="_blank" href="https://www.oasis-open.org/join">
<span class="glyphicon glyphicon-envelope"></span> Join Technical Committee
</a>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion examples/malware-indicator-for-file-hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Next, the details of the Poison Ivy malware are captured using a STIX [Malware](

These SDO’s are then coupled together via a [Relationship](https://docs.google.com/document/d/1IvkLxg_tCnICsatu2lyxKmWmh1gY2h8HUNssKIE-UIA/pub#h.e2e1szrqfoan) STIX Relationship Object (SRO). This Relationship connects the <span class="sdo">**source\_ref**</span>, Indicator, with the <span class="sdo">**target\_ref**</span>, Malware, via an <span class="values">indicates</span> <span class="sdo">**relationship\_type**</span>.

A diagram of this relationship below shows the Indicator and Malware SDO’s and the Relationship SRO between them
A diagram of this relationship below shows the Indicator and Malware SDO’s and the Relationship SRO between them
[(An interactive version can be found here)](https://oasis-open.github.io/cti-stix-visualization/?url=https://raw.githubusercontent.com/oasis-open/cti-documentation/master/examples/example_json/malware-indicator-for-file-hash.json){: target="_blank"}:

![Malware indicator for file hash]({{ site.baseurl }}/img/Malware-Indicator-for-File-Hash.PNG)
Expand Down
1 change: 0 additions & 1 deletion faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ Frequently Asked Questions
<div>
<iframe class="faq" title="FAQ" src="https://docs.google.com/document/d/1V5tE78N10McUq1xUOHV1RTVsOoYmiq_xt2PY1YI8bsU/pub?embedded=true"></iframe>
</div>

8 changes: 4 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ layout: default
<div class="panel-heading">
<div markdown="span">[![STIX Logo]({{ site.baseurl }}/img/LOGO_STIX.svg){: .panel-logo}]({{site.baseurl}}/stix/intro)</div>
<div class="panel-title text-center">A structured language for cyber threat intelligence</div>
</div>
</div>
<div class="panel-body">
<p>
Structured Threat Information Expression (STIX™) is a language and serialization format used to exchange cyber threat intelligence (CTI).
Expand All @@ -30,7 +30,7 @@ layout: default
**STIX Relationship Example**
</div>
<div class="panel-heading">
<a style="width: 250px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="STIX Home" href="{{site.baseurl}}/stix/intro">
<a style="width: 250px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="STIX Home" href="{{site.baseurl}}/stix/intro">
<span class="glyphicon glyphicon-home"></span> Learn More
</a>
</div>
Expand Down Expand Up @@ -60,8 +60,8 @@ layout: default
![TAXII Collections]({{ site.baseurl }}/img/taxii_diagram.png){: .figure-img .img-fluid}
**TAXII Collections**
</div>
<div style="margin-top: -2px;" class="panel-heading">
<a style="width: 250px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="TAXII Home" href="{{site.baseurl}}/taxii/intro">
<div style="margin-top: -2px;" class="panel-heading">
<a style="width: 250px;" class="btn btn-primary btn-spec" data-toggle="tooltip" title="TAXII Home" href="{{site.baseurl}}/taxii/intro">
<span class="glyphicon glyphicon-home"></span> Learn More
</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions js/example_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function filter_idiom_table(by_tag) {

function toggle_color(clicked_tag) {
var tags = $("a[class=\"tag-filter\"");
for (var i = 0; i < tags.length; i++) {
for (var i = 0; i < tags.length; i++) {
tags[i].style.backgroundColor = "transparent";
}

Expand All @@ -22,13 +22,13 @@ $(document).ready(function() {
toggle_color(this);
filter_idiom_table(label);
})

var idiom_table = $("#examples-table");
var rows = $(idiom_table).find('tbody > tr').get();
$.each(rows, function(index, row) {
$(idiom_table).children('tbody').append(row);
});

if (window.location.hash) {
filter_idiom_table(window.location.hash.substring(1));
}
Expand Down
22 changes: 11 additions & 11 deletions stix/compare.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The generic TTP (tactics, techniques, procedures) and Exploit Target types from

```xml
<stix:TTPs>
<stix:TTP id="attack-pattern:ttp-01" xsi:type='ttp:TTPType'
<stix:TTP id="attack-pattern:ttp-01" xsi:type='ttp:TTPType'
version="1.1">
<ttp:Title>Initial Compromise</ttp:Title>
<ttp:Behavior>
Expand All @@ -43,13 +43,13 @@ The generic TTP (tactics, techniques, procedures) and Exploit Target types from
</stix:TTPs>
<stix:TTPs>
<stix:Kill_Chains>
<stixCommon:Kill_Chain id="stix:TTP-02"
<stixCommon:Kill_Chain id="stix:TTP-02"
name="mandiant-attack-lifecycle-model">
<stixCommon:Kill_Chain_Phase name="initial-compromise"
<stixCommon:Kill_Chain_Phase name="initial-compromise"
phase_id="stix:TTP-03"/>
</stix:Kill_Chains>
</stix:TTPs>
```
```
</div>

<div class="col-md-5" markdown="1">
Expand Down Expand Up @@ -129,22 +129,22 @@ Indicator patterns in STIX 1.x were expressed using XML syntax. This made all bu
### STIX 1 Indicator Example

```xml
<stix:Indicator id="example:indicator-01"
timestamp="2017-02-09T12:11:11.415000+00:00"
<stix:Indicator id="example:indicator-01"
timestamp="2017-02-09T12:11:11.415000+00:00"
xsi:type='indicator:IndicatorType'>
<indicator:Title>HTRAN Hop Point Accessor</indicator:Title>
</stix:Indicator>
<stix:TTPs>
<stix:Kill_Chains>
<stixCommon:Kill_Chain id="stix:TTP-02"
<stixCommon:Kill_Chain id="stix:TTP-02"
name="mandiant-attack-lifecycle-model">
<stixCommon:Kill_Chain_Phase name="establish-foothold"
<stixCommon:Kill_Chain_Phase name="establish-foothold"
phase_id="stix:TTP-03"/>
</stix:Kill_Chains>
</stix:TTPs>
<indicator:Observable id="example:Observable-04">
<cybox:Object id="example:Object-05">
<cybox:Properties xsi:type="AddressObj:AddressObjectType"
<cybox:Properties xsi:type="AddressObj:AddressObjectType"
category="ipv4-addr">
<AddressObj:Address_Value condition="Equals">10.1.0.0/15
</AddressObj:Address_Value>
Expand All @@ -164,13 +164,13 @@ Indicator patterns in STIX 1.x were expressed using XML syntax. This made all bu
"created": "2017-02-09T12:11:11.415000Z",
"modified": "2017-02-09T12:11:11.415000Z",
"name": "HTRAN Hop Point Accessor",
"pattern": "[ipv4-addr:value =
"pattern": "[ipv4-addr:value =
'10.1.0.0/15']",
"labels": [ "malicious-activity" ],
"valid_from": "2015-05-15T09:00:00.000000Z",
"kill_chain_phases": [
{
"kill_chain_name":
"kill_chain_name":
"mandiant-attack-lifecycle-model",
"phase_name": "establish-foothold"
}
Expand Down
Loading

0 comments on commit 803fe34

Please sign in to comment.