Removing Passwords from Git Repos

For those who have accidentally committed passwords, api keys, etc to a guy repo, we have a great tool available to take care of it, BFG. BFG will remove those secrets from the entire git repository’s history, not just the most recent commit.

bfg --replace-text passwords.txt

git reflog expire --expire=now --all && git gc --prune=now --aggressive

Passwords.txt is just a line delimited list of passwords. Just don’t commit this to your repo

The tool is available here on github

Vxworks 6.9 Ping

I’ve started working with VXWorks now a bit, so I feel like providing some information in working in that sort of system/environment. Some of these will be short docs and some will be more in depth. Here we’ll look at the ping command.

ping("host to ping", "number of packets to receive", "options flag")

Setting options greater than 1 for printing out ping information. The list of options flags are below.

  • PING_OPT_SILENT 0x1
    • Work silently
  • PING_OPT_DONTROUTE 0x2
    • Don’t route
  • PING_OPT_DEBUG 0x3
    • Print debugging messages
  • PING_OPT_NOHOST 0x4
    • Suppress just lookup

Automated Testing in Jenkins

After setting up Jenkins to auto build and deploy my IRC bots, I decided to add the next component of a CI/CD stack, automated testing. This was to use ant to run the tests, and JUnit for the testing framework for the application. I’ll be setting this up in both of my Jenkins projects, I have one that just builds my applications, and a second that builds the docker containers and pushes them to the repository.

My Jenkins setup includes 2 builds for each of my projects:

  • Java Build
    • Builds the java application
    • This is just a general Jenkins project that uses ant to build
  • Docker Build
    • Builds the docker container, tags it, and pushes it to my local docker repository
    • This uses Jenkins pipelines to perform the build, tag, push

The docker build pushes my production code and is used by my docker-swarm to update my locally built containers. This is the important build. The general java build is just me experimenting with Jenkins builds following the non-pipeline route.

Continue reading “Automated Testing in Jenkins”

Jenkins Docker Revisit

After my initial jenkins setup, I thought my system would be good to go for a long time, however I encountered a problem with permissions after my docker cluster reboot. After all my nodes were back up, and jenkins was running, it could no longer access the docker.sock that it used to handle building and pushing containers. I tried a few things, rebuilding the container, updating it, changing some groups, and found quite a few threads on the topic. Some people had chmod’d the docker.sock to 777 (BAD) or had given jenkins root (ALSO BAD). I ended up finding the solution in using a specific entrypoint script that would determine the group to add to the jenkins user, then launch jenkins using the jenkins user from root.

Most of my additions are from sudo-bmitch’s jenkins-docker repository on GitHub. These include the dockerfile changes and the entrypoint.sh script (as well as the healthcheck mentioned later on).

Continue reading “Jenkins Docker Revisit”

IRC Botnet and Jenkins

I wrote a number of IRC bots a number of years ago, hosting them on my infrastructure. Since building a 3 node docker swarm, I decided that these would be good candidates to use in learning Jenkins for both auto building the software, and building containers. I hadn’t made my own dockerfiles before, nor had I setup proper builds outside of my IDE for these bots before.

Continue reading “IRC Botnet and Jenkins”