GithubHelp home page GithubHelp logo

ciis0.github.io's People

Contributors

ciis0 avatar

Watchers

 avatar  avatar

Forkers

criztovyl

ciis0.github.io's Issues

decrypt WSS xmlenc data

extract encrypted key (esec.b64) from XML

<xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EK-b2af33bb-aacd-4b6f-bbbf-cada8d8ecbee">
    <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <wsse:SecurityTokenReference>
            <!-- ... --->
        </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    <xenc:CipherData>
        <xenc:CipherValue><!-- enc.b64 --></xenc:CipherValue>
    </xenc:CipherData>
    <xenc:ReferenceList>
        <xenc:DataReference URI="#ED-585a0a6b-36f0-4d5e-9052-f98463810da0"/>
    </xenc:ReferenceList>
</xenc:EncryptedKey>

extract encrypted data (edat.b64) from XML

<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
                    Id="ED-585a0a6b-36f0-4d5e-9052-f98463810da0"
                    Type="http://www.w3.org/2001/04/xmlenc#Content">
    <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                     xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"
                                     wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey">
            <wsse:Reference URI="#EK-b2af33bb-aacd-4b6f-bbbf-cada8d8ecbee"/>
        </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    <xenc:CipherData>
        <xenc:CipherValue>
            <!-- edat.b64 -->
        </xenc:CipherValue>
    </xenc:CipherData>
</xenc:EncryptedData>

get key as pem (key.pem)

pkey.pem Private Key
esec.b64 Encrypted Secret
edat.b64 Encrypted data
# decrypt secret
base64 -d esec.b64 > esec
openssl pkeyutl -decrypt -in esec -inkey key.pem > dkey

# split data and IV
base64 -d edat.b64 > edat
dd if=edat of=edat.iv bs=1 count=16
dd if=edat of=edat.dt bs=1 skip=16

# decrypt
openssl enc -d -in edat.dt -iv $(xxd -p edat.iv) -K $(xxd -p dkey | tr -d "\n ") -aes-256-cbc > dec.xml

WSL with SSH

  • for sharing putty agent (keeagent actually) to WSL
  • psl script
  • zscaler in wsl
    • and using it from podman (using wsl ip)

IntelliJ WSL JBoss

  • jboss on windows is slow due to MS defender, running in WSL is faster

  • use sftp+rsync to copy exploded archive

    • WSL mount is dead slow
    • sftp with full war is slow, always need to copy everything
    • sftp with exploded archive is also slow, also copies everything
    • rsync is blazingly fast!
      • forget KeeAgent, that does not work
  • rotate log files

  • restart

https://gist.github.com/ciis0/b527b420b82605ef799dfd311992e3bf

How is OCP4's `detectMultilineErrors` implemented?

migration issues from maven to bazel

if you have a big multi-module project with multiple deployables, the it gets quite complicated to keep build times low, for example by building and testing only what changed.

it looks like bazel can do this.

problems that arose while investigating this:

  • IDE support: the IntelliJ plugin is not supported on Windows
    • but IntelliJ installed inside WSL (not windows IntelliJ accessing projects via \\wsl$) might work
  • Maven Dependencies
    • bazel does not properly expose transitive dependencies (e.g. if you depend on junit you won't get hamcrest, if you depend on logback, you won't get slf4j), and there are voices that oppose adding this at all.

Query OCP Logging ES with OAuth token

cat <(echo '{"index":"app-*","ignore_unavailable":true}') <(jq -c . kib.json) | oc exec -i -n openshift-logging -c elasticsearch elasticsearch-cdm-m8fggxfn-3-5bb4f58d94-5jvgl -- curl -vk https://elasticsearch:9200/_msearch --data-binary @- -H 'Content-Type: application/json' -H "Authorization: Bearer $(oc whoami -t)" | jq -C | less

kib.json: Kibana Discover -> Inspect -> Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.