Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

Commit 8d73fd3

Browse files
authored
Merge branch 'develop' into ecs_deploy
2 parents 780e50b + c6cceeb commit 8d73fd3

65 files changed

Lines changed: 1325 additions & 234 deletions

Some content is hidden

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
*.py[cod]
2+
.*.swp
3+
4+
# ECS deploy env files
25
secmonkey.local.env
36
secmonkey.push.env
47

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ matrix:
2929
- pip install pip --upgrade
3030
- pip install setuptools --upgrade
3131
- pip install google-compute-engine
32-
- pip install openstacksdk
32+
- pip install "os-client-config==1.28.0"
33+
- pip install "openstacksdk==0.9.18"
3334
- pip install cloudaux\[gcp\]
3435
- pip install cloudaux\[openstack\]
3536
- pip install -e .
@@ -57,6 +58,7 @@ matrix:
5758
- coverage run -a -m py.test security_monkey/tests/views || exit 1
5859
- coverage run -a -m py.test security_monkey/tests/interface || exit 1
5960
- coverage run -a -m py.test security_monkey/tests/utilities || exit 1
61+
- coverage run -a -m py.test security_monkey/tests/sso/header_auth.py || exit 1
6062
- bandit -r -ll -ii -x security_monkey/tests .
6163
- pylint -E -d E1101,E0611,F0401 --ignore=service.py,datastore.py,datastore_utils.py,watcher.py,test_celery_scheduler.py security_monkey
6264
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
FROM ubuntu:xenial
1616
MAINTAINER Netflix Open Source Development <talent@netflix.com>
1717

18-
ENV SECURITY_MONKEY_VERSION=v1.0 \
18+
ENV SECURITY_MONKEY_VERSION=v1.1.3 \
1919
SECURITY_MONKEY_SETTINGS=/usr/local/src/security_monkey/env-config/config-docker.py
2020

2121
SHELL ["/bin/bash", "-c"]

