Skip to content

Commit 58a5857

Browse files
authored
Merge pull request #32 from RefactorSecurity/feat-breadcrumbs
Add Breadcrumbs feature
2 parents 5643bac + df54161 commit 58a5857

15 files changed

Lines changed: 1595 additions & 46 deletions

File tree

README.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
---
1414

15-
Security Notes allows the creation of notes within source files, which can be replied to, reacted to using emojis, and assigned statuses such as "TODO", "Vulnerable" and "Not Vulnerable".
15+
Security Notes allows the creation of notes within source files, which can be replied to, reacted to using emojis, and assigned statuses such as "TODO", "Vulnerable" and "Not Vulnerable". Also, it allows importing the output from SAST tools (such as semgrep, bandit and brakeman), into notes, making the processing of the findings much easier.
1616

17-
Also, it allows importing the output from SAST tools (such as semgrep, bandit and brakeman), into notes, making the processing of the findings much easier.
17+
Use the **Breadcrumbs** feature to track complex implementations accross different source files. This way you will be able to visualize how a feature works, and export it so you can share your analysis with others.
1818

1919
Finally, collaborate with others by using a centralized database for notes that will be automatically synced in **real-time**! Create a note locally, and it will be automatically pushed to whoever is working with you on the project.
2020

@@ -42,25 +42,15 @@ Security Notes allows the creation of notes within source files, which can be re
4242

4343
By default your notes are backed up in a JSON file once you close VSCode. Once you open the project again, saved comments are loaded and shown on the UI.
4444

45-
## Collaboration Mode
46-
47-
Because chasing bugs with friends is more fun :)
48-
49-
Security Notes allows sharing of notes in real-time with other users. To do so, it leverages the RethinkDB real-time database.
50-
51-
First, make sure you have a RethinkDB database instance up and running. Then set your author name, and the database connection information in the extension's settings, and you are ready to go! Please see the section below for more details).
52-
53-
Collaboration mode in action:
45+
## Breadcrumb Trails
5446

55-
![Demo for collaboration](images/demo-collaboration.gif)
47+
Breadcrumbs let you capture the path you follow while reverse-engineering a feature. Start a trail with `Security Notes: Create Breadcrumb Trail`, highlight the snippets you visit, and run `Security Notes: Add Breadcrumb to Trail` to drop "crumbs" along the way. Each crumb stores the code selection, file/line information, and an optional note.
5648

57-
### Setting up the RethinkDB database
49+
![Breadcrumbs view showing a trail](images/breadcrumbs-1.png)
5850

