Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(amazon): support Amazon Linux 2 Extra Repository #1510

Merged
merged 3 commits into from
Aug 4, 2022

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Aug 3, 2022

What did you implement:

Amazon Linux2 has an Extra Repository, and it is necessary to select the appropriate advisory for them.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

$ docker build -t vuls-target:amzn2 -f Dockerfile .
$ docker run --rm -itd -p 2222:22 --name vuls-target vuls-target:amzn2
$ vuls scan
$ vuls report
...
vuls-target (amazon2 (Karoo))
=============================
Total: 10 (Critical:2 High:8 Medium:0 Low:0 ?:0)
10/10 Fixed, 1 poc, 2 exploits, cisa: 1, uscert: 0, jpcert: 5 alerts
208 installed

+----------------+------+--------+-----+-----------+---------+----------------------------+
|     CVE-ID     | CVSS | ATTACK | POC |   ALERT   |  FIXED  |          PACKAGES          |
+----------------+------+--------+-----+-----------+---------+----------------------------+
| CVE-2021-44228 | 10.0 |  AV:N  | POC | CISA/CERT |   fixed | java-1.8.0-amazon-corretto |
+----------------+------+--------+-----+-----------+---------+----------------------------+
| CVE-2021-45046 | 10.0 |  AV:N  | POC |      CERT |   fixed | java-1.8.0-amazon-corretto |
+----------------+------+--------+-----+-----------+---------+----------------------------+
| CVE-2022-21426 |  8.9 |  AV:N  |     |           |   fixed | java-1.8.0-amazon-corretto |
...
FROM amazonlinux:2

RUN yum -y update && yum -y install openssh-server glibc-langpack-en
RUN mkdir /var/run/sshd

RUN sed -i 's/#\?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

COPY .ssh/id_rsa.pub /root/authorized_keys
RUN mkdir ~/.ssh && \
    mv ~/authorized_keys ~/.ssh/authorized_keys && \
    chmod 0600 ~/.ssh/authorized_keys

RUN ssh-keygen -A
RUN rm -rf /run/nologin

EXPOSE 22

# Vuls Setting
RUN yum -y install yum-utils which lsof iproute

RUN amazon-linux-extras install -y corretto8=1.8.0_192

CMD ["/usr/sbin/sshd", "-D"]

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n self-assigned this Aug 3, 2022
@MaineK00n MaineK00n force-pushed the MaineK00n/support-amzn2-repo branch 4 times, most recently from 23c1211 to efd04e2 Compare August 3, 2022 05:14
@MaineK00n MaineK00n force-pushed the MaineK00n/support-amzn2-repo branch 2 times, most recently from a7d63bd to 22c0ed9 Compare August 3, 2022 09:20
@MaineK00n MaineK00n marked this pull request as ready for review August 3, 2022 09:29
@MaineK00n MaineK00n force-pushed the MaineK00n/support-amzn2-repo branch 2 times, most recently from e51da5b to 8a218db Compare August 3, 2022 09:55
@MaineK00n MaineK00n force-pushed the MaineK00n/support-amzn2-repo branch from 8a218db to 5333ef4 Compare August 4, 2022 00:03
@kotakanbe kotakanbe merged commit ca3f6b1 into master Aug 4, 2022
@kotakanbe kotakanbe deleted the MaineK00n/support-amzn2-repo branch August 4, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants