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

Commit fa0cf3d

Browse files
committed
Fix problems with lesson 32 stage 3
Signed-off-by: Matt Oswalt <[email protected]>
1 parent 3a05873 commit fa0cf3d

File tree

1 file changed

+7
-5
lines changed
  • lessons/workflows/lesson-32-stigcompliance/stage3

1 file changed

+7
-5
lines changed

lessons/workflows/lesson-32-stigcompliance/stage3/guide.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ We'll turn the brunt of our code into a Python function for the checking done ab
192192

193193
At the end of our function, we'll return our pass/fail grade.
194194

195-
```
195+
```python
196196
cat >> V_3969.py << EOF
197197
def NET0894(device):
198198
"""
@@ -220,7 +220,7 @@ def NET0894(device):
220220
print "IS NOT RESTRICTED TO READ-ONLY ACCESS"
221221

222222
# print some informaiton on how to fix the problem
223-
print "JUNOS FIX: set snmp community {}".format(mydev.name),
223+
print "JUNOS FIX: set snmp community {}".format(mydev.name)
224224
print "authorization read-only"
225225
print "\n"
226226

@@ -241,7 +241,7 @@ EOF
241241

242242
Then we'll add the main loop. First it will define our PyEZ Device for `vqfx1`, then call our function using this device as the argument. Then depending on what we receive back from our function, we'll print an overall pass/fail grade, and finallly nicely close the connection to `vqfx1`.
243243

244-
```
244+
```python
245245
cat >> V_3969.py << EOF
246246
# define a PyEz junos device for vqfx1
247247
dev = Device(host="vqfx1",
@@ -253,7 +253,7 @@ dev.open()
253253

254254
# Evaluate it and save the results in a variable pass_fail
255255
pass_fail = NET0894(dev)
256-
print "VULNERABILITY ASSESSMENT FOR {}".format(dev.hostname),
256+
print "VULNERABILITY ASSESSMENT FOR {}".format(dev.hostname)
257257
print "FOR V-3969: ",
258258
if pass_fail:
259259
print "PASSED"
@@ -301,6 +301,7 @@ And at last we can run our script.
301301

302302
So let's fix our problems that we introduced, and re-run our script. Note that our script actually told us the commands we
303303
need in order to fix the issues that were found.
304+
304305
```
305306
configure
306307
set snmp community public authorization read-only
@@ -313,6 +314,7 @@ commit and-quit
313314
```
314315
./V_3969.py
315316
```
317+
<button type="button" class="btn btn-primary btn-sm" onclick="runSnippetInTab('linux1', this)">Run this snippet</button>
316318

317319
This check is relatively simple, but can be used as a starting point or a building block to do much more complicated security assessments.
318-
<button type="button" class="btn btn-primary btn-sm" onclick="runSnippetInTab('linux1', this)">Run this snippet</button>
320+

0 commit comments

Comments
 (0)