59-
We recommend following instructions in RethinkDB [installation guide](https://rethinkdb.com/docs/install/). Additionally, following [hardening steps](https://rethinkdb.com/docs/security/#wrapper), such as setting a password for the `admin` user and setting up SSL/TLS, are strongly encouraged.
51+
Open the **Breadcrumbs** view from the Security Notes activity bar to see an interactive diagram of the active trail. Click any crumb in the diagram to jump back to that snippet in the editor, or switch trails from the dropdown to review other investigations. Trails are stored locally in `.security-notes-breadcrumbs.json` so you can revisit them later, and you can export the active trail to a Markdown report (via `Security Notes: Export Breadcrumb Trail` or the Export button) ready to paste into docs or reports.
6052

61-
Naturally, you will want to collaborate with remote peers. To do so in a secure way, we recommend setting up access to RethinkDB via SSH or through a VPN like [Tailscale](http://tailscale.com). This way, you avoid having to expose the instance to any network, and also ensuring information in transit is encrypted.
62-
63-
> **Important Notices:** When collaborating with others, ensure that all VSCode instances open the project from the same relative location. For example, if the source code repository you're reviewing has a directory structure like `source_code/app/src`, all peers should open VScode at the same level. Security Notes will store note location using relative paths, so they should be consistent. Also, after enabling the collaboration setting, VSCode would need to be restarted/reloaded for the change to have effect.
53+
![Markdown export of a Breadcrumb](images/breadcrumbs-2.png)
6454

6555
## Importing SAST results
6656

@@ -91,6 +81,26 @@ gosec -fmt=json -out=gosec-results.json ./...
9181
semgrep scan --json -o semgrep-results.json --config=auto .
9282
```
9383

84+
## Collaboration Mode
85+
86+
Because chasing bugs with friends is more fun :)
87+
88+
Security Notes allows sharing of notes in real-time with other users. To do so, it leverages the RethinkDB real-time database.
89+
90+
First, make sure you have a RethinkDB database instance up and running. Then set your author name, and the database connection information in the extension's settings, and you are ready to go! Please see the section below for more details).
91+
92+
Collaboration mode in action:
93+
94+
![Demo for collaboration](images/demo-collaboration.gif)
95+
96+
### Setting up the RethinkDB database
97+
98+
We recommend following instructions in RethinkDB [installation guide](https://rethinkdb.com/docs/install/). Additionally, following [hardening steps](https://rethinkdb.com/docs/security/#wrapper), such as setting a password for the `admin` user and setting up SSL/TLS, are strongly encouraged.
99+
100+
Naturally, you will want to collaborate with remote peers. To do so in a secure way, we recommend setting up access to RethinkDB via SSH or through a VPN like [Tailscale](http://tailscale.com). This way, you avoid having to expose the instance to any network, and also ensuring information in transit is encrypted.
101+
102+
> **Important Notices:** When collaborating with others, ensure that all VSCode instances open the project from the same relative location. For example, if the source code repository you're reviewing has a directory structure like `source_code/app/src`, all peers should open VScode at the same level. Security Notes will store note location using relative paths, so they should be consistent. Also, after enabling the collaboration setting, VSCode would need to be restarted/reloaded for the change to have effect.
103+
94104
## Exporting notes in popular formats
95105

96106
Currently we only support exporting notes to Markdown, but other formats such as HTML are coming soon.

images/breadcrumbs-1.png

440 KB
Loading

images/breadcrumbs-2.png

218 KB
Loading

package.json

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,34 @@
8080
{
8181
"command": "security-notes.saveNotesToFile",
8282
"title": "Security-Notes: Save Notes to Local Database"
83+
},
84+
{
85+
"command": "security-notes.breadcrumbs.createTrail",
86+
"title": "Security Notes: Create Breadcrumb Trail"
87+
},
88+
{
89+
"command": "security-notes.breadcrumbs.selectTrail",
90+
"title": "Security Notes: Select Active Breadcrumb Trail"
91+
},
92+
{
93+
"command": "security-notes.breadcrumbs.addCrumb",
94+
"title": "Security Notes: Add Breadcrumb to Trail"
95+
},
96+
{
97+
"command": "security-notes.breadcrumbs.removeCrumb",
98+
"title": "Security Notes: Remove Breadcrumb Crumb"
99+
},
100+
{
101+
"command": "security-notes.breadcrumbs.editCrumbNote",
102+
"title": "Security Notes: Edit Breadcrumb Note"
103+
},
104+
{
105+
"command": "security-notes.breadcrumbs.showTrailDiagram",
106+
"title": "Security Notes: Show Breadcrumb Diagram"
107+
},
108+
{
109+
"command": "security-notes.breadcrumbs.exportTrail",
110+
"title": "Security Notes: Export Breadcrumb Trail"
83111
}
84112
],
85113
"configuration": {
@@ -95,6 +123,11 @@
95123
"description": "Local database file path.",
96124
"default": ".security-notes.json"
97125
},
126+
"security-notes.breadcrumbs.localDatabase": {
127+
"type": "string",
128+
"description": "Local database file path for breadcrumb trails.",
129+
"default": ".security-notes-breadcrumbs.json"
130+
},
98131
"security-notes.collab.enabled": {
99132
"type": "boolean",
100133
"description": "Enable collaboration via RethinkDB.",
@@ -225,6 +258,13 @@
225258
"group": "inline@2",
226259
"when": "commentController == security-notes"
227260
}
261+
],
262+
"editor/context": [
263+
{
264+
"command": "security-notes.breadcrumbs.addCrumb",
265+
"group": "navigation@10",
266+
"when": "editorHasSelection"
267+
}
228268
]
229269
},
230270
"views": {
@@ -238,6 +278,11 @@
238278
"type": "webview",
239279
"name": "Export Notes",
240280
"id": "export-notes-view"
281+
},
282+
{
283+
"type": "webview",
284+
"name": "Breadcrumbs",
285+
"id": "breadcrumbs-view"
241286
}
242287
]
243288
},
@@ -275,4 +320,4 @@
275320
"rethinkdb": "^2.4.2",
276321
"uuid": "^9.0.0"
277322
}
278-
}
323+
}

0 commit comments

Comments
 (0)