Posts

How can I call OWASP ZAP from the command line?

 Adding Dynamic Application Security testing to your CI/CD pipeline can help you identify potential security threats earlier in the development cycle (did someone say 'Shift Left'?). There are many tools available to assist (SonarQube is very popular) but ZAP  (from our friends at OWASP) gives insight into common vulnerabilities. To execute it from a COMMAND line 1. install JAVA 2. download the solution from  here 3. navigate to your install folder on your drive (I used to the default "C:\Program Files\OWASP\Zed Proxy Attack"). 4. Release the hounds java -jar {YOUR ZAP VERSION} -cmd -quickurl {YOUR API TO QUERY} -quickprogress -quickout {FILE LOCATION TO STORE THE RESULTS} -nostdout My example is as follows: java -jar zap-2.11.0.jar -cmd -quickurl http://localhost/api/values -quickprogress -quickout "c:\temp\out.json" -nostdout

How do I add a custom background in Microsoft Teams?

 Teams has become one of the de-facto platforms for modern workplace communication. To personalize your virtual meeting space, copy your favourite image to %APPDATA%\Microsoft\Teams\Backgrounds\Uploads and relaunch Teams. Your images are now available for selection as backgrounds.

A quick way to create dummy text using MSWord

 While creating a sample page, I needed to populate some sample text quickly without using any documents from the office. I started random typing, but I quickly remembered the built in marcos in Word for just such a purpose. If you type in =lorem() and press enter, you get one line of Lorem Ipsum if you type in  =lorem(10) and press enter, you get 10 lines. If you prefer English to Latin, then type in  =rand(10) and press enter for 10 lines of 'random' text (not really random, but its text that is readable that I did not have to type) 

Confluence: How to create a 'DRAFT' watermark using CSS

Image
I added the following to my Confluence page: To do it, I put the following text in an HTML block at the top of the page: <style> .watermark {     opacity: 0.5;     color: BLACK;     position: fixed;     top: 45%;     left: 50%; font-size: 110px; font-weight: 100;     background: yellow; padding-left: 50px; padding-right: 50px; } .rotate {   transform: rotate(-45deg);   /* Legacy vendor prefixes that you probably don't need... */   /* Safari */   -webkit-transform: rotate(-45deg);   /* Firefox */   -moz-transform: rotate(-45deg);   /* IE */   -ms-transform: rotate(-45deg);   /* Opera */   -o-transform: rotate(-45deg);   /* Internet Explorer */   filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } </style> <div class="watermark rotate ">Draft</div> It seems to work well across browser too.

Confluence: Buttons to toggle expander controls

While writing a simple page in Confluence, I used expander controls to help manage real estate. To help users, I added two buttons (expand all, collapse all) to enhance the user experience. After a little experimentation, I deceided to use the OOTB icons as the trigger for the logic. A simple piece of JavaScript to check for the "chevron right" class in the anchor controls, and process the logic accordingly. Here is the script (to be placed in an HTML control on the page) <script language="JavaScript"> function expandUI(isClosed) { var a = document.getElementsByClassName("expand-control");   var b = document.getElementsByClassName("expand-icon") for (let i = 0; i < a.length; i++){ if (b[i].classList.contains("aui-iconfont-chevron-right") == isClosed) { a[i].click(); } } } // make sure the page loads with the expanders expanded window.addEventListener("load", function(){ expandUI(true); }); ...

Developer Training for PCI Compliance

In my current role, I have been tasked with providing 'Developer Training' as part of our PCI Compliance Audit. The challenge with this task is finding a solution that is acceptable to the Auditor, but not cost prohibitive. Using an external training company is an easy way but its very expensive and does not help when new starters come on board. Another option is to provide internal training (did someone say WebGoat ?), but that can be a challenge with logistics and timing. The solution we eventually deceided on was creating a Quiz using Office 365 Forms, which was based on the OWASP Top 10 and OWASP Secure Coding Practices. Access is restricted to users within the organisation and the results cannot be tampered with. Its a simple, cost effective, extendable solution to an otherwise complicate problem. The next step is to create a suitable quiz to challenge a developers knowledge ........

PowerShell: How can I list/document all the items in my azure subscription?

The following script will create an Excel file with each Resource Group as a tab. First, I created a password file to reference from the script (no passwords in clear text please) "xxxx" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"  Here is the function - it will create seperate CSV files per resource group and then merge them intoa a single Excel file at the end. BTW, you may want to change the hard coded directories, username and filenames as required..... enjoy # create a function to merge the csv files we have created Function Merge-CSVFiles  {                  Param(                                  $CSVPath = "C:\csv\", ## Soruce CSV Folder                                ...