dart/lib/component/dashboard_component/dashboard_component.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ class DashboardComponent {
9292
for (var item in selectedItems) {
9393
// Add item score to technology map
9494
if (techScoreMap.containsKey(item.technology)) {
95-
techScoreMap[item.technology] = techScoreMap[item.technology] + item.totalScore();
95+
techScoreMap[item.technology] = techScoreMap[item.technology] + item.unjustifiedScore();
9696
} else {
97-
techScoreMap[item.technology] = item.totalScore();
97+
techScoreMap[item.technology] = item.unjustifiedScore();
9898
}
9999
// Add item score to account score map
100100
if (accountScoreMap.containsKey(item.account)) {
101-
accountScoreMap[item.account] = accountScoreMap[item.account] + item.totalScore();
101+
accountScoreMap[item.account] = accountScoreMap[item.account] + item.unjustifiedScore();
102102
} else {
103-
accountScoreMap[item.account] = item.totalScore();
103+
accountScoreMap[item.account] = item.unjustifiedScore();
104104
}
105105
}
106106
// angular.dart does not support iterating over hash map so convert to array

dart/lib/component/dashboard_component/dashboard_component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ <h3 class="panel-title">High Score Items</h3>
9797
</tr>
9898
</thead>
9999
<tbody>
100-
<tr ng-repeat="highScoreItem in selectedItems | orderBy:'-totalScore()' | limitTo:10">
100+
<tr ng-repeat="highScoreItem in selectedItems | orderBy:'-unjustifiedScore()' | limitTo:10">
101101
<td>{{highScoreItem.account}}</td>
102102
<td>{{highScoreItem.technology}}</td>
103103
<td><a href="#/viewitem/{{highScoreItem.id}}">{{highScoreItem.name}}</a></td>
104-
<td>{{highScoreItem.totalScore()}}</td>
104+
<td>{{highScoreItem.unjustifiedScore()}}</td>
105105
</tr>
106106
</tbody>
107107
</table>

dart/lib/component/item_table_component/item_table_component.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class ItemTableComponent extends PaginatedTable implements DetachAware {
5353

5454
/// Case 1 - Item has no issues or scoreless issues. Return "";
5555
/// Case 2 - Item has all justified issues. Return "success";
56-
/// Case 3 - Item has unjustified issues w/score <=3. Return "warning";
57-
/// Case 4 - Item has unjustified issues w/score >3. Return "danger";
56+
/// Case 3 - Item has unjustified issues w/score <=8. Return "warning";
57+
/// Case 4 - Item has unjustified issues w/score >8. Return "danger";
5858
String classForItem(Item item) {
5959
if (item.number_issues == 0 || item.totalScore() == 0) {
6060
return "";
@@ -64,7 +64,7 @@ class ItemTableComponent extends PaginatedTable implements DetachAware {
6464
return "success";
6565
}
6666

67-
if (item.unjustifiedScore() <= 3) {
67+
if (item.unjustifiedScore() <= 8) {
6868
return "warning";
6969
}
7070

dart/lib/component/itemdetails/itemdetails.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@
7979
<td ng-if="us.hasRole('Justify')"><div class="text-center"><input type="checkbox" ng-model="issue.selected_for_justification" /></div></td>
8080
<td>{{issue.issue}}</td>
8181
<td>{{issue.score}}</td>
82-
<td ng-if="issue.has_sub_item">Related to:
83-
<ul class="list-unstyled">
84-
<li ng-repeat="link in issue.item_links">
85-
<a href="#/viewitem/{{link.id}}">{{link.name}}
86-
</li>
87-
</ul>
82+
<td>
83+
<span ng-if="issue.has_sub_item">Related to:
84+
<a ng-repeat="link in issue.item_links" href="#/viewitem/{{link.id}}">{{link.name}}</a>
85+
</span>
86+
{{issue.notes}}
8887
</td>
89-
<td ng-if="!issue.has_sub_item">{{issue.notes}}</td>
9088
</tr>
9189
</table>
9290
<div ng-if="us.hasRole('Justify')" class="panel-footer">
@@ -120,14 +118,12 @@
120118
<td>{{issue.issue}}</td>
121119
<td>{{issue.justification}}</td>
122120
<td>{{issue.score}}</td>
123-
<td ng-if="issue.has_sub_item">Related to:
124-
<ul class="list-unstyled">
125-
<li ng-repeat="link in issue.item_links">
126-
<a href="#/viewitem/{{link.id}}">{{link.name}}
127-
</li>
128-
</ul>
121+
<td>
122+
<span ng-if="issue.has_sub_item">Related to:
123+
<a ng-repeat="link in issue.item_links" href="#/viewitem/{{link.id}}">{{link.name}}</a>
124+
</span>
125+
{{issue.notes}}
129126
</td>
130-
<td ng-if="!issue.has_sub_item">{{issue.notes}}</td>
131127
<td>
132128
<button ng-if="issue.justified_user==user"
133129
ng-click="removeJustification(issue.id)"

dart/web/js/sso.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ var create_url = function(provider) {
2828
if (provider.hd) {
2929
url += "&hd="+provider.hd;
3030
}
31+
} else if (provider.name.toLowerCase() == "okta") { // Okta
32+
url += "?";
33+
url += "response_type="+provider.responseType;
34+
url += "&client_id="+provider.clientId;
35+
url += "&redirect_uri="+provider.redirectUri;
36+
url += "&nonce="+provider.nonce;
37+
url += "&scope="+provider.scope.join(provider.scopeDelimiter);
38+
url += "&response_type="+provider.responseType;
39+
url += "&state=clientId,"+provider.clientId+",redirectUri,"+provider.redirectUri+",return_to,"+next;
3140
} else { // google || ping
3241
url += "?";
3342
url += "response_type="+provider.responseType;

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ services:
1414
image: postgres:10.1
1515
#volumes:
1616
# - ./postgres-data/:/var/lib/postgresql/data
17+
environment:
18+
- POSTGRES_DB=secmonkey
1719

1820
redis:
1921
container_name: secmonkey-redis

docker/api-init.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -e
22

33
# Wait the database
44
sleep 10
@@ -19,17 +19,15 @@ mkdir -p /var/log/security_monkey/
1919
touch "/var/log/security_monkey/security_monkey-deploy.log"
2020

2121
cd /usr/local/src/security_monkey
22-
source venv/bin/activate
2322
monkey db upgrade
2423

25-
# -------------ADD ADDITIONAL MONKEY COMMANDS TO EXEUTE HERE-------------
24+
# -------------ADD ADDITIONAL MONKEY COMMANDS TO EXECUTE HERE-------------
2625

2726
cat <<EOF | monkey create_user "admin@example.org" "Admin"
2827
${SECURITY_MONKEY_PASSWORD:-admin}
2928
${SECURITY_MONKEY_PASSWORD:-admin}
3029
EOF
3130

32-
3331
# -------------ADD MONKEY COMMANDS ABOVE TO ADD ACCOUNTS AND DO OTHER THINGS-------------
3432

3533
echo "Completed API init on $( date )"

0 commit comments

Comments
 (0)