parent
8e19d33343
commit
b84d91c9c0
@ -0,0 +1,15 @@
|
|||||||
|
FROM python:3.10.4-slim-bullseye
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
RUN mkdir keys
|
||||||
|
RUN mkdir nagrest
|
||||||
|
COPY requirements.txt ./
|
||||||
|
COPY app/* ./
|
||||||
|
COPY lib/* ./nagrest/
|
||||||
|
COPY keys/* ./keys/
|
||||||
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||||
|
RUN apt update && apt upgrade && apt install -y gnupg
|
||||||
|
RUN ["/bin/bash", "-c", "pwd && ls -l"]
|
||||||
|
RUN ["/bin/bash", "-c", "gpg --import /app/keys/*.asc"]
|
||||||
|
|
||||||
|
CMD [ "python3", "./main.py" ]
|
@ -0,0 +1,27 @@
|
|||||||
|
from flask import Flask
|
||||||
|
from flask_gnupg import GnuPG
|
||||||
|
import json
|
||||||
|
from nagrest.nag_parse import NagParse
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.config['GPG_HOME_DIR'] = "/root/.gnupg"
|
||||||
|
app.config['GPG_BINARY'] = "/usr/bin/gpg"
|
||||||
|
gpg = GnuPG(app)
|
||||||
|
parser = NagParse()
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def index():
|
||||||
|
keys_list = gpg.list_keys()
|
||||||
|
for key in keys_list:
|
||||||
|
gpg.trust_keys(key['fingerprint'], 'TRUST_ULTIMATE')
|
||||||
|
file = "/app/keys/test.sig"
|
||||||
|
with open(file, 'rb') as fh:
|
||||||
|
verified = gpg.decrypt_file(fh)
|
||||||
|
if verified.trust_level == verified.TRUST_ULTIMATE:
|
||||||
|
return str(verified).strip()
|
||||||
|
return '{}'
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# use 0.0.0.0 to use it in container
|
||||||
|
app.run(host='0.0.0.0')
|
@ -0,0 +1,75 @@
|
|||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||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6Vwj+JXBQJgx2Z5AhsgBQkB
|
||||||
|
4TOAAAoJEA2gp6Vwj+JX77UQAKIr3o4nCju/klgPEjPtT7wTT3eCGXSIcyzl0MQp
|
||||||
|
QyV1dp+b3I80ROl9Ypi1gbY3581CC/Ilk0lmJ1st7iUFq/qr32mx341jpf+exhKX
|
||||||
|
C4aAtvo97LtAI5EJiVMhqf5i6wbWlt7A0vJnB4hlTB6r71IzRmOoOtqZ86R9pSMS
|
||||||
|
e+QFtzxt++8ta/lLcES8FUS7r5MGy8D+UKYT7e6ha3umHqTYeGmfbDeGEq/MKklz
|
||||||
|
fmpzKpp2vWWuclQ4pgu/E2tzPSMb3mNJ/HNEKPhr6yEhxeUBq4dYOfqUbffll10v
|
||||||
|
LwAicWtym7GSQDEIv+USp3FQugsn/Ra31YWGXcQOyZhDtjiZuAurjlrLDg0Mr5Dx
|
||||||
|
D5YRxVIkKg+qcHGZl2Mqwa6cIwWGgZhb3fMwOKtaE0illcv/k318pAjJuFP5CQRy
|
||||||
|
khzE4WwdzkDu+2D2LnQ8ETj2YbvWLYGEr/F6AQ9icDAiqTHpMReGyH6phOHCu+os
|
||||||
|
gjdH9VPieKV06VYVZUK5K2q56vMj8WkcFIk7vsZynIb2jZ4vespd6ViAy9kw2kXf
|
||||||
|
TcrRkCcVYuAfqvytzKNcF358BX7vNqFvLEPQiXjy/92wGoAlwwfxR0N5tQUc9IcY
|
||||||
|
AUqeuwS/6EDlBnNHpswR4Cek0hPAS97iHIL8kB3sKJ+4POVsFGKZETI+RJq2Dx/I
|
||||||
|
DVhe
|
||||||
|
=wTa2
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
@ -0,0 +1,20 @@
|
|||||||
|
-----BEGIN PGP SIGNED MESSAGE-----
|
||||||
|
Hash: SHA512
|
||||||
|
|
||||||
|
{"valid": "message"}
|
||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
|
iQIzBAEBCgAdFiEEIpL7dwHsMfazpY3ODaCnpXCP4lcFAmJEGYwACgkQDaCnpXCP
|
||||||
|
4lfKwhAAx45ZJGwf6o+aZ5lFtB6b8Nqx/fOm8Ax6IFwQcLebLM79I1yvOSFlcoKk
|
||||||
|
7t3Vwj0pL8d0w+PwNLrkjC78fKDqltTlHtD7ByW7b6lPXEUX1i/e2uBTd6zv+7zg
|
||||||
|
vkWQ1tYk9IOa7X4LubwhIC3L04BC0xNwbnlDioyUox1QzOVKpRufOrr30N0CQE3d
|
||||||
|
U1S6U8y3jLAvHi7dxC+RyvHYH8QGRWoRj6TXa3lsw1aeTShct2f3fXuZT0bQlsap
|
||||||
|
TJoffKKpr2Fw5wxLja00MYkBA4SXl568HLohSeL3uSxa2D//mwZ0zowERf1C+BC7
|
||||||
|
Gx7kSIkH/+16Mn1aHVMktNIZlhvAyoLwGUvZvL81bBTP+BMttPOOHzodRHljPFlW
|
||||||
|
fCWnozTKR0ouWczXR611rIEVCjeXardiDzXyYG41fCl/83TTmMQcQ+NxMbU3Uslk
|
||||||
|
FjvjANzkz/zzdte0S2kpzfe/zCwHT8vsfQM4Jvs+i8ycH+Ui03ShirjPdtwVuKui
|
||||||
|
WIj0o8h3PnBsl6aB3uDtHAjzeDsA4qZddoCqIAcrLVm8rIHXYfvFstevMYtGBqZ7
|
||||||
|
TIq2WhtFIvF8PECXjGK5gN8V4g+uWeBJTykAUbrdWJRaH9g3kbCa2NYRuVvdkwSw
|
||||||
|
LXJnPXqIDkdxqnO2IiIdsTvTdS6iiK1wwPG+oPVkexQB3tM/Auc=
|
||||||
|
=W+Mg
|
||||||
|
-----END PGP SIGNATURE-----
|
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
Flask-GnuPG
|
||||||
|
Flask
|
@ -1,3 +0,0 @@
|
|||||||
import os, sys
|
|
||||||
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
|
||||||
from nagparse import NagParse
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import sys
|
|
||||||
from nagparse import NagParse
|
|
||||||
parser = NagParse(sys.argv[1:])
|
|
||||||
for object in parser.m_objects:
|
|
||||||
print(object.get_id())
|
|
Loading…
Reference in new issue