Skip to content

Commit

Permalink
Merge pull request #44 from kmcquade/table/checkbox-selection
Browse files Browse the repository at this point in the history
Table checkbox selection and ability to export as CSV
  • Loading branch information
kmcquade authored May 16, 2020
2 parents dca9e8f + 28e000c commit 19a023b
Show file tree
Hide file tree
Showing 10 changed files with 3,625 additions and 6,719 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Cloudsplaining
--------------

Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report with a triage worksheet.
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report.

![Tests](https://github.com/salesforce/cloudsplaining/workflows/Test/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/cloudsplaining/badge/?version=latest)](https://cloudsplaining.readthedocs.io/en/latest/?badge=latest)
Expand Down
1 change: 0 additions & 1 deletion cloudsplaining/bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"""
Cloudsplaining is an AWS IAM Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report with a triage worksheet.
"""
# __version__ = "0.1.2"
import click
from cloudsplaining import command
from cloudsplaining.bin.version import __version__
Expand Down
2 changes: 1 addition & 1 deletion cloudsplaining/bin/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pylint: disable=missing-module-docstring
__version__ = "0.1.2"
__version__ = "0.1.3"
2 changes: 2 additions & 0 deletions cloudsplaining/output/templates/summary/aws-managed.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<!--<table id="aws-managed-table" class="table table-striped table-bordered table-sm">-->
<thead>
<tr>
<th></th>
<th>Policy Name</th>
<th>Services Count</th>
<th>Services Affected</th>
Expand All @@ -31,6 +32,7 @@
{% for finding in t["results"] %}
{% if finding["ManagedBy"] == "AWS" %}
<tr>
<td></td>
<td><a href="#{{ finding['PolicyName'] }}">{{ finding['PolicyName'] }}</a></td>
<td>{{ finding["ServicesCount"] }}</td>
<td><p style="max-height: 100px; overflow: scroll;">{% for service in finding["Services"] %}{{ service }}{% if not loop.last %}, {% endif %}{% endfor %}</p></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<span class="badge badge-default"></span>
<div class="customer-managed-table table-responsive table-sm">
<table id="customer-managed-table" class="display compact" style="width:100%; border-radius: 10px">
<!--<table id="customer-managed-table" class="table table-striped table-bordered table-sm">-->
<thead>
<tr>
<th></th>
<th>Inline or Managed</th>
<th>Type</th>
<th>Policy Name</th>
Expand All @@ -38,6 +38,7 @@
{% for finding in t["results"] %}
{% if finding["ManagedBy"] == "Customer" %}
<tr>
<td></td>
<td>{% if finding["Type"] == "Policy" %}Managed{% else %}Inline{% endif %}</td>
<td>{{ finding["Type"] }}</td>
<td><a href="#{{ finding['PolicyName'] }}">{{ finding['PolicyName'] }}</a></td>
Expand Down
2 changes: 2 additions & 0 deletions cloudsplaining/output/templates/summary/iam-principals.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<!--<table id="principals-table" class="table table-striped table-bordered table-sm">-->
<thead>
<tr>
<th></th>
<th>Type</th>
<th>Name</th>
<th>Policy Type</th>
Expand All @@ -33,6 +34,7 @@
<tbody>
{% for principal in t["principal_policy_mapping"] %}
<tr>
<td></td>
<td>{{ principal["Type"] }}</td>
<td>{{ principal["Principal"] }}</td>
<td>{% if principal["PolicyType"] == "Managed" %} <a href="#definition-managed-policy">{{ principal["PolicyType"] }}</a>{% endif %}{% if principal["PolicyType"] == "Inline" %} <a href="#definition-inline-policy">{{ principal["PolicyType"] }}</a>{% endif %}</td>
Expand Down
111 changes: 104 additions & 7 deletions cloudsplaining/output/templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<!--Data Tables-->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"
crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css"
crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css"
crossorigin="anonymous">


<!--Custom CSS-->
<style>
Expand Down Expand Up @@ -228,6 +233,14 @@ <h4 id="references">References</h4>

<!--Data Tables-->
<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.flash.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>

<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script>

<!--<script>-->
<!-- $(document).ready(function() {-->
Expand Down Expand Up @@ -257,8 +270,37 @@ <h4 id="references">References</h4>
} );

var table = $('#customer-managed-table').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy',
'csv',
'excel',
{
extend: 'print',
text: 'Print all',
exportOptions: {
modifier: {
selected: null
}
}
},
{
extend: 'print',
text: 'Print selected'
}
],
orderCellsTop: true,
fixedHeader: true
fixedHeader: true,
columnDefs: [ {
orderable: false,
className: 'select-checkbox',
targets: 0
} ],
select: {
style: 'multi+shift',
selector: 'td:first-child'
},
order: [[ 1, 'asc' ]]
} );
} );
</script>
Expand All @@ -283,8 +325,37 @@ <h4 id="references">References</h4>
} );

var table = $('#aws-managed-table').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy',
'csv',
'excel',
{
extend: 'print',
text: 'Print all',
exportOptions: {
modifier: {
selected: null
}
}
},
{
extend: 'print',
text: 'Print selected'
}
],
orderCellsTop: true,
fixedHeader: true
fixedHeader: true,
columnDefs: [ {
orderable: false,
className: 'select-checkbox',
targets: 0
} ],
select: {
style: 'multi+shift',
selector: 'td:first-child'
},
order: [[ 1, 'asc' ]]
} );
} );
</script>
Expand All @@ -309,12 +380,38 @@ <h4 id="references">References</h4>
} );

var table = $('#principals-table').DataTable( {
orderCellsTop: true,
fixedHeader: false,
columnDefs: [
{ width: '20%', targets: 0 }
dom: 'Bfrtip',
buttons: [
'copy',
'csv',
'excel',
{
extend: 'print',
text: 'Print all',
exportOptions: {
modifier: {
selected: null
}
}
},
{
extend: 'print',
text: 'Print selected'
}
],
// autoWidth: true,
orderCellsTop: true,
fixedHeader: true,
columnDefs: [ {
orderable: false,
className: 'select-checkbox',
targets: 0
} ],
select: {
style: 'multi+shift',
selector: 'td:first-child'
},
order: [[ 1, 'asc' ]]

}
);

Expand Down
6 changes: 1 addition & 5 deletions docs/contributing/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ We try to follow [Semantic Versioning](https://semver.org/) as much as possible.

## Version bumps.

Just edit the policy_sentry/bin/policy_sentry file and update the __version__ variable:
Just edit the cloudsplaining/bin/version.py file and update the __version__ variable:

```python
#! /usr/bin/env python
"""
policy_sentry is a tool for generating least-privilege IAM Policies.
"""
__version__ = '0.0.1' # EDIT THIS
```

Expand Down
Loading

0 comments on commit 19a023b

Please sign in to comment.