Scan code with Credential Scanner on Azure DevOps

Scan code with Credential Scanner on Azure DevOps

Scan code with Credential Scanner on Azure DevOps

🥳 Happy New Year 2023! 🥳

Wishing everyone a great year ahead!

Now, let’s get down to business. Today, I’m going to introduce you to a handy tool that checks for leaked passwords, secrets, certificates, or any sensitive content in your source code or configuration files.

Introducing our hero, “Credential Scanner” (affectionately known as CredScan), developed by Microsoft. It performs scans for sensitive data that developers might accidentally include in the source code during Continuous Integration (CI) runs on the Azure DevOps Pipeline, ensuring that our source code becomes more secure.

Prerequisites:

  • This tool is available only on the Azure DevOps Build System.
  • You need to have the Microsoft Security Code Analysis Extension installed in your organization’s account.

How to set up:

  1. Open your Project in Azure DevOps Account.

  2. Choose the Pipelines menu.

    • For a new pipeline: Select “New” -> Source code -> Repository -> Configure Pipeline.
    • For editing an existing pipeline: Click on “Edit” for the pipeline you want to modify.
  3. This will open a window showing the YAML file. Then, click on “Show assistant” on the top right-hand side. Setup Azure Pipeline

  4. Type the name of our hero in the Search box and click to add it to our YAML. Search the credential scanner tool Type “Credential Scanner” in the Tasks box.

Setup the credential scanner panel You can customize the configuration of the CredScan tool.

Add the credential scanner in YAML file The Credential Scanner tool has been successfully added to our Pipeline.

  1. After that, you can click on Save YAML.

From now on, every time the Pipeline is run, it will scan for sensitive data and display points where there are passwords, secrets, certificates, and other sensitive information for us to see.


Let’s take a look at the actual results from the scan using the Credential Scanner tool:

After running the scan in my project, I found that there are leaked keys of certificates from a library used in the project. Example of the exposed key form the scanned result

Do we have any leftover sensitive data? 🥲 Recheck the exposed key in 3rd libary

In this situation, it’s essential to investigate further and verify if the keys are indeed exposed. I suggest checking and verifying carefully if the sensitive information is still accessible. It might be a cause for concern. 🥲

Once you identify any potential issues or mistakes in your source code, I strongly advise you to address them promptly. As a software engineer, keeping the code secure is essential, and swift action can help prevent any possible security breaches. 🧑🏻‍🔧 (P.S. Keep it hush-hush; we don’t want others to know about it yet 😂)

P.S. Lastly, if anyone is interested in reading more about the technology of Mycos Company, you can follow and read further content on their Medium page at https://medium.com/mycostech


References:

Related Posts

Let's check our site's accessibility easily using 'Accessibility Insights for Web' on Microsoft Edge.

Let's check our site's accessibility easily using 'Accessibility Insights for Web' on Microsoft Edge.

Hello to all the readers who have come across this article. Lately, I've been quite busy and it's taken me a while to find some free time to write on Medium. Today, I want to share some knowledge tha

read more
How to analyze your code repository in GitHub via CodeQL engine

How to analyze your code repository in GitHub via CodeQL engine

👋 Hello Everyone 👋 During this time, I got a chance to improve & increase code security in my main project. In that, my team uses Azure Pipeline & CodeQL (aka Sammle) to analyze code once merge to

read more
Awaitable Long Running Producer-Consumer

Awaitable Long Running Producer-Consumer

Normally we use producer-consumer problem to solve certain problems like write buffer, cache buffer or any operation (producer) that needs to entry data into a queue and having another operation (con

read more
Let's create our own Crypto coin, easy and in just a few minutes (no coding knowledge).

Let's create our own Crypto coin, easy and in just a few minutes (no coding knowledge).

Hello everyone who stumbled upon and came to read. I've been away from writing a blog for a while. Caught up with work, trying this and that, blah blah blah. But now it's time to come back and write

read more
Let's try to create Power Automate connected to SQL Server for sending Leave Approval Email using Low code together.

Let's try to create Power Automate connected to SQL Server for sending Leave Approval Email using Low code together.

Hello everyone! I've been away for a long time from blogging due to various events that have kept me busy, making it challenging to find time for writing. In my latest article, I briefly introduced P

read more
Customize the website to display using Tampermonkey

Customize the website to display using Tampermonkey

Many people may feel dissatisfied with certain websites when they browse them, for example:* Disliking intrusive banner advertisements that strain the eyes. * Wishing a website had specific feature

read more
Conditional Formatting (Fx) in PowerBI Custom Visual

Conditional Formatting (Fx) in PowerBI Custom Visual

👋 Hi Everyone 👋 During this time, I have a chance to implement the PowerBI Custom Visual with my team. And we spent a lot of time researching the conditional formatting (Fx) and we found many inter

read more
An Introduction to Microsoft's Power Automate

An Introduction to Microsoft's Power Automate

Today, we're introducing Microsoft's Power Automate, formerly known as Microsoft Flow. If you're familiar with Microsoft Power Platform services such as Dynamics 365, SharePoint, Power Apps, PowerBI,

read more
Pass Through Data Over IServiceProvider.CreateScope()

Pass Through Data Over IServiceProvider.CreateScope()

[ASP.NET] In some cases you may encounter the situation that you need to pass through some particular data over a new scope of Service Provider.For instance, when you implement a solution that inte

read more
Write Unit Tests for React Hooks using react-hooks-testing-library

Write Unit Tests for React Hooks using react-hooks-testing-library

Hooks in React are a feature that has drastically changed the way we write React. It's like undergoing plastic surgery in Korea, where some developers love the new look, while others prefer the old o

read more
Easy way to check user’s permission on SharePoint Online site in the web part

Easy way to check user’s permission on SharePoint Online site in the web part

Hello Everyone! 🎉 Happy New Year 2021 🎉 I hope you have a wonderful holiday, good vibes, and a nice party 🍻. This blog is the 2nd content which’s I write in English. In the previous blog, I explai

read more
SharePoint Group & Permission levels in SharePoint Online

SharePoint Group & Permission levels in SharePoint Online

Hello everyone 👋 !!! This is the 1st time that I wrote the SharePoint Online blog in English. This blog explains permission levels in SharePoint Online. Once you create a new site in SharePoint Onli

read more
Speed up and make your SPFx reloads quick and easy with the SPFx-Fast-Serve tool.

Speed up and make your SPFx reloads quick and easy with the SPFx-Fast-Serve tool.

Hello everyone! I'm back! In the past period, I've been busy expanding my knowledge, reading some Microsoft Learning materials, trying out new things, and handling various tasks, which left me with l

read more
Convert interface to enum (for those too lazy to type 'name' in the input form) in TypeScript

Convert interface to enum (for those too lazy to type 'name' in the input form) in TypeScript

![Convert interface to enum cover](/images/posts/transform-interface-as-enum-typescript/transform_interface-as-enum-cover.png)It's a small trick to convert an Interface to an Enum, helping to solve

read more
Utilize WebAssembly in .NET

Utilize WebAssembly in .NET

We heard the WebAssembly quite a while ago but the use case, especially for .NET developers, was still limited. As of the time writing this post, in the last quarter of 2022, there are many new thing

read more
What is SharePoint? How does it work? Let's take a look together! 😆

What is SharePoint? How does it work? Let's take a look together! 😆

Hello everyone who stumbled upon and is reading this content. After spending a considerable time exploring various content on Medium, I wanted to share a little bit of my knowledge. Having delved int

read more