- Pre-requisite: Git to be preinstalled in your m/c
- Goto Command prompt & run below command
- git svn clone -r HEAD <SVN Codebase URL>
- This will create a folder with same name of app with .git file
Monday, January 22, 2024
Convert SVN Project to Git Project
Sunday, January 21, 2024
Semgrep
Semgrep is used for SAST tool.
Steps to get the SAST report:
- Checkout the code in your local directory from Github.
- Goto https://semgrep.dev/login/ & create the login
- docker run -it returntocorp/semgrep semgrep login
- Copy the URL provided in browser to Activate the token
- From Command prompt navigate to local folder where code is checked out from Github
- From command prompt copy the token & run below command with token
- docker run -e SEMGREP_APP_TOKEN=<token> --rm -v "<local repo>:/src" returntocorp/semgrep semgrep ci
- Check the report from SemGrep UI
Thursday, January 18, 2024
Trivy Code Vulnerability report
Trivy provides Third party library vulnerability report along with security key exposure in your code.
The tool also provides the version in which the vulnerability is fixed.
You can use the below steps to get a report by checkout the code from your repo:
Go to https://github.com/aquasecurity/trivy/releases/download/v0.48.3/trivy_0.48.3_windows-64bit.zip
Download the zip
Extract the folder
Goto <Extracted Folder>\trivy_0.48.3_windows-64bit
Open command line from above folder
run the below command
trivy fs <codebase path in local m/c > <app_name_>sec_rpt.txt
Further reading:
Sunday, January 7, 2024
How to manage Docker images in Github Packages
Instead of using Docker Hub, GitHub Container Registry can also be used for Image management.
You need to follow the below steps to do that:
1. Login to GHCR from Docker CLI using below command. Replace with your username & personal access token
docker login ghcr.io -u YOUR_GITHUB_USERNAME -p YOUR_PERSONAL_ACCESS_TOKEN
2. Build the Docker image locally
docker build -t ghcr.io/OWNER/IMAGE_NAME:TAG .
3. Push the docker image to GHCR
docker push ghcr.io/OWNER/IMAGE_NAME:TAG
Links for further readings:
https://cto.ai/blog/build-and-deploy-a-docker-image-on-ghcr/
Map to List Using Guava
Suppose, we have a list of Employee objects where we want to create a Map from the list with employee id as Key. You can do that with Java S...
-
SVN clients like TortoiseSVN does not come with the content search support. It can be done by using Git SCM client. Installation: Ple...
-
Below is the approach that can be used for externalize ApplicationResource properties file in Tomcat 7 & 9. Steps: 1. ...
-
Recently I have migrated one of my application from JDK 6 to JDK 8. Once I have migrated to Java 8, I observed the Heap memory is completel...