Skip to content

Commit

Permalink
update to new malice/apline
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Jan 30, 2017
1 parent ee2ebe2 commit b7c8bfb
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 56 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ LICENSE
Makefile
README.md
README.md.bu
VERSION
build
circle.yml
docker-entrypoint.sh
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ All notable changes to this project will be documented in this file.

### Added

- Timeout to protect against bad files
- Timeout to protect against bad files

### Removed

### Changed

- upgrade to malice/alpine 3.5
- Upgrade Golang to 1.7.3
57 changes: 25 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ FROM malice/alpine
MAINTAINER blacktop, https://github.com/blacktop

# Install Yara
RUN apk-install openssl file bison jansson ca-certificates
RUN apk-install -t .build-deps \
openssl-dev \
jansson-dev \
build-base \
libc-dev \
file-dev \
automake \
autoconf \
libtool \
flex \
git \
gcc \
&& set -x \
&& echo "Install Yara from source..." \
RUN apk --update add --no-cache openssl file bison jansson ca-certificates
RUN apk --update add --no-cache -t .build-deps \
openssl-dev \
jansson-dev \
build-base \
libc-dev \
file-dev \
automake \
autoconf \
libtool \
flex \
git \
gcc \
&& echo "===> Install Yara from source..." \
&& cd /tmp \
&& git clone --recursive --branch v3.5.0 https://github.com/VirusTotal/yara.git \
&& cd /tmp/yara \
Expand All @@ -32,24 +31,19 @@ RUN apk-install -t .build-deps \

# Install malice plugin
COPY . /go/src/github.com/maliceio/malice-yara
RUN apk-install -t .build-deps \
build-base \
mercurial \
musl-dev \
openssl \
bash \
wget \
git \
gcc \
go \
&& cd /tmp \
&& wget https://raw.githubusercontent.com/maliceio/go-plugin-utils/master/scripts/upgrade-alpine-go.sh \
&& chmod +x upgrade-alpine-go.sh \
&& ./upgrade-alpine-go.sh \
&& echo "Building info Go binary..." \
RUN apk --update add --no-cache -t .build-deps \
build-base \
mercurial \
musl-dev \
openssl \
bash \
wget \
git \
gcc \
go \
&& echo "===> Building info Go binary..." \
&& cd /go/src/github.com/maliceio/malice-yara \
&& export GOPATH=/go \
&& export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH \
&& export CGO_CFLAGS="-I/usr/local/include" \
&& export CGO_LDFLAGS="-L/usr/local/lib" \
&& go version \
Expand All @@ -66,5 +60,4 @@ VOLUME ["/rules"]
WORKDIR /malware

ENTRYPOINT ["su-exec","malice","/sbin/tini","--","scan"]

CMD ["--help"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Malice.IO
Copyright (c) 2015-2017 Malice.IO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 15 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
REPO=malice
NAME=yara
VERSION=$(shell cat VERSION)
DEV_RUN_OPTS ?= TEST
dev:
docker build -f Dockerfile -t $(NAME):dev .
docker run --rm $(NAME):dev $(DEV_RUN_OPTS)

all: build size test

build:
docker build -t malice/$(NAME):$(VERSION) .
sed -i.bu 's/docker image-.*-blue/docker image-$(shell docker images --format "{{.Size}}" malice/$(NAME):$(VERSION))-blue/g' README.md
docker build -t $(REPO)/$(NAME):$(VERSION) .

size:
sed -i.bu 's/docker image-.*-blue/docker image-$(shell docker images --format "{{.Size}}" $(REPO)/$(NAME):$(VERSION))-blue/' README.md

release:
rm -rf release && mkdir release
go get github.com/progrium/gh-release/...
cp build/* release
gh-release create maliceio/malice-$(NAME) $(VERSION) \
$(shell git rev-parse --abbrev-ref HEAD) $(VERSION)
# glu hubtag maliceio/malice-$(NAME) $(VERSION)
tags:
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" $(REPO)/$(NAME)

circleci:
rm -f ~/.gitconfig
go get -u github.com/gliderlabs/glu
glu circleci
test:
docker run --rm $(REPO)/$(NAME):$(VERSION) --help
docker run --rm $(REPO)/$(NAME):$(VERSION) -V /bin/sh > results.json
cat results.json | jq .
cat results.json | jq -r .$(NAME).markdown

.PHONY: build release
.PHONY: build size tags test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
malice-yara
===========

[![Circle CI](https://circleci.com/gh/maliceio/malice-yara.png?style=shield)](https://circleci.com/gh/maliceio/malice-yara) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) [![Docker Stars](https://img.shields.io/docker/stars/malice/yara.svg)](https://hub.docker.com/r/malice/yara/) [![Docker Pulls](https://img.shields.io/docker/pulls/malice/yara.svg)](https://hub.docker.com/r/malice/yara/) [![Docker Image](https://img.shields.io/badge/docker image-37.26 MB-blue.svg)](https://hub.docker.com/r/malice/virustotal/)
[![Circle CI](https://circleci.com/gh/maliceio/malice-yara.png?style=shield)](https://circleci.com/gh/maliceio/malice-yara) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) [![Docker Stars](https://img.shields.io/docker/stars/malice/yara.svg)](https://hub.docker.com/r/malice/yara/) [![Docker Pulls](https://img.shields.io/docker/pulls/malice/yara.svg)](https://hub.docker.com/r/malice/yara/) [![Docker Image](https://img.shields.io/badge/docker image-38.7 MB-blue.svg)](https://hub.docker.com/r/malice/virustotal/)

Malice Yara Plugin

Expand Down Expand Up @@ -149,4 +149,4 @@ Please update the [CHANGELOG.md](https://github.com/maliceio/malice-yara/blob/ma

### License

MIT Copyright (c) 2016 **blacktop**
MIT Copyright (c) 2016-2017 **blacktop**
4 changes: 3 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ dependencies:

test:
override:
- /bin/true
- docker images malice_yara
- docker run malice_yara -V /bin/sh | jq .
- docker run malice_yara -V /bin/sh | jq -r .yara.markdown

deployment:
# master:
Expand Down
1 change: 1 addition & 0 deletions results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"yara":{"matches":null}}

0 comments on commit b7c8bfb

Please sign in to comment.